"*
{
if (ADDRESS_REG_P (operands[0]))
- return \"sub%.l %0,%0\";
+ {
+ /* On the '040, 'subl an,an' takes 2 clocks while lea takes only 1 */
+ if (!TARGET_68040 && !TARGET_68060)
+ return \"sub%.l %0,%0\";
+ else
+ {
+#ifdef MOTOROLA
+#ifdef SGS
+ /* Many SGS assemblers croak on size specifiers for constants. */
+ return \"lea 0,%0\";
+#else
+ return \"lea 0.w,%0\";
+#endif
+#else
+ return \"lea 0:w,%0\";
+#endif
+ }
+ }
/* moveq is faster on the 68000. */
if (DATA_REG_P (operands[0]) && (!TARGET_68020 && !TARGET_5200))
#if defined(MOTOROLA) && !defined(CRDS)
? \"subq%.w %2,%0\"
: \"subq%.l %2,%0\");
}
- /* On the 68020 it is faster to use two addqw instructions to
+ /* On the CPU32 it is faster to use two addqw instructions to
add a small integer (8 < N <= 16) to an address register.
Likewise for subqw. */
- if (TARGET_68020 && !TARGET_68040 && !TARGET_68060
- && ADDRESS_REG_P (operands[0]))
+ if (TARGET_CPU32 && ADDRESS_REG_P (operands[0]))
{
if (INTVAL (operands[2]) > 8
&& INTVAL (operands[2]) <= 16)
&& INTVAL (operands[2]) >= -0x8000
&& INTVAL (operands[2]) < 0x8000)
{
- if (!TARGET_5200)
+ if (TARGET_68040)
return \"add%.w %2,%0\";
else
#ifdef MOTOROLA
"!TARGET_5200"
"*
{
-#ifndef NO_ADDSUB_Q
if (GET_CODE (operands[2]) == CONST_INT)
{
+#ifndef NO_ADDSUB_Q
/* If the constant would be a negative number when interpreted as
HImode, make it negative. This is usually, but not always, done
elsewhere in the compiler. First check for constants out of range,
- INTVAL (operands[2]));
return \"subq%.w %2,%0\";
}
- /* On the 68020 it is faster to use two addqw instructions to
+ /* On the CPU32 it is faster to use two addqw instructions to
add a small integer (8 < N <= 16) to an address register.
Likewise for subqw. */
- if (TARGET_68020 && !TARGET_68040 && !TARGET_68060
- && ADDRESS_REG_P (operands[0]))
+ if (TARGET_CPU32 && ADDRESS_REG_P (operands[0]))
{
if (INTVAL (operands[2]) > 8
&& INTVAL (operands[2]) <= 16)
return \"subq%.w %#8,%0\;subq%.w %2,%0\";
}
}
- }
#endif
+ if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
+#ifdef MOTOROLA
+ return \"lea (%c2,%0),%0\";
+#else
+ return \"lea %0@(%c2),%0\";
+#endif
+ }
return \"add%.w %2,%0\";
}")
"!TARGET_5200"
"*
{
-#ifndef NO_ADDSUB_Q
if (GET_CODE (operands[1]) == CONST_INT)
{
+#ifndef NO_ADDSUB_Q
/* If the constant would be a negative number when interpreted as
HImode, make it negative. This is usually, but not always, done
elsewhere in the compiler. First check for constants out of range,
- INTVAL (operands[1]));
return \"subq%.w %1,%0\";
}
- /* On the 68020 it is faster to use two addqw instructions to
+ /* On the CPU32 it is faster to use two addqw instructions to
add a small integer (8 < N <= 16) to an address register.
Likewise for subqw. */
- if (TARGET_68020 && !TARGET_68040 && !TARGET_68060
- && ADDRESS_REG_P (operands[0]))
+ if (TARGET_CPU32 && ADDRESS_REG_P (operands[0]))
{
if (INTVAL (operands[1]) > 8
&& INTVAL (operands[1]) <= 16)
return \"subq%.w %#8,%0\;subq%.w %1,%0\";
}
}
- }
#endif
+ if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
+#ifdef MOTOROLA
+ return \"lea (%c1,%0),%0\";
+#else
+ return \"lea %0@(%c1),%0\";
+#endif
+ }
return \"add%.w %1,%0\";
}")
"!TARGET_5200"
"*
{
-#ifndef NO_ADDSUB_Q
if (GET_CODE (operands[1]) == CONST_INT)
{
+#ifndef NO_ADDSUB_Q
/* If the constant would be a negative number when interpreted as
HImode, make it negative. This is usually, but not always, done
elsewhere in the compiler. First check for constants out of range,
- INTVAL (operands[1]));
return \"subq%.w %1,%0\";
}
- /* On the 68020 it is faster to use two addqw instructions to
+ /* On the CPU32 it is faster to use two addqw instructions to
add a small integer (8 < N <= 16) to an address register.
Likewise for subqw. */
- if (TARGET_68020 && !TARGET_68040 && !TARGET_68060
- && ADDRESS_REG_P (operands[0]))
+ if (TARGET_CPU32 && ADDRESS_REG_P (operands[0]))
{
if (INTVAL (operands[1]) > 8
&& INTVAL (operands[1]) <= 16)
return \"subq%.w %#8,%0\;subq%.w %1,%0\";
}
}
- }
#endif
+ if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
+#ifdef MOTOROLA
+ return \"lea (%c1,%0),%0\";
+#else
+ return \"lea %0@(%c1),%0\";
+#endif
+ }
return \"add%.w %1,%0\";
}")