This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH/m68k] unify moveq handling
Hello!
This patch is a cleanup for MIT/MOTOROLA syntax in the m68k backend. It
unifies moveq instruction handling. Since m68k.md already contains moveq
without size specifier and all gas version accepting moveq without I
removed %.l from all patterns using moveq. That was the only difference
in these patterns.
Gunther
2003-07-16 Gunther Nikl <gni@gecko.de>
* config/m68k/m68k.c (output_move_const_into_data_reg,
output_move_himode): unify MOTOROLA/MIT handling of moveq
* config/m68k/m68k.md (movsi_const0, anonymous define_insn):
Likewise
--- m68k.c_ Mon Jul 7 10:25:32 2003
+++ m68k.c Wed Jul 16 13:51:27 2003
@@ -1605,41 +1605,21 @@ output_move_const_into_data_reg (operand
switch (const_method (operands[1]))
{
case MOVQ :
-#if defined (MOTOROLA)
- return "moveq%.l %1,%0";
-#else
return "moveq %1,%0";
-#endif
case NOTB :
operands[1] = GEN_INT (i ^ 0xff);
-#if defined (MOTOROLA)
- return "moveq%.l %1,%0\n\tnot%.b %0";
-#else
return "moveq %1,%0\n\tnot%.b %0";
-#endif
case NOTW :
operands[1] = GEN_INT (i ^ 0xffff);
-#if defined (MOTOROLA)
- return "moveq%.l %1,%0\n\tnot%.w %0";
-#else
return "moveq %1,%0\n\tnot%.w %0";
-#endif
case NEGW :
-#if defined (MOTOROLA)
- return "moveq%.l %#-128,%0\n\tneg%.w %0";
-#else
return "moveq %#-128,%0\n\tneg%.w %0";
-#endif
case SWAP :
{
unsigned u = i;
operands[1] = GEN_INT ((u << 16) | (u >> 16));
-#if defined (MOTOROLA)
- return "moveq%.l %1,%0\n\tswap %0";
-#else
return "moveq %1,%0\n\tswap %0";
-#endif
}
case MOVL :
return "move%.l %1,%0";
@@ -1718,11 +1698,7 @@ output_move_himode (operands)
&& INTVAL (operands[1]) < 128
&& INTVAL (operands[1]) >= -128)
{
-#if defined(MOTOROLA)
- return "moveq%.l %1,%0";
-#else
return "moveq %1,%0";
-#endif
}
else if (INTVAL (operands[1]) < 0x8000
&& INTVAL (operands[1]) >= -0x8000)
@@ -1822,11 +1798,7 @@ output_move_qimode (operands)
&& INTVAL (operands[1]) < 128
&& INTVAL (operands[1]) >= -128)
{
-#if defined(MOTOROLA)
- return "moveq%.l %1,%0";
-#else
return "moveq %1,%0";
-#endif
}
if (operands[1] == const0_rtx && ADDRESS_REG_P (operands[0]))
return "sub%.l %0,%0";
--- m68k.md_ Mon Jul 7 10:25:32 2003
+++ m68k.md Wed Jul 16 13:51:27 2003
@@ -718,11 +718,7 @@
}
/* moveq is faster on the 68000. */
if (DATA_REG_P (operands[0]) && (!TARGET_68020 && !TARGET_5200))
-#if defined(MOTOROLA)
- return \"moveq%.l %#0,%0\";
-#else
return \"moveq %#0,%0\";
-#endif
return \"clr%.l %0\";
}")
@@ -932,11 +928,7 @@
/* moveq is faster on the 68000. */
if (DATA_REG_P (operands[0]) && !(TARGET_68020 || TARGET_5200))
{
-#if defined(MOTOROLA)
- return \"moveq%.l %#0,%0\";
-#else
return \"moveq %#0,%0\";
-#endif
}
return \"clr%.l %0\";
}