Jamie Prescott schrieb:
Is there a reason why something like this would not work?
(define_insn "addsi3_nc"
[(set (match_operand:SI 0 "fullreg_operand" "=r")
(plus:SI (match_operand:SI 1 "fullreg_operand" "r")
(match_operand:SI 2 "fullreg_or_imm_operand" "rn")))]
""
"..."
)
(define_expand "addsi3"
[(set (match_operand:SI 0 "fullreg_operand" "=r")
(plus:SI (match_operand:SI 1 "fullreg_operand" "r")
(match_operand:SI 2 "fullreg_or_imm_operand" "rn")))]
""
{
if (!TARGET_XXX2)
emit_clobber(gen_rtx_REG(CCmode, CC_REGNUM));
emit_insn(gen_addsi3_nc(operands[0], operands[1], operands[2]));
DONE;
}
)
That would limit to two instructions per basic insns, instead of the current
three.
Thanks,
- Jamie
Maybe that works. But I would not include such stuff in one of my
machine descriptions because addsi3_nc lies: Its effect on the machine
differ from what it states algebraically in RTL. Therefore, you may get
trouble in corner cases or when instructions are
reordered/scheduled/combined/...
Georg-Johann