Commit 199fcc3a authored by Matthias Braun's avatar Matthias Braun
Browse files

sparc: support mode_b lowering

[r28070]
parent 8ef2480e
......@@ -536,15 +536,24 @@ static int sparc_get_reg_class_alignment(const arch_register_class_t *cls)
return get_mode_size_bytes(mode);
}
static ir_node *sparc_create_set(ir_node *cond)
{
return ir_create_cond_set(cond, mode_Iu);
}
static void sparc_lower_for_target(void)
{
int i;
int n_irgs = get_irp_n_irgs();
/* TODO, doubleword lowering and others */
lower_mode_b_config_t lower_mode_b_config = {
mode_Iu,
sparc_create_set,
0,
};
for (i = 0; i < n_irgs; ++i) {
ir_graph *irg = get_irp_irg(i);
ir_lower_mode_b(irg, &lower_mode_b_config);
lower_switch(irg, 256, false);
}
}
......@@ -552,9 +561,17 @@ static void sparc_lower_for_target(void)
static int sparc_is_mux_allowed(ir_node *sel, ir_node *mux_false,
ir_node *mux_true)
{
(void) sel;
(void) mux_false;
(void) mux_true;
ir_graph *irg = get_irn_irg(sel);
ir_mode *mode = get_irn_mode(mux_true);
if (get_irg_phase_state(irg) == phase_low)
return false;
if (!mode_is_int(mode) && !mode_is_reference(mode) && mode != mode_b)
return false;
if (is_Const(mux_true) && is_Const_one(mux_true) &&
is_Const(mux_false) && is_Const_null(mux_false))
return true;
return false;
}
......
......@@ -451,9 +451,6 @@ static const ir_node *pick_delay_slot_for(const ir_node *node)
while (sched_has_prev(schedpoint)) {
schedpoint = sched_prev(schedpoint);
if (tries++ >= PICK_DELAY_SLOT_MAX_DISTANCE)
break;
if (has_delay_slot(schedpoint))
break;
......@@ -461,6 +458,9 @@ static const ir_node *pick_delay_slot_for(const ir_node *node)
if (is_no_instruction(schedpoint))
continue;
if (tries++ >= PICK_DELAY_SLOT_MAX_DISTANCE)
break;
if (emits_multiple_instructions(schedpoint))
continue;
......
......@@ -1132,14 +1132,18 @@ static ir_node *gen_Conv(ir_node *node)
{
ir_node *block = be_transform_node(get_nodes_block(node));
ir_node *op = get_Conv_op(node);
ir_node *new_op = be_transform_node(op);
ir_mode *src_mode = get_irn_mode(op);
ir_mode *dst_mode = get_irn_mode(node);
dbg_info *dbg = get_irn_dbg_info(node);
ir_node *new_op;
int src_bits = get_mode_size_bits(src_mode);
int dst_bits = get_mode_size_bits(dst_mode);
if (src_mode == mode_b)
panic("ConvB not lowered %+F", node);
new_op = be_transform_node(op);
if (src_mode == dst_mode)
return new_op;
......@@ -1165,6 +1169,8 @@ static ir_node *gen_Conv(ir_node *node)
}
return create_itof(dbg, block, new_op, dst_mode);
}
} else if (src_mode == mode_b) {
panic("ConvB not lowered %+F", node);
} else { /* complete in gp registers */
int min_bits;
ir_mode *min_mode;
......
......@@ -149,9 +149,6 @@ ir_node *ir_create_cond_set(ir_node *cond_value, ir_mode *dest_mode)
set_irn_in(lower_block, ARRAY_SIZE(lower_in), lower_in);
phi = new_r_Phi(lower_block, ARRAY_SIZE(phi_in), phi_in, dest_mode);
assert(get_Block_phis(lower_block) == NULL);
set_Block_phis(lower_block, phi);
set_Phi_next(phi, NULL);
/* make sure we do visit the cond_value later... */
ARR_APP1(ir_node*, check_later, cond_value);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment