aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-03-25 17:51:43 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-03-25 17:51:43 -0500
commit5bf136183fbfdb7ee77b9a825308c075826832bf (patch)
tree913ed64da4b0dfe7b31552755ea327dd6ae5e172 /gcc/config
parent3d0f0ad043e5469b9149cb56dc4d17313c2a768e (diff)
downloadgcc-5bf136183fbfdb7ee77b9a825308c075826832bf.zip
gcc-5bf136183fbfdb7ee77b9a825308c075826832bf.tar.gz
gcc-5bf136183fbfdb7ee77b9a825308c075826832bf.tar.bz2
(movsi): New strategy for moving small constants into dregs, if it
can't be done with moveq. From-SVN: r6902
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/m68k/m68k.md43
1 files changed, 8 insertions, 35 deletions
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index a237325..d5220aa 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -763,45 +763,18 @@
return \"moveq %1,%0\";
#endif
}
-#ifndef NO_ADDSUB_Q
- else if (DATA_REG_P (operands[0])
- /* Do this with a moveq #N-8, dreg; addq #8,dreg */
- && INTVAL (operands[1]) < 136
- && INTVAL (operands[1]) >= 128)
- {
- operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) - 8);
-#if defined(MOTOROLA) && !defined(CRDS)
- return \"moveq%.l %1,%0\;addq%.w %#8,%0\";
-#else
- return \"moveq %1,%0\;addq%.w %#8,%0\";
-#endif
- }
else if (DATA_REG_P (operands[0])
- /* Do this with a moveq #N+8, dreg; subq #8,dreg */
- && INTVAL (operands[1]) < -128
- && INTVAL (operands[1]) >= -136)
+ /* if -256 < N < 256 but N is not in range for a moveq
+ N^ff will be, so use moveq #N^ff, dreg; not.b dreg. */
+ && INTVAL (operands[1]) < 256
+ && INTVAL (operands[1]) >= -256)
{
- operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) + 8);
+ operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) ^ 0xff);
#if defined(MOTOROLA) && !defined(CRDS)
- return \"moveq%.l %1,%0;subq%.w %#8,%0\";
+ return \"moveq%.l %1,%0\;not%.b %0\";
#else
- return \"moveq %1,%0;subq%.w %#8,%0\";
-#endif
- }
-#endif
- else if (DATA_REG_P (operands[0])
- /* If N is in the right range and is even, then use
- moveq #N/2, dreg; addl dreg,dreg */
- && INTVAL (operands[1]) > 127
- && INTVAL (operands[1]) <= 254
- && INTVAL (operands[1]) % 2 == 0)
- {
- operands[1] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[1]) / 2);
-#if defined(MOTOROLA) && !defined(CRDS)
- return \"moveq%.l %1,%0\;add%.w %0,%0\";
-#else
- return \"moveq %1,%0\;add%.w %0,%0\";
-#endif
+ return \"moveq %1,%0\;not%.b %0\";
+#endif
}
else if (ADDRESS_REG_P (operands[0])
&& INTVAL (operands[1]) < 0x8000