From: Andreas Schwab Date: Thu, 7 May 1998 01:59:07 +0000 (+0000) Subject: m68k.md (adddi3, subdi3): Properly negate the DImode constant. X-Git-Tag: prereleases/egcs-1.1-prerelease~1408 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=436bf9fb5bd9b2b5fb53ff94dc657f6e586efb54;p=thirdparty%2Fgcc.git m68k.md (adddi3, subdi3): Properly negate the DImode constant. * config/m68k/m68k.md (adddi3, subdi3): Properly negate the DImode constant. From-SVN: r19607 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9bbb77ea4ce1..d49b70ed32a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Thu May 7 10:55:59 1998 Andreas Schwab + + * config/m68k/m68k.md (adddi3, subdi3): Properly negate the DImode + constant. + Wed May 6 22:32:37 CDT 1998 Robert Lipe * Makefile.in (dwarfout.o) Add toplev.h dependency. diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index b1501dec2ec1..cb31fa5f0929 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -2166,7 +2166,11 @@ 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) { @@ -2182,9 +2186,9 @@ { 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 } } @@ -2719,7 +2723,11 @@ 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) { @@ -2735,9 +2743,9 @@ { 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 } }