Do not use separate 386 patterns for SF/DF/XF/DI pushes; allow SF/DF/XF/DI pushes...
authorMichael Meissner <meissner@gcc.gnu.org>
Thu, 15 Sep 1994 19:33:07 +0000 (19:33 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Thu, 15 Sep 1994 19:33:07 +0000 (19:33 +0000)
From-SVN: r8088

gcc/config/i386/i386.md

index 998027e2372c08533e98cb763aedb57c0b20667e..330002be909afd05acd3358b4dc4febe6a6d96c9 100644 (file)
       && GET_CODE (operands[0]) == MEM
       && (GET_CODE (operands[1]) == MEM || push_operand (operands[0], SFmode)))
     {
-      rtx (*genfunc) PROTO((rtx, rtx));
-      if (push_operand (operands[0], SFmode))
-       genfunc = (TARGET_386) ? gen_movsf_push386 : gen_movsf_push486;
-      else
-       genfunc = gen_movsf_mem;
+      rtx (*genfunc) PROTO((rtx, rtx)) = (push_operand (operands[0], SFmode))
+                                               ? gen_movsf_push
+                                               : gen_movsf_mem;
 
       emit_insn ((*genfunc) (operands[0], operands[1]));
       DONE;
 (define_insn "movsf_push386"
   [(set (match_operand:SF 0 "push_operand" "=<,<")
        (match_operand:SF 1 "general_operand" "gF,f"))]
-  "TARGET_386 || !TARGET_MOVE"
+  "!TARGET_MOVE"
   "*
 {
   if (STACK_REG_P (operands[1]))
   return AS1 (push%L1,%1);
 }")
 
-(define_insn "movsf_push486"
+(define_insn "movsf_push"
   [(set (match_operand:SF 0 "push_operand" "=<,<,<")
        (match_operand:SF 1 "general_operand" "rF,f,m"))
    (clobber (match_scratch:SI 2 "=X,X,r"))]
-  "!TARGET_386"
+  ""
   "*
 {
   if (STACK_REG_P (operands[1]))
       && GET_CODE (operands[0]) == MEM
       && (GET_CODE (operands[1]) == MEM || push_operand (operands[0], DFmode)))
     {
-      rtx (*genfunc) PROTO((rtx, rtx));
-      if (push_operand (operands[0], DFmode))
-       genfunc = (TARGET_386) ? gen_movdf_push386 : gen_movdf_push486;
-      else
-       genfunc = gen_movdf_mem;
+      rtx (*genfunc) PROTO((rtx, rtx)) = (push_operand (operands[0], DFmode))
+                                               ? gen_movdf_push
+                                               : gen_movdf_mem;
 
       emit_insn ((*genfunc) (operands[0], operands[1]));
       DONE;
     }
 }")
 
-(define_insn "movdf_push386"
+(define_insn "movdf_push_nomove"
   [(set (match_operand:DF 0 "push_operand" "=<,<")
        (match_operand:DF 1 "general_operand" "gF,f"))]
-  "TARGET_386 || !TARGET_MOVE"
+  "!TARGET_MOVE"
   "*
 {
   if (STACK_REG_P (operands[1]))
     return output_move_double (operands);
 }")
 
-(define_insn "movdf_push486"
-  [(set (match_operand:DF 0 "push_operand" "=<,<,<,<")
-       (match_operand:DF 1 "general_operand" "rF,f,o,o"))
-   (clobber (match_scratch:SI 2 "=X,X,&r,&r"))
-   (clobber (match_scratch:SI 3 "=X,X,&r,X"))]
-  "!TARGET_386"
+(define_insn "movdf_push"
+  [(set (match_operand:DF 0 "push_operand" "=<,<,<,<,<")
+       (match_operand:DF 1 "general_operand" "rF,f,o,o,o"))
+   (clobber (match_scratch:SI 2 "=X,X,&r,&r,X"))
+   (clobber (match_scratch:SI 3 "=X,X,&r,X,X"))]
+  ""
   "*
 {
   if (STACK_REG_P (operands[1]))
       RET;
     }
 
-  else if (GET_CODE (operands[1]) != MEM)
+  else if (GET_CODE (operands[1]) != MEM
+          || GET_CODE (operands[2]) != REG)
     return output_move_double (operands);
 
   else
       && GET_CODE (operands[0]) == MEM
       && (GET_CODE (operands[1]) == MEM || push_operand (operands[0], XFmode)))
     {
-      rtx (*genfunc) PROTO((rtx, rtx));
-      if (push_operand (operands[0], XFmode))
-       genfunc = (TARGET_386) ? gen_movxf_push386 : gen_movxf_push486;
-      else
-       genfunc = gen_movxf_mem;
+      rtx (*genfunc) PROTO((rtx, rtx)) = (push_operand (operands[0], XFmode))
+                                               ? gen_movxf_push
+                                               : gen_movxf_mem;
 
       emit_insn ((*genfunc) (operands[0], operands[1]));
       DONE;
     }
 }")
 
-(define_insn "movxf_push386"
+
+(define_insn "movxf_push_nomove"
   [(set (match_operand:XF 0 "push_operand" "=<,<")
        (match_operand:XF 1 "general_operand" "gF,f"))]
-  "TARGET_386 || !TARGET_MOVE"
+  "!TARGET_MOVE"
   "*
 {
   if (STACK_REG_P (operands[1]))
     return output_move_double (operands);
  }")
 
-(define_insn "movxf_push486"
-  [(set (match_operand:XF 0 "push_operand" "=<,<,<,<")
-       (match_operand:XF 1 "general_operand" "rF,f,o,o"))
-   (clobber (match_scratch:SI 2 "=X,X,&r,&r"))
-   (clobber (match_scratch:SI 3 "=X,X,&r,X"))]
-  "!TARGET_386"
+(define_insn "movxf_push"
+  [(set (match_operand:XF 0 "push_operand" "=<,<,<,<,<")
+       (match_operand:XF 1 "general_operand" "rF,f,o,o,o"))
+   (clobber (match_scratch:SI 2 "=X,X,&r,&r,X"))
+   (clobber (match_scratch:SI 3 "=X,X,&r,X,X"))]
+  ""
   "*
 {
   if (STACK_REG_P (operands[1]))
       RET;
     }
 
-  else if (GET_CODE (operands[1]) != MEM)
+  else if (GET_CODE (operands[1]) != MEM
+          || GET_CODE (operands[2]) != REG)
     return output_move_double (operands);
 
   else
        (match_operand:XF 1 "memory_operand" "o,o"))
    (clobber (match_scratch:SI 2 "=&r,&r"))
    (clobber (match_scratch:SI 3 "=&r,X"))]
-  "!TARGET_386"
+  ""
   "*
 {
   rtx xop[8];
       && GET_CODE (operands[0]) == MEM
       && (GET_CODE (operands[1]) == MEM || push_operand (operands[0], DImode)))
     {
-      rtx (*genfunc) PROTO((rtx, rtx));
-      if (push_operand (operands[0], DImode))
-       genfunc = (TARGET_386) ? gen_movdi_push386 : gen_movdi_push486;
-      else
-       genfunc = gen_movdi_mem;
+      rtx (*genfunc) PROTO((rtx, rtx)) = (push_operand (operands[0], DImode))
+                                               ? gen_movdi_push
+                                               : gen_movdi_mem;
 
       emit_insn ((*genfunc) (operands[0], operands[1]));
       DONE;
     }
 }")
 
-(define_insn "movdi_push386"
+(define_insn "movdi_push_nomove"
   [(set (match_operand:DI 0 "push_operand" "=<")
        (match_operand:DI 1 "general_operand" "roiF"))]
-  "TARGET_386 || !TARGET_MOVE"
+  "!TARGET_MOVE"
   "* return output_move_double (operands);")
 
-(define_insn "movdi_push486"
-  [(set (match_operand:DI 0 "push_operand" "=<,<,<")
-       (match_operand:DI 1 "general_operand" "riF,o,o"))
-   (clobber (match_scratch:SI 2 "=X,&r,=&r"))
-   (clobber (match_scratch:SI 3 "=X,&r,X"))]
-  "!TARGET_386"
+(define_insn "movdi_push"
+  [(set (match_operand:DI 0 "push_operand" "=<,<,<,<")
+       (match_operand:DI 1 "general_operand" "riF,o,o,o"))
+   (clobber (match_scratch:SI 2 "=X,&r,&r,X"))
+   (clobber (match_scratch:SI 3 "=X,&r,X,X"))]
+  ""
   "*
 {
-  if (GET_CODE (operands[1]) != MEM)
+  if (GET_CODE (operands[1]) != MEM
+      || GET_CODE (operands[2]) != REG)
     return output_move_double (operands);
 
   else
   ""
   "*
 {
-  if ((TARGET_486 || REGNO (operands[0]) == 0)
+  if ((!TARGET_386 || REGNO (operands[0]) == 0)
       && REG_P (operands[1]) && REGNO (operands[0]) == REGNO (operands[1]))
     {
       rtx xops[2];
   ""
   "*
 {
-  if ((TARGET_486 || REGNO (operands[0]) == 0)
+  if ((!TARGET_386 || REGNO (operands[0]) == 0)
       && REG_P (operands[1]) && REGNO (operands[0]) == REGNO (operands[1]))
     {
       rtx xops[2];
   ""
   "*
 {
-  if ((TARGET_486 || REGNO (operands[0]) == 0)
+  if ((!TARGET_386 || REGNO (operands[0]) == 0)
       && REG_P (operands[1]) && REGNO (operands[0]) == REGNO (operands[1]))
     {
       rtx xops[2];
       if (REG_P (operands[2]) && REGNO (operands[0]) == REGNO (operands[2]))
        return AS2 (add%L0,%1,%0);
 
-      if (! TARGET_486 || ! REG_P (operands[2]))
-        {
-         CC_STATUS_INIT;
+      if (operands[2] == stack_pointer_rtx)
+       {
+         rtx temp;
 
-         if (operands[2] == stack_pointer_rtx)
-           {
-             rtx temp;
+         temp = operands[1];
+         operands[1] = operands[2];
+         operands[2] = 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);
-           }
+      if (operands[2] != stack_pointer_rtx)
+       {
+         CC_STATUS_INIT;
+         operands[1] = SET_SRC (PATTERN (insn));
+         return AS2 (lea%L0,%a1,%0);
        }
 
       output_asm_insn (AS2 (mov%L0,%1,%0), operands);
       if (INTVAL (operands[2]) == 0xffff && REG_P (operands[0])
          && (! REG_P (operands[1])
              || REGNO (operands[0]) != 0 || REGNO (operands[1]) != 0)
-         && (! TARGET_486 || ! rtx_equal_p (operands[0], operands[1])))
+         && (TARGET_386 || ! rtx_equal_p (operands[0], operands[1])))
        {
          /* ??? tege: Should forget CC_STATUS only if we clobber a
             remembered operand.  Fix that later.  */
          && !(REG_P (operands[1]) && NON_QI_REG_P (operands[1]))
          && (! REG_P (operands[1])
              || REGNO (operands[0]) != 0 || REGNO (operands[1]) != 0)
-         && (! TARGET_486 || ! rtx_equal_p (operands[0], operands[1])))
+         && (TARGET_386 || ! rtx_equal_p (operands[0], operands[1])))
        {
          /* ??? tege: Should forget CC_STATUS only if we clobber a
             remembered operand.  Fix that later.  */
 {
   if (REG_P (operands[0]) && REGNO (operands[0]) != REGNO (operands[1]))
     {
-      if (TARGET_486 && INTVAL (operands[2]) == 1)
+      if (!TARGET_386 && INTVAL (operands[2]) == 1)
        {
          output_asm_insn (AS2 (mov%L0,%1,%0), operands);
          return AS2 (add%L0,%1,%0);
                         (const_int 1)
                         (match_operand:SI 2 "general_operand" "r"))
        (match_operand:SI 3 "const_int_operand" "n"))]
-  "! TARGET_486 && GET_CODE (operands[2]) != CONST_INT"
+  "TARGET_386 && GET_CODE (operands[2]) != CONST_INT"
   "*
 {
   CC_STATUS_INIT;
        (xor:SI (ashift:SI (const_int 1)
                           (match_operand:SI 1 "general_operand" "r"))
                (match_operand:SI 2 "general_operand" "0")))]
-  "! TARGET_486 && GET_CODE (operands[1]) != CONST_INT"
+  "TARGET_386 && GET_CODE (operands[1]) != CONST_INT"
   "*
 {
   CC_STATUS_INIT;
        (xor:SI (match_operand:SI 1 "general_operand" "0")
                (ashift:SI (const_int 1)
                           (match_operand:SI 2 "general_operand" "r"))))]
-  "! TARGET_486 && GET_CODE (operands[2]) != CONST_INT"
+  "TARGET_386 && GET_CODE (operands[2]) != CONST_INT"
   "*
 {
   CC_STATUS_INIT;