OSDN Git Service

2011-05-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / i386.md
index b1fc573..2e7633d 100644 (file)
@@ -53,6 +53,7 @@
 ;; d -- print duplicated register operand for AVX instruction.
 ;; D -- print condition for SSE cmp instruction.
 ;; P -- if PIC, print an @PLT suffix.
+;; p -- print raw symbol name.
 ;; X -- don't print any sort of PIC '@' suffix for a symbol.
 ;; & -- print some in-use local-dynamic symbol name.
 ;; H -- print a memory address offset by 8; used for sse high-parts
   UNSPEC_TRUNC_NOOP
   UNSPEC_DIV_ALREADY_SPLIT
   UNSPEC_CALL_NEEDS_VZEROUPPER
+  UNSPEC_PAUSE
 
   ;; For SSE/MMX support:
   UNSPEC_FIX_NOTRUNC
           (const_int 0)
         (eq_attr "type" "alu,alu1,negnot,imovx,ishift,rotate,ishift1,rotate1,
                          imul,icmp,push,pop")
-          (symbol_ref "ix86_attr_length_immediate_default(insn,1)")
+          (symbol_ref "ix86_attr_length_immediate_default (insn, true)")
         (eq_attr "type" "imov,test")
-          (symbol_ref "ix86_attr_length_immediate_default(insn,0)")
+          (symbol_ref "ix86_attr_length_immediate_default (insn, false)")
         (eq_attr "type" "call")
           (if_then_else (match_operand 0 "constant_call_address_operand" "")
             (const_int 4)
   (if_then_else (and (eq_attr "prefix_0f" "1")
                     (eq_attr "prefix_extra" "0"))
     (if_then_else (eq_attr "prefix_vex_w" "1")
-      (symbol_ref "ix86_attr_length_vex_default (insn, 1, 1)")
-      (symbol_ref "ix86_attr_length_vex_default (insn, 1, 0)"))
+      (symbol_ref "ix86_attr_length_vex_default (insn, true, true)")
+      (symbol_ref "ix86_attr_length_vex_default (insn, true, false)"))
     (if_then_else (eq_attr "prefix_vex_w" "1")
-      (symbol_ref "ix86_attr_length_vex_default (insn, 0, 1)")
-      (symbol_ref "ix86_attr_length_vex_default (insn, 0, 0)"))))
+      (symbol_ref "ix86_attr_length_vex_default (insn, false, true)")
+      (symbol_ref "ix86_attr_length_vex_default (insn, false, false)"))))
 
 ;; Set when modrm byte is used.
 (define_attr "modrm" ""
        UNSPEC_FNSTSW))]
   "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && GET_MODE (operands[1]) == GET_MODE (operands[2])"
-  "* return output_fp_compare (insn, operands, 0, 0);"
+  "* return output_fp_compare (insn, operands, false, false);"
   [(set_attr "type" "multi")
    (set_attr "unit" "i387")
    (set (attr "mode")
             (match_operand:XF 2 "register_operand" "f"))]
          UNSPEC_FNSTSW))]
   "TARGET_80387"
-  "* return output_fp_compare (insn, operands, 0, 0);"
+  "* return output_fp_compare (insn, operands, false, false);"
   [(set_attr "type" "multi")
    (set_attr "unit" "i387")
    (set_attr "mode" "XF")])
             (match_operand:MODEF 2 "nonimmediate_operand" "fm"))]
          UNSPEC_FNSTSW))]
   "TARGET_80387"
-  "* return output_fp_compare (insn, operands, 0, 0);"
+  "* return output_fp_compare (insn, operands, false, false);"
   [(set_attr "type" "multi")
    (set_attr "unit" "i387")
    (set_attr "mode" "<MODE>")])
          UNSPEC_FNSTSW))]
   "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && GET_MODE (operands[1]) == GET_MODE (operands[2])"
-  "* return output_fp_compare (insn, operands, 0, 1);"
+  "* return output_fp_compare (insn, operands, false, true);"
   [(set_attr "type" "multi")
    (set_attr "unit" "i387")
    (set (attr "mode")
   "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && (TARGET_USE_<MODE>MODE_FIOP || optimize_function_for_size_p (cfun))
    && (GET_MODE (operands [3]) == GET_MODE (operands[1]))"
-  "* return output_fp_compare (insn, operands, 0, 0);"
+  "* return output_fp_compare (insn, operands, false, false);"
   [(set_attr "type" "multi")
    (set_attr "unit" "i387")
    (set_attr "fp_int_src" "true")
   "TARGET_MIX_SSE_I387
    && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
-  "* return output_fp_compare (insn, operands, 1, 0);"
+  "* return output_fp_compare (insn, operands, true, false);"
   [(set_attr "type" "fcmp,ssecomi")
    (set_attr "prefix" "orig,maybe_vex")
    (set (attr "mode")
   "TARGET_SSE_MATH
    && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
-  "* return output_fp_compare (insn, operands, 1, 0);"
+  "* return output_fp_compare (insn, operands, true, false);"
   [(set_attr "type" "ssecomi")
    (set_attr "prefix" "maybe_vex")
    (set (attr "mode")
    && TARGET_CMOVE
    && !(SSE_FLOAT_MODE_P (GET_MODE (operands[0])) && TARGET_SSE_MATH)
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
-  "* return output_fp_compare (insn, operands, 1, 0);"
+  "* return output_fp_compare (insn, operands, true, false);"
   [(set_attr "type" "fcmp")
    (set (attr "mode")
      (cond [(match_operand:SF 1 "" "")
   "TARGET_MIX_SSE_I387
    && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
-  "* return output_fp_compare (insn, operands, 1, 1);"
+  "* return output_fp_compare (insn, operands, true, true);"
   [(set_attr "type" "fcmp,ssecomi")
    (set_attr "prefix" "orig,maybe_vex")
    (set (attr "mode")
   "TARGET_SSE_MATH
    && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
-  "* return output_fp_compare (insn, operands, 1, 1);"
+  "* return output_fp_compare (insn, operands, true, true);"
   [(set_attr "type" "ssecomi")
    (set_attr "prefix" "maybe_vex")
    (set (attr "mode")
    && TARGET_CMOVE
    && !(SSE_FLOAT_MODE_P (GET_MODE (operands[0])) && TARGET_SSE_MATH)
    && GET_MODE (operands[0]) == GET_MODE (operands[1])"
-  "* return output_fp_compare (insn, operands, 1, 1);"
+  "* return output_fp_compare (insn, operands, true, true);"
   [(set_attr "type" "fcmp")
    (set (attr "mode")
      (cond [(match_operand:SF 1 "" "")
     }
 }
   [(set (attr "type")
-     (if_then_else (and (match_operand:QI 0 "register_operand" "")
-                       (ior (not (match_operand:QI 0 "q_regs_operand" ""))
-                            (ne (symbol_ref "TARGET_MOVX")
-                                (const_int 0))))
+     (if_then_else (ior (not (match_operand:QI 0 "QIreg_operand" ""))
+                       (ne (symbol_ref "TARGET_MOVX")
+                           (const_int 0)))
        (const_string "imovx")
        (const_string "imov")))
    (set (attr "mode")
 }
   [(set (attr "type")
      (if_then_else (and (match_operand:QI 0 "register_operand" "")
-                       (ior (not (match_operand:QI 0 "q_regs_operand" ""))
+                       (ior (not (match_operand:QI 0 "QIreg_operand" ""))
                             (ne (symbol_ref "TARGET_MOVX")
                                 (const_int 0))))
        (const_string "imovx")
     }
 }
   [(set (attr "type")
-     (if_then_else (ior (not (match_operand:QI 0 "q_regs_operand" ""))
+     (if_then_else (ior (not (match_operand:QI 0 "QIreg_operand" ""))
                        (ne (symbol_ref "TARGET_MOVX")
                            (const_int 0)))
        (const_string "imovx")
 }
   [(set (attr "type")
      (if_then_else (and (match_operand:QI 0 "register_operand" "")
-                       (ior (not (match_operand:QI 0 "q_regs_operand" ""))
+                       (ior (not (match_operand:QI 0 "QIreg_operand" ""))
                             (ne (symbol_ref "TARGET_MOVX")
                                 (const_int 0))))
        (const_string "imovx")
   [(const_int 0)]
   "ix86_split_long_move (operands); DONE;")
 
+;; Size of pushdf is 3 (for sub) + 2 (for fstp) + memory operand size.
+;; Size of pushdf using integer instructions is 2+2*memory operand size
+;; On the average, pushdf using integers can be still shorter.
+
 (define_insn "*pushdf"
   [(set (match_operand:DF 0 "push_operand" "=<,<,<")
-       (match_operand:DF 1 "general_no_elim_operand" "f,rFo,Y2"))]
-  "TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES"
+       (match_operand:DF 1 "general_no_elim_operand" "f,Yd*rFo,Y2"))]
+  ""
 {
   /* This insn should be already split before reg-stack.  */
   gcc_unreachable ();
    (set_attr "unit" "i387,*,*")
    (set_attr "mode" "DF,SI,DF")])
 
-;; Size of pushdf is 3 (for sub) + 2 (for fstp) + memory operand size.
-;; Size of pushdf using integer instructions is 2+2*memory operand size
-;; On the average, pushdf using integers can be still shorter.  Allow this
-;; pattern for optimize_size too.
-
-(define_insn "*pushdf_nointeger"
-  [(set (match_operand:DF 0 "push_operand" "=<,<,<,<")
-       (match_operand:DF 1 "general_no_elim_operand" "f,Fo,*r,Y2"))]
-  "!(TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES)"
-{
-  /* This insn should be already split before reg-stack.  */
-  gcc_unreachable ();
-}
-  [(set_attr "type" "multi")
-   (set_attr "unit" "i387,*,*,*")
-   (set_attr "mode" "DF,SI,SI,DF")])
-
 ;; %%% Kill this when call knows how to work this out.
 (define_split
   [(set (match_operand:DF 0 "push_operand" "")
        return "%vmovaps\t{%1, %0|%0, %1}";
       else
        return "%vmovdqa\t{%1, %0|%0, %1}";
+
     case 2:
-      if (get_attr_mode (insn) == MODE_V4SF)
-       return "%vxorps\t%0, %d0";
-      else
-       return "%vpxor\t%0, %d0";
+      return standard_sse_constant_opcode (insn, operands[1]);
+
     case 3:
     case 4:
        return "#";
+
     default:
       gcc_unreachable ();
     }
   "ix86_split_long_move (operands); DONE;")
 
 (define_insn "*movxf_internal"
-  [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,r,o")
-       (match_operand:XF 1 "general_operand" "fm,f,G,roF,Fr"))]
-  "optimize_function_for_speed_p (cfun)
-   && !(MEM_P (operands[0]) && MEM_P (operands[1]))
-   && (reload_in_progress || reload_completed
-       || GET_CODE (operands[1]) != CONST_DOUBLE
-       || memory_operand (operands[0], XFmode))"
-{
-  switch (which_alternative)
-    {
-    case 0:
-    case 1:
-      return output_387_reg_move (insn, operands);
-
-    case 2:
-      return standard_80387_constant_opcode (operands[1]);
-
-    case 3: case 4:
-      return "#";
-
-    default:
-      gcc_unreachable ();
-    }
-}
-  [(set_attr "type" "fmov,fmov,fmov,multi,multi")
-   (set_attr "mode" "XF,XF,XF,SI,SI")])
-
-;; Do not use integer registers when optimizing for size
-(define_insn "*movxf_internal_nointeger"
-  [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,*r,o")
-       (match_operand:XF 1 "general_operand" "fm,f,G,*roF,F*r"))]
-  "optimize_function_for_size_p (cfun)
-   && !(MEM_P (operands[0]) && MEM_P (operands[1]))
-   && (reload_in_progress || reload_completed
-       || standard_80387_constant_p (operands[1])
+  [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,Yx*r  ,o")
+       (match_operand:XF 1 "general_operand"      "fm,f,G,Yx*roF,FYx*r"))]
+  "!(MEM_P (operands[0]) && MEM_P (operands[1]))
+   && (!can_create_pseudo_p ()
+       || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
        || GET_CODE (operands[1]) != CONST_DOUBLE
+       || (optimize_function_for_size_p (cfun)
+          && standard_80387_constant_p (operands[1]) > 0)
        || memory_operand (operands[0], XFmode))"
 {
   switch (which_alternative)
        (match_operand:DF 1 "general_operand"
                "fm,f,G,rm,r,F ,F ,C   ,Y2*x,m   ,Y2*x,r ,Yi"))]
   "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
-   && (reload_in_progress || reload_completed
+   && (!can_create_pseudo_p ()
        || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
-       || (!(TARGET_SSE2 && TARGET_SSE_MATH)
-           && optimize_function_for_size_p (cfun)
-          && standard_80387_constant_p (operands[1]))
        || GET_CODE (operands[1]) != CONST_DOUBLE
+       || (optimize_function_for_size_p (cfun)
+          && ((!(TARGET_SSE2 && TARGET_SSE_MATH)
+               && standard_80387_constant_p (operands[1]) > 0)
+              || (TARGET_SSE2 && TARGET_SSE_MATH
+                  && standard_sse_constant_p (operands[1]))))
        || memory_operand (operands[0], DFmode))"
 {
   switch (which_alternative)
       return "#";
 
     case 7:
-      switch (get_attr_mode (insn))
-       {
-       case MODE_V4SF:
-         return "%vxorps\t%0, %d0";
-       case MODE_V2DF:
-         if (TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL)
-           return "%vxorps\t%0, %d0";
-         else
-           return "%vxorpd\t%0, %d0";
-       case MODE_TI:
-         if (TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL)
-           return "%vxorps\t%0, %d0";
-         else
-           return "%vpxor\t%0, %d0";
-       default:
-         gcc_unreachable ();
-       }
+      return standard_sse_constant_opcode (insn, operands[1]);
+
     case 8:
     case 9:
     case 10:
              ]
              (const_string "DF")))])
 
+;; Possible store forwarding (partial memory) stall in alternative 4.
 (define_insn "*movdf_internal"
   [(set (match_operand:DF 0 "nonimmediate_operand"
-               "=f,m,f,r  ,o ,Y2*x,Y2*x,Y2*x,m   ")
+               "=f,m,f,Yd*r  ,o    ,Y2*x,Y2*x,Y2*x,m  ")
        (match_operand:DF 1 "general_operand"
-               "fm,f,G,roF,Fr,C   ,Y2*x,m   ,Y2*x"))]
+               "fm,f,G,Yd*roF,FYd*r,C   ,Y2*x,m   ,Y2*x"))]
   "!TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
-   && optimize_function_for_speed_p (cfun)
-   && TARGET_INTEGER_DFMODE_MOVES
-   && (reload_in_progress || reload_completed
+   && (!can_create_pseudo_p ()
        || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
-       || (!(TARGET_SSE2 && TARGET_SSE_MATH)
-           && optimize_function_for_size_p (cfun)
-          && standard_80387_constant_p (operands[1]))
        || GET_CODE (operands[1]) != CONST_DOUBLE
-       || memory_operand (operands[0], DFmode))"
+       || (!TARGET_INTEGER_DFMODE_MOVES
+          && ((!(TARGET_SSE2 && TARGET_SSE_MATH)
+               && standard_80387_constant_p (operands[1]) > 0)
+              || (TARGET_SSE2 && TARGET_SSE_MATH
+                  && standard_sse_constant_p (operands[1])))
+          && !memory_operand (operands[0], DFmode))
+       || ((TARGET_INTEGER_DFMODE_MOVES
+           || !TARGET_MEMORY_MISMATCH_STALL)
+          && memory_operand (operands[0], DFmode)))"
 {
   switch (which_alternative)
     {
       return "#";
 
     case 5:
-      switch (get_attr_mode (insn))
-       {
-       case MODE_V4SF:
-         return "%vxorps\t%0, %d0";
-       case MODE_V2DF:
-         if (TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL)
-           return "%vxorps\t%0, %d0";
-         else
-           return "%vxorpd\t%0, %d0";
-       case MODE_TI:
-         if (TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL)
-           return "%vxorps\t%0, %d0";
-         else
-           return "%vpxor\t%0, %d0";
-       default:
-         gcc_unreachable ();
-       }
-    case 6:
-    case 7:
-    case 8:
-      switch (get_attr_mode (insn))
-       {
-       case MODE_V4SF:
-         return "%vmovaps\t{%1, %0|%0, %1}";
-       case MODE_V2DF:
-         if (TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL)
-           return "%vmovaps\t{%1, %0|%0, %1}";
-         else
-           return "%vmovapd\t{%1, %0|%0, %1}";
-       case MODE_TI:
-         if (TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL)
-           return "%vmovaps\t{%1, %0|%0, %1}";
-         else
-           return "%vmovdqa\t{%1, %0|%0, %1}";
-       case MODE_DI:
-         return "%vmovq\t{%1, %0|%0, %1}";
-       case MODE_DF:
-         if (TARGET_AVX && REG_P (operands[0]) && REG_P (operands[1]))
-           return "vmovsd\t{%1, %0, %0|%0, %0, %1}";
-         else
-           return "%vmovsd\t{%1, %0|%0, %1}";
-       case MODE_V1DF:
-         if (TARGET_AVX && REG_P (operands[0]))
-           return "vmovlpd\t{%1, %0, %0|%0, %0, %1}";
-         else
-           return "%vmovlpd\t{%1, %0|%0, %1}";
-       case MODE_V2SF:
-         if (TARGET_AVX && REG_P (operands[0]))
-           return "vmovlps\t{%1, %0, %0|%0, %0, %1}";
-         else
-           return "%vmovlps\t{%1, %0|%0, %1}";
-       default:
-         gcc_unreachable ();
-       }
-
-    default:
-      gcc_unreachable ();
-    }
-}
-  [(set_attr "type" "fmov,fmov,fmov,multi,multi,sselog1,ssemov,ssemov,ssemov")
-   (set (attr "prefix")
-     (if_then_else (eq_attr "alternative" "0,1,2,3,4")
-       (const_string "orig")
-       (const_string "maybe_vex")))
-   (set (attr "prefix_data16")
-     (if_then_else (eq_attr "mode" "V1DF")
-       (const_string "1")
-       (const_string "*")))
-   (set (attr "mode")
-        (cond [(eq_attr "alternative" "0,1,2")
-                (const_string "DF")
-              (eq_attr "alternative" "3,4")
-                (const_string "SI")
-
-              /* For SSE1, we have many fewer alternatives.  */
-              (eq (symbol_ref "TARGET_SSE2") (const_int 0))
-                (cond [(eq_attr "alternative" "5,6")
-                         (const_string "V4SF")
-                      ]
-                  (const_string "V2SF"))
-
-              /* xorps is one byte shorter.  */
-              (eq_attr "alternative" "5")
-                (cond [(ne (symbol_ref "optimize_function_for_size_p (cfun)")
-                           (const_int 0))
-                         (const_string "V4SF")
-                       (ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR")
-                           (const_int 0))
-                         (const_string "TI")
-                      ]
-                      (const_string "V2DF"))
-
-              /* For architectures resolving dependencies on
-                 whole SSE registers use APD move to break dependency
-                 chains, otherwise use short move to avoid extra work.
-
-                 movaps encodes one byte shorter.  */
-              (eq_attr "alternative" "6")
-                (cond
-                  [(ne (symbol_ref "optimize_function_for_size_p (cfun)")
-                       (const_int 0))
-                     (const_string "V4SF")
-                   (ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY")
-                       (const_int 0))
-                     (const_string "V2DF")
-                  ]
-                  (const_string "DF"))
-              /* For architectures resolving dependencies on register
-                 parts we may avoid extra work to zero out upper part
-                 of register.  */
-              (eq_attr "alternative" "7")
-                (if_then_else
-                  (ne (symbol_ref "TARGET_SSE_SPLIT_REGS")
-                      (const_int 0))
-                  (const_string "V1DF")
-                  (const_string "DF"))
-             ]
-             (const_string "DF")))])
-
-;; Moving is usually shorter when only FP registers are used. This separate
-;; movdf pattern avoids the use of integer registers for FP operations
-;; when optimizing for size.
-
-(define_insn "*movdf_internal_nointeger"
-  [(set (match_operand:DF 0 "nonimmediate_operand"
-                       "=f,m,f,*r  ,o  ,Y2*x,Y2*x,Y2*x ,m  ")
-       (match_operand:DF 1 "general_operand"
-                       "fm,f,G,*roF,F*r,C   ,Y2*x,mY2*x,Y2*x"))]
-  "!TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
-   && (optimize_function_for_size_p (cfun)
-       || !TARGET_INTEGER_DFMODE_MOVES)
-   && (reload_in_progress || reload_completed
-       || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
-       || (!(TARGET_SSE2 && TARGET_SSE_MATH)
-           && optimize_function_for_size_p (cfun)
-           && !memory_operand (operands[0], DFmode)
-          && standard_80387_constant_p (operands[1]))
-       || GET_CODE (operands[1]) != CONST_DOUBLE
-       || ((optimize_function_for_size_p (cfun)
-            || !TARGET_MEMORY_MISMATCH_STALL
-           || reload_in_progress || reload_completed)
-          && memory_operand (operands[0], DFmode)))"
-{
-  switch (which_alternative)
-    {
-    case 0:
-    case 1:
-      return output_387_reg_move (insn, operands);
+      return standard_sse_constant_opcode (insn, operands[1]);
 
-    case 2:
-      return standard_80387_constant_opcode (operands[1]);
-
-    case 3:
-    case 4:
-      return "#";
-
-    case 5:
-      switch (get_attr_mode (insn))
-       {
-       case MODE_V4SF:
-         return "%vxorps\t%0, %d0";
-       case MODE_V2DF:
-         if (TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL)
-           return "%vxorps\t%0, %d0";
-         else
-           return "%vxorpd\t%0, %d0";
-       case MODE_TI:
-         if (TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL)
-           return "%vxorps\t%0, %d0";
-         else
-           return "%vpxor\t%0, %d0";
-       default:
-         gcc_unreachable ();
-       }
     case 6:
     case 7:
     case 8:
        (match_operand:SF 1 "general_operand"
          "fm,f,G,rmF,Fr,C,x,xm,x,m  ,*y,*y ,r  ,Yi,r   ,*Ym"))]
   "!(MEM_P (operands[0]) && MEM_P (operands[1]))
-   && (reload_in_progress || reload_completed
+   && (!can_create_pseudo_p ()
        || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
-       || (!TARGET_SSE_MATH && optimize_function_for_size_p (cfun)
-          && standard_80387_constant_p (operands[1]))
        || GET_CODE (operands[1]) != CONST_DOUBLE
+       || (optimize_function_for_size_p (cfun)
+          && ((!TARGET_SSE_MATH
+               && standard_80387_constant_p (operands[1]) > 0)
+              || (TARGET_SSE_MATH
+                  && standard_sse_constant_p (operands[1]))))
        || memory_operand (operands[0], SFmode))"
 {
   switch (which_alternative)
     case 3:
     case 4:
       return "mov{l}\t{%1, %0|%0, %1}";
+
     case 5:
-      if (get_attr_mode (insn) == MODE_TI)
-       return "%vpxor\t%0, %d0";
-      else
-       return "%vxorps\t%0, %d0";
+      return standard_sse_constant_opcode (insn, operands[1]);
+
     case 6:
       if (get_attr_mode (insn) == MODE_V4SF)
        return "%vmovaps\t{%1, %0|%0, %1}";
     }
   else if (FP_REG_P (r))
     {
-      if (!standard_80387_constant_p (c))
+      if (standard_80387_constant_p (c) < 1)
        FAIL;
     }
   else if (MMX_REG_P (r))
     }
   else if (FP_REG_P (r))
     {
-      if (!standard_80387_constant_p (c))
+      if (standard_80387_constant_p (c) < 1)
        FAIL;
     }
   else if (MMX_REG_P (r))
    && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1]))
         && (TARGET_64BIT || <MODE>mode != DImode))
        && TARGET_SSE_MATH)"
-  "* return output_fix_trunc (insn, operands, 1);"
+  "* return output_fix_trunc (insn, operands, true);"
   [(set_attr "type" "fisttp")
    (set_attr "mode" "<MODE>")])
 
   "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && !TARGET_FISTTP
    && !(TARGET_64BIT && SSE_FLOAT_MODE_P (GET_MODE (operands[1])))"
-  "* return output_fix_trunc (insn, operands, 0);"
+  "* return output_fix_trunc (insn, operands, false);"
   [(set_attr "type" "fistp")
    (set_attr "i387_cw" "trunc")
    (set_attr "mode" "DI")])
   "X87_FLOAT_MODE_P (GET_MODE (operands[1]))
    && !TARGET_FISTTP
    && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))"
-  "* return output_fix_trunc (insn, operands, 0);"
+  "* return output_fix_trunc (insn, operands, false);"
   [(set_attr "type" "fistp")
    (set_attr "i387_cw" "trunc")
    (set_attr "mode" "<MODE>")])
 ;; P6 processors will jump to the address after the decrement when %esp
 ;; is used as a call operand, so they will execute return address as a code.
 ;; See Pentium Pro errata 70, Pentium 2 errata A33 and Pentium 3 errata E17.
+
+;; Register constraint for call instruction.
+(define_mode_attr c [(SI "l") (DI "r")])
+
 ;; Call subroutine returning no value.
 
-(define_expand "call_pop"
-  [(parallel [(call (match_operand:QI 0 "" "")
-                   (match_operand:SI 1 "" ""))
-             (set (reg:SI SP_REG)
-                  (plus:SI (reg:SI SP_REG)
-                           (match_operand:SI 3 "" "")))])]
-  "!TARGET_64BIT"
+(define_expand "call"
+  [(call (match_operand:QI 0 "" "")
+        (match_operand 1 "" ""))
+   (use (match_operand 2 "" ""))]
+  ""
 {
   ix86_expand_call (NULL, operands[0], operands[1],
-                   operands[2], operands[3], 0);
+                   operands[2], NULL, false);
   DONE;
 })
 
-(define_insn_and_split "*call_pop_0_vzeroupper"
-  [(parallel
-    [(call (mem:QI (match_operand:SI 0 "constant_call_address_operand" ""))
-          (match_operand:SI 1 "" ""))
-     (set (reg:SI SP_REG)
-         (plus:SI (reg:SI SP_REG)
-                  (match_operand:SI 2 "immediate_operand" "")))])
-   (unspec [(match_operand 3 "const_int_operand" "")]
+(define_expand "sibcall"
+  [(call (match_operand:QI 0 "" "")
+        (match_operand 1 "" ""))
+   (use (match_operand 2 "" ""))]
+  ""
+{
+  ix86_expand_call (NULL, operands[0], operands[1],
+                   operands[2], NULL, true);
+  DONE;
+})
+
+(define_insn_and_split "*call_vzeroupper"
+  [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zm"))
+        (match_operand 1 "" ""))
+   (unspec [(match_operand 2 "const_int_operand" "")]
           UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && !TARGET_64BIT"
+  "TARGET_VZEROUPPER && !SIBLING_CALL_P (insn)"
   "#"
   "&& reload_completed"
   [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
+  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
   [(set_attr "type" "call")])
 
-(define_insn "*call_pop_0"
-  [(call (mem:QI (match_operand:SI 0 "constant_call_address_operand" ""))
-        (match_operand:SI 1 "" ""))
-   (set (reg:SI SP_REG)
-       (plus:SI (reg:SI SP_REG)
-                (match_operand:SI 2 "immediate_operand" "")))]
-  "!TARGET_64BIT"
-{
-  if (SIBLING_CALL_P (insn))
-    return "jmp\t%P0";
-  else
-    return "call\t%P0";
-}
+(define_insn "*call"
+  [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zm"))
+        (match_operand 1 "" ""))]
+  "!SIBLING_CALL_P (insn)"
+  "* return ix86_output_call_insn (insn, operands[0]);"
   [(set_attr "type" "call")])
 
-(define_insn_and_split "*call_pop_1_vzeroupper"
+(define_insn_and_split "*call_rex64_ms_sysv_vzeroupper"
   [(parallel
-    [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lsm"))
+    [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rzm"))
+          (match_operand 1 "" ""))
+     (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
+     (clobber (reg:TI XMM6_REG))
+     (clobber (reg:TI XMM7_REG))
+     (clobber (reg:TI XMM8_REG))
+     (clobber (reg:TI XMM9_REG))
+     (clobber (reg:TI XMM10_REG))
+     (clobber (reg:TI XMM11_REG))
+     (clobber (reg:TI XMM12_REG))
+     (clobber (reg:TI XMM13_REG))
+     (clobber (reg:TI XMM14_REG))
+     (clobber (reg:TI XMM15_REG))
+     (clobber (reg:DI SI_REG))
+     (clobber (reg:DI DI_REG))])
+   (unspec [(match_operand 2 "const_int_operand" "")]
+          UNSPEC_CALL_NEEDS_VZEROUPPER)]
+  "TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)"
+  "#"
+  "&& reload_completed"
+  [(const_int 0)]
+  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
+  [(set_attr "type" "call")])
+
+(define_insn "*call_rex64_ms_sysv"
+  [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rzm"))
+        (match_operand 1 "" ""))
+   (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
+   (clobber (reg:TI XMM6_REG))
+   (clobber (reg:TI XMM7_REG))
+   (clobber (reg:TI XMM8_REG))
+   (clobber (reg:TI XMM9_REG))
+   (clobber (reg:TI XMM10_REG))
+   (clobber (reg:TI XMM11_REG))
+   (clobber (reg:TI XMM12_REG))
+   (clobber (reg:TI XMM13_REG))
+   (clobber (reg:TI XMM14_REG))
+   (clobber (reg:TI XMM15_REG))
+   (clobber (reg:DI SI_REG))
+   (clobber (reg:DI DI_REG))]
+  "TARGET_64BIT && !SIBLING_CALL_P (insn)"
+  "* return ix86_output_call_insn (insn, operands[0]);"
+  [(set_attr "type" "call")])
+
+(define_insn_and_split "*sibcall_vzeroupper"
+  [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz"))
+        (match_operand 1 "" ""))
+   (unspec [(match_operand 2 "const_int_operand" "")]
+          UNSPEC_CALL_NEEDS_VZEROUPPER)]
+  "TARGET_VZEROUPPER && SIBLING_CALL_P (insn)"
+  "#"
+  "&& reload_completed"
+  [(const_int 0)]
+  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
+  [(set_attr "type" "call")])
+
+(define_insn "*sibcall"
+  [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz"))
+        (match_operand 1 "" ""))]
+  "SIBLING_CALL_P (insn)"
+  "* return ix86_output_call_insn (insn, operands[0]);"
+  [(set_attr "type" "call")])
+
+(define_expand "call_pop"
+  [(parallel [(call (match_operand:QI 0 "" "")
+                   (match_operand:SI 1 "" ""))
+             (set (reg:SI SP_REG)
+                  (plus:SI (reg:SI SP_REG)
+                           (match_operand:SI 3 "" "")))])]
+  "!TARGET_64BIT"
+{
+  ix86_expand_call (NULL, operands[0], operands[1],
+                   operands[2], operands[3], false);
+  DONE;
+})
+
+(define_insn_and_split "*call_pop_vzeroupper"
+  [(parallel
+    [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lzm"))
           (match_operand:SI 1 "" ""))
      (set (reg:SI SP_REG)
          (plus:SI (reg:SI SP_REG)
   "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
   [(set_attr "type" "call")])
 
-(define_insn "*call_pop_1"
-  [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lsm"))
-        (match_operand:SI 1 "" ""))
+(define_insn "*call_pop"
+  [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lzm"))
+        (match_operand 1 "" ""))
    (set (reg:SI SP_REG)
        (plus:SI (reg:SI SP_REG)
                 (match_operand:SI 2 "immediate_operand" "i")))]
   "!TARGET_64BIT && !SIBLING_CALL_P (insn)"
-{
-  if (constant_call_address_operand (operands[0], Pmode))
-    return "call\t%P0";
-  return "call\t%A0";
-}
+  "* return ix86_output_call_insn (insn, operands[0]);"
   [(set_attr "type" "call")])
 
-(define_insn_and_split "*sibcall_pop_1_vzeroupper"
+(define_insn_and_split "*sibcall_pop_vzeroupper"
  [(parallel
-   [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "s,U"))
-          (match_operand:SI 1 "" ""))
+   [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "Uz"))
+         (match_operand 1 "" ""))
      (set (reg:SI SP_REG)
          (plus:SI (reg:SI SP_REG)
-                  (match_operand:SI 2 "immediate_operand" "i,i")))])
+                  (match_operand:SI 2 "immediate_operand" "i")))])
    (unspec [(match_operand 3 "const_int_operand" "")]
           UNSPEC_CALL_NEEDS_VZEROUPPER)]
   "TARGET_VZEROUPPER && !TARGET_64BIT && SIBLING_CALL_P (insn)"
   "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
   [(set_attr "type" "call")])
 
-(define_insn "*sibcall_pop_1"
-  [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "s,U"))
-        (match_operand:SI 1 "" ""))
+(define_insn "*sibcall_pop"
+  [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "Uz"))
+        (match_operand 1 "" ""))
    (set (reg:SI SP_REG)
        (plus:SI (reg:SI SP_REG)
-                (match_operand:SI 2 "immediate_operand" "i,i")))]
+                (match_operand:SI 2 "immediate_operand" "i")))]
   "!TARGET_64BIT && SIBLING_CALL_P (insn)"
-  "@
-   jmp\t%P0
-   jmp\t%A0"
+  "* return ix86_output_call_insn (insn, operands[0]);"
   [(set_attr "type" "call")])
 
-(define_expand "call"
-  [(call (match_operand:QI 0 "" "")
-        (match_operand 1 "" ""))
-   (use (match_operand 2 "" ""))]
+;; Call subroutine, returning value in operand 0
+
+(define_expand "call_value"
+  [(set (match_operand 0 "" "")
+       (call (match_operand:QI 1 "" "")
+             (match_operand 2 "" "")))
+   (use (match_operand 3 "" ""))]
   ""
 {
-  ix86_expand_call (NULL, operands[0], operands[1], operands[2], NULL, 0);
+  ix86_expand_call (operands[0], operands[1], operands[2],
+                   operands[3], NULL, false);
   DONE;
 })
 
-(define_expand "sibcall"
-  [(call (match_operand:QI 0 "" "")
-        (match_operand 1 "" ""))
-   (use (match_operand 2 "" ""))]
+(define_expand "sibcall_value"
+  [(set (match_operand 0 "" "")
+       (call (match_operand:QI 1 "" "")
+             (match_operand 2 "" "")))
+   (use (match_operand 3 "" ""))]
   ""
 {
-  ix86_expand_call (NULL, operands[0], operands[1], operands[2], NULL, 1);
+  ix86_expand_call (operands[0], operands[1], operands[2],
+                   operands[3], NULL, true);
   DONE;
 })
 
-(define_insn_and_split "*call_0_vzeroupper"
-  [(call (mem:QI (match_operand 0 "constant_call_address_operand" ""))
-        (match_operand 1 "" ""))
-   (unspec [(match_operand 2 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
-  [(set_attr "type" "call")])
-
-(define_insn "*call_0"
-  [(call (mem:QI (match_operand 0 "constant_call_address_operand" ""))
-        (match_operand 1 "" ""))]
-  ""
-  { return ix86_output_call_insn (insn, operands[0], 0); }
-  [(set_attr "type" "call")])
-
-(define_insn_and_split "*call_1_vzeroupper"
-  [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lsm"))
-        (match_operand 1 "" ""))
-   (unspec [(match_operand 2 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && !TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
-  [(set_attr "type" "call")])
-
-(define_insn "*call_1"
-  [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lsm"))
-        (match_operand 1 "" ""))]
-  "!TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[0], 0); }
-  [(set_attr "type" "call")])
-
-(define_insn_and_split "*sibcall_1_vzeroupper"
-  [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "s,U"))
-        (match_operand 1 "" ""))
-   (unspec [(match_operand 2 "const_int_operand" "")]
+(define_insn_and_split "*call_value_vzeroupper"
+  [(set (match_operand 0 "" "")
+       (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zm"))
+             (match_operand 2 "" "")))
+   (unspec [(match_operand 3 "const_int_operand" "")]
           UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && !TARGET_64BIT && SIBLING_CALL_P (insn)"
+  "TARGET_VZEROUPPER && !SIBLING_CALL_P (insn)"
   "#"
   "&& reload_completed"
   [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
-  [(set_attr "type" "call")])
+  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
+  [(set_attr "type" "callv")])
 
-(define_insn "*sibcall_1"
-  [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "s,U"))
-        (match_operand 1 "" ""))]
-  "!TARGET_64BIT && SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[0], 0); }
-  [(set_attr "type" "call")])
+(define_insn "*call_value"
+  [(set (match_operand 0 "" "")
+       (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zm"))
+             (match_operand 2 "" "")))]
+  "!SIBLING_CALL_P (insn)"
+  "* return ix86_output_call_insn (insn, operands[1]);"
+  [(set_attr "type" "callv")])
 
-(define_insn_and_split "*call_1_rex64_vzeroupper"
-  [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rsm"))
-        (match_operand 1 "" ""))
-   (unspec [(match_operand 2 "const_int_operand" "")]
+(define_insn_and_split "*sibcall_value_vzeroupper"
+  [(set (match_operand 0 "" "")
+       (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz"))
+             (match_operand 2 "" "")))
+   (unspec [(match_operand 3 "const_int_operand" "")]
           UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)
-   && ix86_cmodel != CM_LARGE && ix86_cmodel != CM_LARGE_PIC"
+  "TARGET_VZEROUPPER && SIBLING_CALL_P (insn)"
   "#"
   "&& reload_completed"
   [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
-  [(set_attr "type" "call")])
+  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
+  [(set_attr "type" "callv")])
 
-(define_insn "*call_1_rex64"
-  [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rsm"))
-        (match_operand 1 "" ""))]
-  "TARGET_64BIT && !SIBLING_CALL_P (insn)
-   && ix86_cmodel != CM_LARGE && ix86_cmodel != CM_LARGE_PIC"
-  { return ix86_output_call_insn (insn, operands[0], 0); }
-  [(set_attr "type" "call")])
+(define_insn "*sibcall_value"
+  [(set (match_operand 0 "" "")
+       (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz"))
+             (match_operand 2 "" "")))]
+  "SIBLING_CALL_P (insn)"
+  "* return ix86_output_call_insn (insn, operands[1]);"
+  [(set_attr "type" "callv")])
 
-(define_insn_and_split "*call_1_rex64_ms_sysv_vzeroupper"
+(define_insn_and_split "*call_value_rex64_ms_sysv_vzeroupper"
   [(parallel
-    [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rsm"))
-          (match_operand 1 "" ""))
+    [(set (match_operand 0 "" "")
+         (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rzm"))
+               (match_operand 2 "" "")))
      (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
      (clobber (reg:TI XMM6_REG))
      (clobber (reg:TI XMM7_REG))
      (clobber (reg:TI XMM15_REG))
      (clobber (reg:DI SI_REG))
      (clobber (reg:DI DI_REG))])
-   (unspec [(match_operand 2 "const_int_operand" "")]
+   (unspec [(match_operand 3 "const_int_operand" "")]
           UNSPEC_CALL_NEEDS_VZEROUPPER)]
   "TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)"
   "#"
   "&& reload_completed"
   [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
-  [(set_attr "type" "call")])
+  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
+  [(set_attr "type" "callv")])
 
-(define_insn "*call_1_rex64_ms_sysv"
-  [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rsm"))
-        (match_operand 1 "" ""))
+(define_insn "*call_value_rex64_ms_sysv"
+  [(set (match_operand 0 "" "")
+       (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rzm"))
+             (match_operand 2 "" "")))
    (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
    (clobber (reg:TI XMM6_REG))
    (clobber (reg:TI XMM7_REG))
    (clobber (reg:DI SI_REG))
    (clobber (reg:DI DI_REG))]
   "TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[0], 0); }
-  [(set_attr "type" "call")])
-
-(define_insn_and_split "*call_1_rex64_large_vzeroupper"
-  [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rm"))
-        (match_operand 1 "" ""))
-   (unspec [(match_operand 2 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
-  [(set_attr "type" "call")])
-
-(define_insn "*call_1_rex64_large"
-  [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rm"))
-        (match_operand 1 "" ""))]
-  "TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[0], 0); }
-  [(set_attr "type" "call")])
-
-(define_insn_and_split "*sibcall_1_rex64_vzeroupper"
-  [(call (mem:QI (match_operand:DI 0 "sibcall_insn_operand" "s,U"))
-        (match_operand 1 "" ""))
-   (unspec [(match_operand 2 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && TARGET_64BIT && SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
-  [(set_attr "type" "call")])
-
-(define_insn "*sibcall_1_rex64"
-  [(call (mem:QI (match_operand:DI 0 "sibcall_insn_operand" "s,U"))
-        (match_operand 1 "" ""))]
-  "TARGET_64BIT && SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[0], 0); }
-  [(set_attr "type" "call")])
+  "* return ix86_output_call_insn (insn, operands[1]);"
+  [(set_attr "type" "callv")])
 
-;; Call subroutine, returning value in operand 0
 (define_expand "call_value_pop"
   [(parallel [(set (match_operand 0 "" "")
                   (call (match_operand:QI 1 "" "")
   "!TARGET_64BIT"
 {
   ix86_expand_call (operands[0], operands[1], operands[2],
-                   operands[3], operands[4], 0);
+                   operands[3], operands[4], false);
   DONE;
 })
 
-(define_expand "call_value"
+(define_insn_and_split "*call_value_pop_vzeroupper"
+  [(parallel
+    [(set (match_operand 0 "" "")
+         (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lzm"))
+               (match_operand 2 "" "")))
+     (set (reg:SI SP_REG)
+         (plus:SI (reg:SI SP_REG)
+                  (match_operand:SI 3 "immediate_operand" "i")))])
+   (unspec [(match_operand 4 "const_int_operand" "")]
+          UNSPEC_CALL_NEEDS_VZEROUPPER)]
+  "TARGET_VZEROUPPER && !TARGET_64BIT && !SIBLING_CALL_P (insn)"
+  "#"
+  "&& reload_completed"
+  [(const_int 0)]
+  "ix86_split_call_vzeroupper (curr_insn, operands[4]); DONE;"
+  [(set_attr "type" "callv")])
+
+(define_insn "*call_value_pop"
   [(set (match_operand 0 "" "")
-       (call (match_operand:QI 1 "" "")
-             (match_operand:SI 2 "" "")))
-   (use (match_operand:SI 3 "" ""))]
-  ;; Operand 3 is not used on the i386.
-  ""
-{
-  ix86_expand_call (operands[0], operands[1], operands[2],
-                   operands[3], NULL, 0);
-  DONE;
-})
+       (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lzm"))
+             (match_operand 2 "" "")))
+   (set (reg:SI SP_REG)
+       (plus:SI (reg:SI SP_REG)
+                (match_operand:SI 3 "immediate_operand" "i")))]
+  "!TARGET_64BIT && !SIBLING_CALL_P (insn)"
+  "* return ix86_output_call_insn (insn, operands[1]);"
+  [(set_attr "type" "callv")])
 
-(define_expand "sibcall_value"
+(define_insn_and_split "*sibcall_value_pop_vzeroupper"
+ [(parallel
+   [(set (match_operand 0 "" "")
+         (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "Uz"))
+               (match_operand 2 "" "")))
+     (set (reg:SI SP_REG)
+         (plus:SI (reg:SI SP_REG)
+                  (match_operand:SI 3 "immediate_operand" "i")))])
+   (unspec [(match_operand 4 "const_int_operand" "")]
+          UNSPEC_CALL_NEEDS_VZEROUPPER)]
+  "TARGET_VZEROUPPER && !TARGET_64BIT && SIBLING_CALL_P (insn)"
+  "#"
+  "&& reload_completed"
+  [(const_int 0)]
+  "ix86_split_call_vzeroupper (curr_insn, operands[4]); DONE;"
+  [(set_attr "type" "callv")])
+
+(define_insn "*sibcall_value_pop"
   [(set (match_operand 0 "" "")
-       (call (match_operand:QI 1 "" "")
-             (match_operand:SI 2 "" "")))
-   (use (match_operand:SI 3 "" ""))]
-  ;; Operand 3 is not used on the i386.
-  ""
-{
-  ix86_expand_call (operands[0], operands[1], operands[2],
-                   operands[3], NULL, 1);
-  DONE;
-})
+       (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "Uz"))
+             (match_operand 2 "" "")))
+   (set (reg:SI SP_REG)
+       (plus:SI (reg:SI SP_REG)
+                (match_operand:SI 3 "immediate_operand" "i")))]
+  "!TARGET_64BIT && SIBLING_CALL_P (insn)"
+  "* return ix86_output_call_insn (insn, operands[1]);"
+  [(set_attr "type" "callv")])
 
 ;; Call subroutine returning any type.
 
                                 : X86_64_MS_SSE_REGPARM_MAX)
                              : X86_32_SSE_REGPARM_MAX)
                             - 1),
-                   NULL, 0);
+                   NULL, false);
 
   for (i = 0; i < XVECLEN (operands[2], 0); i++)
     {
 
 (define_insn "*tls_global_dynamic_32_gnu"
   [(set (match_operand:SI 0 "register_operand" "=a")
-       (unspec:SI [(match_operand:SI 1 "register_operand" "b")
-                   (match_operand:SI 2 "tls_symbolic_operand" "")
-                   (match_operand:SI 3 "call_insn_operand" "")]
-                   UNSPEC_TLS_GD))
+       (unspec:SI
+        [(match_operand:SI 1 "register_operand" "b")
+         (match_operand:SI 2 "tls_symbolic_operand" "")
+         (match_operand:SI 3 "constant_call_address_operand" "z")]
+        UNSPEC_TLS_GD))
    (clobber (match_scratch:SI 4 "=d"))
    (clobber (match_scratch:SI 5 "=c"))
    (clobber (reg:CC FLAGS_REG))]
   "!TARGET_64BIT && TARGET_GNU_TLS"
-  "lea{l}\t{%a2@tlsgd(,%1,1), %0|%0, %a2@tlsgd[%1*1]}\;call\t%P3"
+{
+  output_asm_insn
+    ("lea{l}\t{%a2@tlsgd(,%1,1), %0|%0, %a2@tlsgd[%1*1]}", operands);
+  if (TARGET_SUN_TLS)
+#ifdef HAVE_AS_IX86_TLSGDPLT
+    return "call\t%a2@tlsgdplt";
+#else
+    return "call\t%p3@plt";
+#endif
+  return "call\t%P3";
+}
   [(set_attr "type" "multi")
    (set_attr "length" "12")])
 
 (define_expand "tls_global_dynamic_32"
-  [(parallel [(set (match_operand:SI 0 "register_operand" "")
-                  (unspec:SI
-                   [(match_dup 2)
-                    (match_operand:SI 1 "tls_symbolic_operand" "")
-                    (match_dup 3)]
-                   UNSPEC_TLS_GD))
-             (clobber (match_scratch:SI 4 ""))
-             (clobber (match_scratch:SI 5 ""))
-             (clobber (reg:CC FLAGS_REG))])]
-  ""
-{
-  if (flag_pic)
-    operands[2] = pic_offset_table_rtx;
-  else
-    {
-      operands[2] = gen_reg_rtx (Pmode);
-      emit_insn (gen_set_got (operands[2]));
-    }
-  if (TARGET_GNU2_TLS)
-    {
-       emit_insn (gen_tls_dynamic_gnu2_32
-                 (operands[0], operands[1], operands[2]));
-       DONE;
-    }
-  operands[3] = ix86_tls_get_addr ();
-})
+  [(parallel
+    [(set (match_operand:SI 0 "register_operand" "")
+         (unspec:SI [(match_operand:SI 2 "register_operand" "")
+                     (match_operand:SI 1 "tls_symbolic_operand" "")
+                     (match_operand:SI 3 "constant_call_address_operand" "")]
+                    UNSPEC_TLS_GD))
+     (clobber (match_scratch:SI 4 ""))
+     (clobber (match_scratch:SI 5 ""))
+     (clobber (reg:CC FLAGS_REG))])])
 
 (define_insn "*tls_global_dynamic_64"
   [(set (match_operand:DI 0 "register_operand" "=a")
-       (call:DI (mem:QI (match_operand:DI 2 "call_insn_operand" ""))
-                (match_operand:DI 3 "" "")))
+       (call:DI
+        (mem:QI (match_operand:DI 2 "constant_call_address_operand" "z"))
+        (match_operand:DI 3 "" "")))
    (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")]
              UNSPEC_TLS_GD)]
   "TARGET_64BIT"
-  { return ASM_BYTE "0x66\n\tlea{q}\t{%a1@tlsgd(%%rip), %%rdi|rdi, %a1@tlsgd[rip]}\n" ASM_SHORT "0x6666\n\trex64\n\tcall\t%P2"; }
+{
+  fputs (ASM_BYTE "0x66\n", asm_out_file);
+  output_asm_insn
+    ("lea{q}\t{%a1@tlsgd(%%rip), %%rdi|rdi, %a1@tlsgd[rip]}", operands);
+  fputs (ASM_SHORT "0x6666\n", asm_out_file);
+  fputs ("\trex64\n", asm_out_file);
+  if (TARGET_SUN_TLS)
+    return "call\t%p2@plt";
+  return "call\t%P2";
+}
   [(set_attr "type" "multi")
    (set_attr "length" "16")])
 
 (define_expand "tls_global_dynamic_64"
-  [(parallel [(set (match_operand:DI 0 "register_operand" "")
-                  (call:DI (mem:QI (match_dup 2)) (const_int 0)))
-             (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")]
-                        UNSPEC_TLS_GD)])]
-  ""
-{
-  if (TARGET_GNU2_TLS)
-    {
-       emit_insn (gen_tls_dynamic_gnu2_64
-                 (operands[0], operands[1]));
-       DONE;
-    }
-  operands[2] = ix86_tls_get_addr ();
-})
+  [(parallel
+    [(set (match_operand:DI 0 "register_operand" "")
+         (call:DI
+          (mem:QI (match_operand:DI 2 "constant_call_address_operand" ""))
+          (const_int 0)))
+     (unspec:DI [(match_operand:DI 1 "tls_symbolic_operand" "")]
+               UNSPEC_TLS_GD)])])
 
 (define_insn "*tls_local_dynamic_base_32_gnu"
   [(set (match_operand:SI 0 "register_operand" "=a")
-       (unspec:SI [(match_operand:SI 1 "register_operand" "b")
-                    (match_operand:SI 2 "call_insn_operand" "")]
-                  UNSPEC_TLS_LD_BASE))
+       (unspec:SI
+        [(match_operand:SI 1 "register_operand" "b")
+         (match_operand:SI 2 "constant_call_address_operand" "z")]
+        UNSPEC_TLS_LD_BASE))
    (clobber (match_scratch:SI 3 "=d"))
    (clobber (match_scratch:SI 4 "=c"))
    (clobber (reg:CC FLAGS_REG))]
   "!TARGET_64BIT && TARGET_GNU_TLS"
-  "lea{l}\t{%&@tlsldm(%1), %0|%0, %&@tlsldm[%1]}\;call\t%P2"
+{
+  output_asm_insn
+    ("lea{l}\t{%&@tlsldm(%1), %0|%0, %&@tlsldm[%1]}", operands);
+  if (TARGET_SUN_TLS)
+#ifdef HAVE_AS_IX86_TLSLDMPLT
+    return "call\t%&@tlsldmplt";
+#else
+    return "call\t%p2@plt";
+#endif
+  return "call\t%P2";
+}
   [(set_attr "type" "multi")
    (set_attr "length" "11")])
 
 (define_expand "tls_local_dynamic_base_32"
-  [(parallel [(set (match_operand:SI 0 "register_operand" "")
-                  (unspec:SI [(match_dup 1) (match_dup 2)]
-                             UNSPEC_TLS_LD_BASE))
-             (clobber (match_scratch:SI 3 ""))
-             (clobber (match_scratch:SI 4 ""))
-             (clobber (reg:CC FLAGS_REG))])]
-  ""
-{
-  if (flag_pic)
-    operands[1] = pic_offset_table_rtx;
-  else
-    {
-      operands[1] = gen_reg_rtx (Pmode);
-      emit_insn (gen_set_got (operands[1]));
-    }
-  if (TARGET_GNU2_TLS)
-    {
-       emit_insn (gen_tls_dynamic_gnu2_32
-                 (operands[0], ix86_tls_module_base (), operands[1]));
-       DONE;
-    }
-  operands[2] = ix86_tls_get_addr ();
-})
+  [(parallel
+     [(set (match_operand:SI 0 "register_operand" "")
+          (unspec:SI
+           [(match_operand:SI 1 "register_operand" "")
+            (match_operand:SI 2 "constant_call_address_operand" "")]
+           UNSPEC_TLS_LD_BASE))
+      (clobber (match_scratch:SI 3 ""))
+      (clobber (match_scratch:SI 4 ""))
+      (clobber (reg:CC FLAGS_REG))])])
 
 (define_insn "*tls_local_dynamic_base_64"
   [(set (match_operand:DI 0 "register_operand" "=a")
-       (call:DI (mem:QI (match_operand:DI 1 "call_insn_operand" ""))
-                (match_operand:DI 2 "" "")))
+       (call:DI
+        (mem:QI (match_operand:DI 1 "constant_call_address_operand" "z"))
+        (match_operand:DI 2 "" "")))
    (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)]
   "TARGET_64BIT"
-  "lea{q}\t{%&@tlsld(%%rip), %%rdi|rdi, %&@tlsld[rip]}\;call\t%P1"
+{
+  output_asm_insn
+    ("lea{q}\t{%&@tlsld(%%rip), %%rdi|rdi, %&@tlsld[rip]}", operands);
+  if (TARGET_SUN_TLS)
+    return "call\t%p1@plt";
+  return "call\t%P1";
+}
   [(set_attr "type" "multi")
    (set_attr "length" "12")])
 
 (define_expand "tls_local_dynamic_base_64"
-  [(parallel [(set (match_operand:DI 0 "register_operand" "")
-                  (call:DI (mem:QI (match_dup 1)) (const_int 0)))
-             (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)])]
-  ""
-{
-  if (TARGET_GNU2_TLS)
-    {
-       emit_insn (gen_tls_dynamic_gnu2_64
-                 (operands[0], ix86_tls_module_base ()));
-       DONE;
-    }
-  operands[1] = ix86_tls_get_addr ();
-})
+  [(parallel
+     [(set (match_operand:DI 0 "register_operand" "")
+          (call:DI
+           (mem:QI (match_operand:DI 1 "constant_call_address_operand" ""))
+           (const_int 0)))
+      (unspec:DI [(const_int 0)] UNSPEC_TLS_LD_BASE)])])
 
 ;; Local dynamic of a single variable is a lose.  Show combine how
 ;; to convert that back to global dynamic.
 
 (define_insn_and_split "*tls_local_dynamic_32_once"
   [(set (match_operand:SI 0 "register_operand" "=a")
-       (plus:SI (unspec:SI [(match_operand:SI 1 "register_operand" "b")
-                            (match_operand:SI 2 "call_insn_operand" "")]
-                           UNSPEC_TLS_LD_BASE)
-                (const:SI (unspec:SI
-                           [(match_operand:SI 3 "tls_symbolic_operand" "")]
-                           UNSPEC_DTPOFF))))
+       (plus:SI
+        (unspec:SI [(match_operand:SI 1 "register_operand" "b")
+                    (match_operand:SI 2 "constant_call_address_operand" "z")]
+                   UNSPEC_TLS_LD_BASE)
+        (const:SI (unspec:SI
+                   [(match_operand:SI 3 "tls_symbolic_operand" "")]
+                   UNSPEC_DTPOFF))))
    (clobber (match_scratch:SI 4 "=d"))
    (clobber (match_scratch:SI 5 "=c"))
    (clobber (reg:CC FLAGS_REG))]
   ""
   "#"
   ""
-  [(parallel [(set (match_dup 0)
-                  (unspec:SI [(match_dup 1) (match_dup 3) (match_dup 2)]
-                             UNSPEC_TLS_GD))
-             (clobber (match_dup 4))
-             (clobber (match_dup 5))
-             (clobber (reg:CC FLAGS_REG))])])
+  [(parallel
+     [(set (match_dup 0)
+          (unspec:SI [(match_dup 1) (match_dup 3) (match_dup 2)]
+                     UNSPEC_TLS_GD))
+      (clobber (match_dup 4))
+      (clobber (match_dup 5))
+      (clobber (reg:CC FLAGS_REG))])])
 
 ;; Segment register for the thread base ptr load
 (define_mode_attr tp_seg [(SI "gs") (DI "fs")])
 
-;; Load and add the thread base pointer from %gs:0.
+;; Load and add the thread base pointer from %<tp_seg>:0.
 (define_insn "*load_tp_<mode>"
   [(set (match_operand:P 0 "register_operand" "=r")
        (unspec:P [(const_int 0)] UNSPEC_TP))]
         UNSPEC_TLS_IE_SUN))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT && TARGET_SUN_TLS"
-  "mov{q}\t{%%fs:0, %0|%0, QWORD PTR fs:0}\n\tadd{q}\t{%a1@gottpoff(%%rip), %0|%0, %a1@gottpoff[rip]}"
+{
+  output_asm_insn
+    ("mov{q}\t{%%fs:0, %0|%0, QWORD PTR fs:0}", operands);
+  return "add{q}\t{%a1@gottpoff(%%rip), %0|%0, %a1@gottpoff[rip]}";
+}
   [(set_attr "type" "multi")])
 
 ;; GNU2 TLS patterns can be split.
    (set (match_operand:XF 1 "register_operand" "")
        (unspec:XF [(match_dup 2)] UNSPEC_SINCOS_SIN))]
   "find_regno_note (insn, REG_UNUSED, REGNO (operands[0]))
-   && !(reload_completed || reload_in_progress)"
+   && can_create_pseudo_p ()"
   [(set (match_dup 1) (unspec:XF [(match_dup 2)] UNSPEC_SIN))])
 
 (define_split
    (set (match_operand:XF 1 "register_operand" "")
        (unspec:XF [(match_dup 2)] UNSPEC_SINCOS_SIN))]
   "find_regno_note (insn, REG_UNUSED, REGNO (operands[1]))
-   && !(reload_completed || reload_in_progress)"
+   && can_create_pseudo_p ()"
   [(set (match_dup 0) (unspec:XF [(match_dup 2)] UNSPEC_COS))])
 
 (define_insn "sincos_extend<mode>xf3_i387"
    (set (match_operand:XF 1 "register_operand" "")
        (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_SINCOS_SIN))]
   "find_regno_note (insn, REG_UNUSED, REGNO (operands[0]))
-   && !(reload_completed || reload_in_progress)"
+   && can_create_pseudo_p ()"
   [(set (match_dup 1)
        (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_SIN))])
 
    (set (match_operand:XF 1 "register_operand" "")
        (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_SINCOS_SIN))]
   "find_regno_note (insn, REG_UNUSED, REGNO (operands[1]))
-   && !(reload_completed || reload_in_progress)"
+   && can_create_pseudo_p ()"
   [(set (match_dup 0)
        (unspec:XF [(float_extend:XF (match_dup 2))] UNSPEC_COS))])
 
                   UNSPEC_FIST))
    (clobber (match_scratch:XF 2 "=&1f"))]
   "TARGET_USE_FANCY_MATH_387"
-  "* return output_fix_trunc (insn, operands, 0);"
+  "* return output_fix_trunc (insn, operands, false);"
   [(set_attr "type" "fpspc")
    (set_attr "mode" "DI")])
 
        (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")]
                           UNSPEC_FIST))]
   "TARGET_USE_FANCY_MATH_387"
-  "* return output_fix_trunc (insn, operands, 0);"
+  "* return output_fix_trunc (insn, operands, false);"
   [(set_attr "type" "fpspc")
    (set_attr "mode" "<MODE>")])
 
    (clobber (match_scratch:XF 4 "=&1f"))]
   "TARGET_USE_FANCY_MATH_387
    && flag_unsafe_math_optimizations"
-  "* return output_fix_trunc (insn, operands, 0);"
+  "* return output_fix_trunc (insn, operands, false);"
   [(set_attr "type" "fistp")
    (set_attr "i387_cw" "floor")
    (set_attr "mode" "DI")])
    (use (match_operand:HI 3 "memory_operand" "m"))]
   "TARGET_USE_FANCY_MATH_387
    && flag_unsafe_math_optimizations"
-  "* return output_fix_trunc (insn, operands, 0);"
+  "* return output_fix_trunc (insn, operands, false);"
   [(set_attr "type" "fistp")
    (set_attr "i387_cw" "floor")
    (set_attr "mode" "<MODE>")])
    (clobber (match_scratch:XF 4 "=&1f"))]
   "TARGET_USE_FANCY_MATH_387
    && flag_unsafe_math_optimizations"
-  "* return output_fix_trunc (insn, operands, 0);"
+  "* return output_fix_trunc (insn, operands, false);"
   [(set_attr "type" "fistp")
    (set_attr "i387_cw" "ceil")
    (set_attr "mode" "DI")])
    (use (match_operand:HI 3 "memory_operand" "m"))]
   "TARGET_USE_FANCY_MATH_387
    && flag_unsafe_math_optimizations"
-  "* return output_fix_trunc (insn, operands, 0);"
+  "* return output_fix_trunc (insn, operands, false);"
   [(set_attr "type" "fistp")
    (set_attr "i387_cw" "ceil")
    (set_attr "mode" "<MODE>")])
   operands[0] = dest;
 })
 \f
-;; Call-value patterns last so that the wildcard operand does not
-;; disrupt insn-recog's switch tables.
-
-(define_insn_and_split "*call_value_pop_0_vzeroupper"
-  [(parallel
-    [(set (match_operand 0 "" "")
-         (call (mem:QI (match_operand:SI 1 "constant_call_address_operand" ""))
-               (match_operand:SI 2 "" "")))
-     (set (reg:SI SP_REG)
-         (plus:SI (reg:SI SP_REG)
-                  (match_operand:SI 3 "immediate_operand" "")))])
-   (unspec [(match_operand 4 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && !TARGET_64BIT"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[4]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*call_value_pop_0"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:SI 1 "constant_call_address_operand" ""))
-             (match_operand:SI 2 "" "")))
-   (set (reg:SI SP_REG)
-       (plus:SI (reg:SI SP_REG)
-                (match_operand:SI 3 "immediate_operand" "")))]
-  "!TARGET_64BIT"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*call_value_pop_1_vzeroupper"
-  [(parallel
-    [(set (match_operand 0 "" "")
-         (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lsm"))
-               (match_operand:SI 2 "" "")))
-     (set (reg:SI SP_REG)
-         (plus:SI (reg:SI SP_REG)
-                  (match_operand:SI 3 "immediate_operand" "i")))])
-   (unspec [(match_operand 4 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && !TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[4]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*call_value_pop_1"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lsm"))
-             (match_operand:SI 2 "" "")))
-   (set (reg:SI SP_REG)
-       (plus:SI (reg:SI SP_REG)
-                (match_operand:SI 3 "immediate_operand" "i")))]
-  "!TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*sibcall_value_pop_1_vzeroupper"
- [(parallel
-   [(set (match_operand 0 "" "")
-         (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "s,U"))
-               (match_operand:SI 2 "" "")))
-     (set (reg:SI SP_REG)
-         (plus:SI (reg:SI SP_REG)
-                  (match_operand:SI 3 "immediate_operand" "i,i")))])
-   (unspec [(match_operand 4 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && !TARGET_64BIT && SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[4]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*sibcall_value_pop_1"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "s,U"))
-             (match_operand:SI 2 "" "")))
-   (set (reg:SI SP_REG)
-       (plus:SI (reg:SI SP_REG)
-                (match_operand:SI 3 "immediate_operand" "i,i")))]
-  "!TARGET_64BIT && SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*call_value_0_vzeroupper"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:SI 1 "constant_call_address_operand" ""))
-             (match_operand:SI 2 "" "")))
-   (unspec [(match_operand 3 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && !TARGET_64BIT"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*call_value_0"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:SI 1 "constant_call_address_operand" ""))
-             (match_operand:SI 2 "" "")))]
-  "!TARGET_64BIT"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*call_value_0_rex64_vzeroupper"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "constant_call_address_operand" ""))
-             (match_operand:DI 2 "const_int_operand" "")))
-   (unspec [(match_operand 3 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && TARGET_64BIT"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*call_value_0_rex64"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "constant_call_address_operand" ""))
-             (match_operand:DI 2 "const_int_operand" "")))]
-  "TARGET_64BIT"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*call_value_0_rex64_ms_sysv_vzeroupper"
-  [(parallel
-    [(set (match_operand 0 "" "")
-         (call (mem:QI (match_operand:DI 1 "constant_call_address_operand" ""))
-               (match_operand:DI 2 "const_int_operand" "")))
-     (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
-     (clobber (reg:TI XMM6_REG))
-     (clobber (reg:TI XMM7_REG))
-     (clobber (reg:TI XMM8_REG))
-     (clobber (reg:TI XMM9_REG))
-     (clobber (reg:TI XMM10_REG))
-     (clobber (reg:TI XMM11_REG))
-     (clobber (reg:TI XMM12_REG))
-     (clobber (reg:TI XMM13_REG))
-     (clobber (reg:TI XMM14_REG))
-     (clobber (reg:TI XMM15_REG))
-     (clobber (reg:DI SI_REG))
-     (clobber (reg:DI DI_REG))])
-   (unspec [(match_operand 3 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*call_value_0_rex64_ms_sysv"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "constant_call_address_operand" ""))
-             (match_operand:DI 2 "const_int_operand" "")))
-   (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
-   (clobber (reg:TI XMM6_REG))
-   (clobber (reg:TI XMM7_REG))
-   (clobber (reg:TI XMM8_REG))
-   (clobber (reg:TI XMM9_REG))
-   (clobber (reg:TI XMM10_REG))
-   (clobber (reg:TI XMM11_REG))
-   (clobber (reg:TI XMM12_REG))
-   (clobber (reg:TI XMM13_REG))
-   (clobber (reg:TI XMM14_REG))
-   (clobber (reg:TI XMM15_REG))
-   (clobber (reg:DI SI_REG))
-   (clobber (reg:DI DI_REG))]
-  "TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*call_value_1_vzeroupper"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lsm"))
-             (match_operand:SI 2 "" "")))
-   (unspec [(match_operand 3 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && !TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*call_value_1"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lsm"))
-             (match_operand:SI 2 "" "")))]
-  "!TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*sibcall_value_1_vzeroupper"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "s,U"))
-             (match_operand:SI 2 "" "")))
-   (unspec [(match_operand 3 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && !TARGET_64BIT && SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*sibcall_value_1"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "s,U"))
-             (match_operand:SI 2 "" "")))]
-  "!TARGET_64BIT && SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*call_value_1_rex64_vzeroupper"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rsm"))
-             (match_operand:DI 2 "" "")))
-   (unspec [(match_operand 3 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)
-   && ix86_cmodel != CM_LARGE && ix86_cmodel != CM_LARGE_PIC"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*call_value_1_rex64"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rsm"))
-             (match_operand:DI 2 "" "")))]
-  "TARGET_64BIT && !SIBLING_CALL_P (insn)
-   && ix86_cmodel != CM_LARGE && ix86_cmodel != CM_LARGE_PIC"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*call_value_1_rex64_ms_sysv_vzeroupper"
-  [(parallel
-    [(set (match_operand 0 "" "")
-         (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rsm"))
-               (match_operand:DI 2 "" "")))
-     (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
-     (clobber (reg:TI XMM6_REG))
-     (clobber (reg:TI XMM7_REG))
-     (clobber (reg:TI XMM8_REG))
-     (clobber (reg:TI XMM9_REG))
-     (clobber (reg:TI XMM10_REG))
-     (clobber (reg:TI XMM11_REG))
-     (clobber (reg:TI XMM12_REG))
-     (clobber (reg:TI XMM13_REG))
-     (clobber (reg:TI XMM14_REG))
-     (clobber (reg:TI XMM15_REG))
-     (clobber (reg:DI SI_REG))
-     (clobber (reg:DI DI_REG))])
-   (unspec [(match_operand 3 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*call_value_1_rex64_ms_sysv"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rsm"))
-             (match_operand:DI 2 "" "")))
-   (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
-   (clobber (reg:TI XMM6_REG))
-   (clobber (reg:TI XMM7_REG))
-   (clobber (reg:TI XMM8_REG))
-   (clobber (reg:TI XMM9_REG))
-   (clobber (reg:TI XMM10_REG))
-   (clobber (reg:TI XMM11_REG))
-   (clobber (reg:TI XMM12_REG))
-   (clobber (reg:TI XMM13_REG))
-   (clobber (reg:TI XMM14_REG))
-   (clobber (reg:TI XMM15_REG))
-   (clobber (reg:DI SI_REG))
-   (clobber (reg:DI DI_REG))]
-  "TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*call_value_1_rex64_large_vzeroupper"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rm"))
-             (match_operand:DI 2 "" "")))
-   (unspec [(match_operand 3 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*call_value_1_rex64_large"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rm"))
-             (match_operand:DI 2 "" "")))]
-  "TARGET_64BIT && !SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-
-(define_insn_and_split "*sibcall_value_1_rex64_vzeroupper"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "sibcall_insn_operand" "s,U"))
-             (match_operand:DI 2 "" "")))
-   (unspec [(match_operand 3 "const_int_operand" "")]
-          UNSPEC_CALL_NEEDS_VZEROUPPER)]
-  "TARGET_VZEROUPPER && TARGET_64BIT && SIBLING_CALL_P (insn)"
-  "#"
-  "&& reload_completed"
-  [(const_int 0)]
-  "ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
-  [(set_attr "type" "callv")])
-
-(define_insn "*sibcall_value_1_rex64"
-  [(set (match_operand 0 "" "")
-       (call (mem:QI (match_operand:DI 1 "sibcall_insn_operand" "s,U"))
-             (match_operand:DI 2 "" "")))]
-  "TARGET_64BIT && SIBLING_CALL_P (insn)"
-  { return ix86_output_call_insn (insn, operands[1], 1); }
-  [(set_attr "type" "callv")])
-\f
 ;; We used to use "int $5", in honor of #BR which maps to interrupt vector 5.
 ;; That, however, is usually mapped by the OS to SIGSEGV, which is often
 ;; caught for use by garbage collectors and the like.  Using an insn that
   [(set_attr "type" "other")
    (set_attr "prefix_extra" "1")])
 
+(define_expand "pause"
+  [(set (match_dup 0)
+       (unspec:BLK [(match_dup 0)] UNSPEC_PAUSE))]
+  ""
+{
+  operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
+  MEM_VOLATILE_P (operands[0]) = 1;
+})
+
+;; Use "rep; nop", instead of "pause", to support older assemblers.
+;; They have the same encoding.
+(define_insn "*pause"
+  [(set (match_operand:BLK 0 "" "")
+       (unspec:BLK [(match_dup 0)] UNSPEC_PAUSE))]
+  ""
+  "rep; nop"
+  [(set_attr "length" "2")
+   (set_attr "memory" "unknown")])
+
 (include "mmx.md")
 (include "sse.md")
 (include "sync.md")