diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1997-01-30 09:34:19 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1997-01-30 09:34:19 -0500 |
commit | b454fefef9814496d449663b2877e5c56efce257 (patch) | |
tree | a76383201f6f717350f4604dc1e19e5ca972d538 /gcc | |
parent | 073b0524fc3c8cd7e0ec329bbcd9bd5960d96cad (diff) | |
download | gcc-b454fefef9814496d449663b2877e5c56efce257.zip gcc-b454fefef9814496d449663b2877e5c56efce257.tar.gz gcc-b454fefef9814496d449663b2877e5c56efce257.tar.bz2 |
(stack adjust peepholes): Use lea instead of add.w when adding 16 bit
constants on all but TARGET_68040.
From-SVN: r13569
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/m68k/m68k.md | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 1ad55fc..c242f42 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -6450,8 +6450,7 @@ else output_asm_insn (\"addq%.l %1,%0\", xoperands); } - else if (INTVAL (xoperands[1]) <= 16 - && TARGET_68020 && !TARGET_68040 && !TARGET_68060) + else if (TARGET_CPU32 && INTVAL (xoperands[1]) <= 16) { xoperands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (xoperands[1]) - 8); @@ -6459,8 +6458,17 @@ } else #endif - if (INTVAL (xoperands[1]) <= 0x7FFF && !TARGET_5200) - output_asm_insn (\"add%.w %1,%0\", xoperands); + if (INTVAL (xoperands[1]) <= 0x7FFF) + { + 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 output_asm_insn (\"add%.l %1,%0\", xoperands); } @@ -6493,8 +6501,7 @@ else output_asm_insn (\"addq%.l %1,%0\", xoperands); } - else if (INTVAL (xoperands[1]) <= 16 - && TARGET_68020 && !TARGET_68040 && !TARGET_68060) + else if (TARGET_CPU32 && INTVAL (xoperands[1]) <= 16) { xoperands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (xoperands[1]) - 8); @@ -6502,8 +6509,17 @@ } else #endif - if (INTVAL (xoperands[1]) <= 0x7FFF && !TARGET_5200) - output_asm_insn (\"add%.w %1,%0\", xoperands); + if (INTVAL (xoperands[1]) <= 0x7FFF) + { + 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 output_asm_insn (\"add%.l %1,%0\", xoperands); } |