m68k.md (adddi3, subdi3): Properly negate the DImode constant.
authorAndreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Thu, 7 May 1998 01:59:07 +0000 (01:59 +0000)
committerAndreas Schwab <schwab@gcc.gnu.org>
Thu, 7 May 1998 01:59:07 +0000 (01:59 +0000)
* config/m68k/m68k.md (adddi3, subdi3): Properly negate the DImode
constant.

From-SVN: r19607

gcc/ChangeLog
gcc/config/m68k/m68k.md

index 9bbb77ea4ce1d22b167bd5739579c7ba5b661bb0..d49b70ed32a2486a1060c30ec93eeb43d3c14e81 100644 (file)
@@ -1,3 +1,8 @@
+Thu May  7 10:55:59 1998  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * config/m68k/m68k.md (adddi3, subdi3): Properly negate the DImode
+       constant. 
+
 Wed May  6 22:32:37 CDT 1998 Robert Lipe  <robertl@dgii.com>
 
        * Makefile.in (dwarfout.o) Add toplev.h dependency.
index b1501dec2ec1edfd4b32b2bfe6a71f76672b3fd0..cb31fa5f09290e6556f150368cf0dd4f03f9987a 100644 (file)
          else
            operands[1] = adj_offsettable_operand (operands[2], 4);
          xoperands[0] = operands[3];
-         xoperands[1] = operands[2];
+         if (GET_CODE (operands[1]) == CONST_INT
+             && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
+           xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1);
+         else
+           xoperands[1] = operands[2];
          output_asm_insn (output_move_simode (xoperands), xoperands);
          if (GET_CODE (operands[1]) == CONST_INT)
            {
                {
                  operands[1] = GEN_INT (-INTVAL (operands[1]));
 #ifdef NO_ADDSUB_Q
-                 return \"sub%.l %1,%R0\;addx%.l %3,%0\";
+                 return \"sub%.l %1,%R0\;subx%.l %3,%0\";
 #else
-                 return \"subq%.l %1,%R0\;addx%.l %3,%0\";
+                 return \"subq%.l %1,%R0\;subx%.l %3,%0\";
 #endif
                }
            }
          else
            operands[1] = adj_offsettable_operand (operands[2], 4);
          xoperands[0] = operands[3];
-         xoperands[1] = operands[2];
+         if (GET_CODE (operands[1]) == CONST_INT
+             && INTVAL (operands[1]) >= -8 && INTVAL (operands[1]) < 0)
+           xoperands[1] = GEN_INT (-INTVAL (operands[2]) - 1);
+         else
+           xoperands[1] = operands[2];
          output_asm_insn (output_move_simode (xoperands), xoperands);
          if (GET_CODE (operands[1]) == CONST_INT)
            {
                {
                  operands[1] = GEN_INT (-INTVAL (operands[1]));
 #ifdef NO_ADDSUB_Q
-                 return \"add%.l %1,%R0\;subx%.l %3,%0\";
+                 return \"add%.l %1,%R0\;addx%.l %3,%0\";
 #else
-                 return \"addq%.l %1,%R0\;subx%.l %3,%0\";
+                 return \"addq%.l %1,%R0\;addx%.l %3,%0\";
 #endif
                }
            }