OSDN Git Service

* config/m68k/m68k.md (adddi3, subdi3): Properly negate the DImode
authorschwab <schwab@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 May 1998 01:59:07 +0000 (01:59 +0000)
committerschwab <schwab@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 7 May 1998 01:59:07 +0000 (01:59 +0000)
constant.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19607 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 9bbb77e..d49b70e 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 b1501de..cb31fa5 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
                }
            }