(stack adjust peepholes): Use lea instead of add.w when adding 16 bit

constants on all but TARGET_68040.

From-SVN: r13569
This commit is contained in:
Richard Kenner 1997-01-30 09:34:19 -05:00
parent 073b0524fc
commit b454fefef9

View File

@ -6450,8 +6450,7 @@
else else
output_asm_insn (\"addq%.l %1,%0\", xoperands); output_asm_insn (\"addq%.l %1,%0\", xoperands);
} }
else if (INTVAL (xoperands[1]) <= 16 else if (TARGET_CPU32 && INTVAL (xoperands[1]) <= 16)
&& TARGET_68020 && !TARGET_68040 && !TARGET_68060)
{ {
xoperands[1] = gen_rtx (CONST_INT, VOIDmode, xoperands[1] = gen_rtx (CONST_INT, VOIDmode,
INTVAL (xoperands[1]) - 8); INTVAL (xoperands[1]) - 8);
@ -6459,8 +6458,17 @@
} }
else else
#endif #endif
if (INTVAL (xoperands[1]) <= 0x7FFF && !TARGET_5200) if (INTVAL (xoperands[1]) <= 0x7FFF)
output_asm_insn (\"add%.w %1,%0\", xoperands); {
if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands);
else
#ifdef MOTOROLA
output_asm_insn (\"lea (%c1,%0),%0\", xoperands);
#else
output_asm_insn (\"lea %0@(%c1),%0\", xoperands);
#endif
}
else else
output_asm_insn (\"add%.l %1,%0\", xoperands); output_asm_insn (\"add%.l %1,%0\", xoperands);
} }
@ -6493,8 +6501,7 @@
else else
output_asm_insn (\"addq%.l %1,%0\", xoperands); output_asm_insn (\"addq%.l %1,%0\", xoperands);
} }
else if (INTVAL (xoperands[1]) <= 16 else if (TARGET_CPU32 && INTVAL (xoperands[1]) <= 16)
&& TARGET_68020 && !TARGET_68040 && !TARGET_68060)
{ {
xoperands[1] = gen_rtx (CONST_INT, VOIDmode, xoperands[1] = gen_rtx (CONST_INT, VOIDmode,
INTVAL (xoperands[1]) - 8); INTVAL (xoperands[1]) - 8);
@ -6502,8 +6509,17 @@
} }
else else
#endif #endif
if (INTVAL (xoperands[1]) <= 0x7FFF && !TARGET_5200) if (INTVAL (xoperands[1]) <= 0x7FFF)
output_asm_insn (\"add%.w %1,%0\", xoperands); {
if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands);
else
#ifdef MOTOROLA
output_asm_insn (\"lea (%c1,%0),%0\", xoperands);
#else
output_asm_insn (\"lea %0@(%c1),%0\", xoperands);
#endif
}
else else
output_asm_insn (\"add%.l %1,%0\", xoperands); output_asm_insn (\"add%.l %1,%0\", xoperands);
} }