Commit c6e85785 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Clean up need_constraint_copy().

[r22503]
parent 1848b454
...@@ -208,18 +208,25 @@ static void ia32_transform_sub_to_neg_add(ir_node *irn, ia32_code_gen_t *cg) { ...@@ -208,18 +208,25 @@ static void ia32_transform_sub_to_neg_add(ir_node *irn, ia32_code_gen_t *cg) {
DBG_OPT_SUB2NEGADD(irn, res); DBG_OPT_SUB2NEGADD(irn, res);
} }
static INLINE int need_constraint_copy(ir_node *irn) { static INLINE int need_constraint_copy(ir_node *irn)
/* the 3 operand form of IMul needs no constraint copy */ {
if(is_ia32_IMul(irn)) { /* TODO this should be determined from the node specification */
ir_node *right = get_irn_n(irn, n_ia32_IMul_right); switch (get_ia32_irn_opcode(irn)) {
if(is_ia32_Immediate(right)) case iro_ia32_IMul: {
/* the 3 operand form of IMul needs no constraint copy */
ir_node *right = get_irn_n(irn, n_ia32_IMul_right);
return !is_ia32_Immediate(right);
}
case iro_ia32_Lea:
case iro_ia32_Conv_I2I:
case iro_ia32_Conv_I2I8Bit:
case iro_ia32_CMov:
return 0; return 0;
}
return ! is_ia32_Lea(irn) && default:
! is_ia32_Conv_I2I(irn) && return 1;
! is_ia32_Conv_I2I8Bit(irn) && }
! is_ia32_CMov(irn);
} }
/** /**
......
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