(addsi3,ashlsi3): Handle the case where the stack pointer appears as an
authorJames Van Artsdalen <jrv@gnu.org>
Thu, 17 Sep 1992 05:20:26 +0000 (05:20 +0000)
committerJames Van Artsdalen <jrv@gnu.org>
Thu, 17 Sep 1992 05:20:26 +0000 (05:20 +0000)
index reg.

From-SVN: r2140

gcc/config/i386/i386.md

index 6ba86cd262933bf157d19c4495fc85c4e4114dde..2d2f28eb57959257d2cccb74a41bae72686a7e8c 100644 (file)
       if (! TARGET_486 || ! REG_P (operands[2]))
         {
          CC_STATUS_INIT;
-         operands[1] = SET_SRC (PATTERN (insn));
-         return AS2 (lea%L0,%a1,%0);
+
+         if (operands[2] == stack_pointer_rtx)
+           {
+             rtx temp;
+
+             temp = operands[1];
+             operands[1] = operands[2];
+             operands[2] = temp;
+           }
+         if (operands[2] != stack_pointer_rtx)
+           {
+             operands[1] = SET_SRC (PATTERN (insn));
+             return AS2 (lea%L0,%a1,%0);
+           }
        }
 
       output_asm_insn (AS2 (mov%L0,%1,%0), operands);
       else
         {
           CC_STATUS_INIT;
+
+         if (operands[1] == stack_pointer_rtx)
+           {
+             output_asm_insn (AS2 (mov%L0,%1,%0), operands);
+             operands[1] = operands[0];
+           }
           operands[1] = gen_rtx (MULT, SImode, operands[1],
                                 GEN_INT (1 << INTVAL (operands[2])));
          return AS2 (lea%L0,%a1,%0);