Commit 141b2e9f by Jeff Law

pa.md (define split for (plus (reg) (large_constant)): Try another way to handle…

pa.md (define split for (plus (reg) (large_constant)): Try another way to handle this with only 2 insns.

        * pa.md (define split for (plus (reg) (large_constant)): Try
        another way to handle this with only 2 insns.  From Tege.

From-SVN: r10616
parent 1ace9b60
...@@ -2903,7 +2903,10 @@ ...@@ -2903,7 +2903,10 @@
/* Try dividing the constant by 2, then 4, and finally 8 to see /* Try dividing the constant by 2, then 4, and finally 8 to see
if we can get a constant which can be loaded into a register if we can get a constant which can be loaded into a register
in a single instruction (cint_ok_for_move). */ in a single instruction (cint_ok_for_move).
If that fails, try to negate the constant and subtract it
from our input operand. */
if (intval % 2 == 0 && cint_ok_for_move (intval / 2)) if (intval % 2 == 0 && cint_ok_for_move (intval / 2))
{ {
operands[2] = GEN_INT (intval / 2); operands[2] = GEN_INT (intval / 2);
...@@ -2919,6 +2922,12 @@ ...@@ -2919,6 +2922,12 @@
operands[2] = GEN_INT (intval / 8); operands[2] = GEN_INT (intval / 8);
operands[3] = GEN_INT (8); operands[3] = GEN_INT (8);
} }
else if (cint_ok_for_move (-intval))
{
emit_insn (gen_rtx (SET, VOIDmode, operands[4], GEN_INT (-intval)));
emit_insn (gen_subsi3 (operands[0], operands[1], operands[4]));
DONE;
}
else else
FAIL; FAIL;
}") }")
......
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