Commit 99818db1 authored by Michael Beck's avatar Michael Beck
Browse files

Improved MVN support.

[r27799]
parent 1de9ff0c
......@@ -412,15 +412,13 @@ static ir_node *gen_int_binop(ir_node *node, match_flags_t flags,
const arm_shifter_operand_t *attr = get_arm_shifter_operand_attr_const(new_op2);
switch (attr->shift_modifier) {
ir_node *mov_op, *mov_sft;
case ARM_SHF_IMM:
case ARM_SHF_ASR_IMM:
case ARM_SHF_LSL_IMM:
case ARM_SHF_LSR_IMM:
case ARM_SHF_ROR_IMM:
if (factory->new_binop_reg_shift_imm) {
mov_op = get_irn_n(new_op2, 0);
ir_node *mov_op = get_irn_n(new_op2, 0);
return factory->new_binop_reg_shift_imm(dbgi, block, new_op1, mov_op,
attr->shift_modifier, attr->shift_immediate);
}
......@@ -431,8 +429,8 @@ static ir_node *gen_int_binop(ir_node *node, match_flags_t flags,
case ARM_SHF_LSR_REG:
case ARM_SHF_ROR_REG:
if (factory->new_binop_reg_shift_reg) {
mov_op = get_irn_n(new_op2, 0);
mov_sft = get_irn_n(new_op2, 1);
ir_node *mov_op = get_irn_n(new_op2, 0);
ir_node *mov_sft = get_irn_n(new_op2, 1);
return factory->new_binop_reg_shift_reg(dbgi, block, new_op1, mov_op, mov_sft,
attr->shift_modifier);
}
......@@ -824,7 +822,32 @@ static ir_node *gen_Not(ir_node *node)
ir_node *new_op = be_transform_node(op);
dbg_info *dbgi = get_irn_dbg_info(node);
/* TODO: we could do alot more here with all the Mvn variations */
/* check if we can fold in a Mov */
if (is_arm_Mov(new_op)) {
const arm_shifter_operand_t *attr = get_arm_shifter_operand_attr_const(new_op);
switch (attr->shift_modifier) {
ir_node *mov_op, *mov_sft;
case ARM_SHF_IMM:
case ARM_SHF_ASR_IMM:
case ARM_SHF_LSL_IMM:
case ARM_SHF_LSR_IMM:
case ARM_SHF_ROR_IMM:
mov_op = get_irn_n(new_op, 0);
return new_bd_arm_Mvn_reg_shift_imm(dbgi, block, mov_op,
attr->shift_modifier, attr->shift_immediate);
case ARM_SHF_ASR_REG:
case ARM_SHF_LSL_REG:
case ARM_SHF_LSR_REG:
case ARM_SHF_ROR_REG:
mov_op = get_irn_n(new_op, 0);
mov_sft = get_irn_n(new_op, 1);
return new_bd_arm_Mvn_reg_shift_reg(dbgi, block, mov_op, mov_sft,
attr->shift_modifier);
}
}
return new_bd_arm_Mvn_reg(dbgi, block, new_op);
}
......
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