(addsidi3_2): Handle non-MEM overlap case.
authorRichard Kenner <kenner@gcc.gnu.org>
Tue, 16 Apr 1996 21:43:09 +0000 (17:43 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 16 Apr 1996 21:43:09 +0000 (17:43 -0400)
From-SVN: r11829

gcc/config/i386/i386.md

index 7f6cd8057b412fc0b304921ba1cd21fc6a64a3b1..f307767df3a6110c63a08a1b7ee44371963f09ee 100644 (file)
 
       if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
        {
+         if (rtx_equal_p (low[0], operands[2]))
+           {
+             output_asm_insn (AS2 (mov%L0,%2,%0), high);
+             output_asm_insn (AS2 (add%L0,%1,%0), low);
+             output_asm_insn (AS2 (adc%L0,%1,%0), high);
+             RET;
+           }
+         if (rtx_equal_p (high[0], operands[2]))
+           {
+             if (GET_CODE (operands[0]) != MEM)
+               {
+                 output_asm_insn (AS2 (mov%L0,%2,%0), low);
+                 output_asm_insn (AS2 (mov%L0,%2,%0), high);
+                 output_asm_insn (AS2 (add%L0,%1,%0), low);
+                 output_asm_insn (AS2 (adc%L0,%1,%0), high);
+               }
+             else
+               {
+                 /* It's too late to ask for a scratch now - but this
+                    will probably not happen too often.  */
+                 output_asm_insn (AS2 (add%L1,%2,%1), low);
+                 output_asm_insn (AS2 (mov%L0,%1,%0), low);
+                 output_asm_insn (AS2 (mov%L1,%2,%1), low);
+                 output_asm_insn (AS2 (mov%L0,%2,%0), high);
+                 output_asm_insn (AS2 (adc%L0,%1,%0), high);
+                 output_asm_insn (AS2 (sub%L1,%0,%1), low);
+                 output_asm_insn (AS1 (neg%L1,%1), low);
+               }
+             RET;
+           }
          output_asm_insn (AS2 (mov%L1,%3,%1), xops);
          output_asm_insn (AS2 (mov%L0,%2,%0), xops);
        }