No functional changes.

2015-07-18  Uros Bizjak  <ubiz...@gmail.com>

    * config/i386/i386.md (pushsf splitter): Pass curr_insn to
    find_constant_src.  FAIL if find_constant_src returns NULL_RTX.
    (mem->fpreg splitters): Ditto.
    (general_operand->nonimmediate_operand splitter): Use explicit modes.
    Disable DFmode for TARGET_64BIT.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Committed to mainline SVN.

Uros.
Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md (revision 225919)
+++ config/i386/i386.md (working copy)
@@ -2987,10 +2987,15 @@
 (define_split
   [(set (match_operand:SF 0 "push_operand")
        (match_operand:SF 1 "memory_operand"))]
-  "reload_completed
-   && (operands[2] = find_constant_src (insn))"
-  [(set (match_dup 0) (match_dup 2))])
+  "reload_completed"
+  [(set (match_dup 0) (match_dup 2))]
+{
+  operands[2] = find_constant_src (curr_insn);
 
+  if (operands[2] == NULL_RTX)
+    FAIL;
+})
+
 (define_split
   [(set (match_operand 0 "push_operand")
        (match_operand 1 "general_operand"))]
@@ -3083,6 +3088,14 @@
               ]
               (const_string "TI")))])
 
+(define_split
+  [(set (match_operand:TF 0 "nonimmediate_operand")
+        (match_operand:TF 1 "general_operand"))]
+  "reload_completed
+   && !(ANY_FP_REG_P (operands[0]) || ANY_FP_REG_P (operands[1]))"
+  [(const_int 0)]
+  "ix86_split_long_move (operands); DONE;")
+
 ;; Possible store forwarding (partial memory) stall
 ;; in alternatives 4, 6, 7 and 8.
 (define_insn "*movxf_internal"
@@ -3149,6 +3162,14 @@
           ]
           (const_string "*")))])
    
+(define_split
+  [(set (match_operand:XF 0 "nonimmediate_operand")
+        (match_operand:XF 1 "general_operand"))]
+  "reload_completed
+   && !(ANY_FP_REG_P (operands[0]) || ANY_FP_REG_P (operands[1]))"
+  [(const_int 0)]
+  "ix86_split_long_move (operands); DONE;")
+
 ;; Possible store forwarding (partial memory) stall in alternatives 4, 6 and 7.
 (define_insn "*movdf_internal"
   [(set (match_operand:DF 0 "nonimmediate_operand"
@@ -3344,6 +3365,14 @@
           ]
           (const_string "*")))])
 
+(define_split
+  [(set (match_operand:DF 0 "nonimmediate_operand")
+        (match_operand:DF 1 "general_operand"))]
+  "!TARGET_64BIT && reload_completed
+   && !(ANY_FP_REG_P (operands[0]) || ANY_FP_REG_P (operands[1]))"
+  [(const_int 0)]
+  "ix86_split_long_move (operands); DONE;")
+
 (define_insn "*movsf_internal"
   [(set (match_operand:SF 0 "nonimmediate_operand"
          "=Yf*f,m   ,Yf*f,?r ,?m,v,v,v,m,?r,?Yi,!*y,!*y,!m,!r ,!*Ym,r  ,m")
@@ -3487,15 +3516,16 @@
    && (GET_MODE (operands[0]) == TFmode
        || GET_MODE (operands[0]) == XFmode
        || GET_MODE (operands[0]) == DFmode
-       || GET_MODE (operands[0]) == SFmode)
-   && (operands[2] = find_constant_src (insn))"
+       || GET_MODE (operands[0]) == SFmode)"
   [(set (match_dup 0) (match_dup 2))]
 {
-  rtx c = operands[2];
-  int r = REGNO (operands[0]);
+  operands[2] = find_constant_src (curr_insn);
 
-  if ((SSE_REGNO_P (r) && !standard_sse_constant_p (c))
-      || (STACK_REGNO_P (r) && standard_80387_constant_p (c) < 1))
+  if (operands[2] == NULL_RTX
+      || (SSE_REGNO_P (REGNO (operands[0]))
+         && !standard_sse_constant_p (operands[2]))
+      || (STACK_REGNO_P (REGNO (operands[0]))
+          && standard_80387_constant_p (operands[2]) < 1))
     FAIL;
 })
 
@@ -3505,15 +3535,16 @@
   "reload_completed
    && (GET_MODE (operands[0]) == TFmode
        || GET_MODE (operands[0]) == XFmode
-       || GET_MODE (operands[0]) == DFmode)
-   && (operands[2] = find_constant_src (insn))"
+       || GET_MODE (operands[0]) == DFmode)"
   [(set (match_dup 0) (match_dup 2))]
 {
-  rtx c = operands[2];
-  int r = REGNO (operands[0]);
+  operands[2] = find_constant_src (curr_insn);
 
-  if ((SSE_REGNO_P (r) && !standard_sse_constant_p (c))
-      || (STACK_REGNO_P (r) && standard_80387_constant_p (c) < 1))
+  if (operands[2] == NULL_RTX
+      || (SSE_REGNO_P (REGNO (operands[0]))
+         && !standard_sse_constant_p (operands[2]))
+      || (STACK_REGNO_P (REGNO (operands[0]))
+          && standard_80387_constant_p (operands[2]) < 1))
     FAIL;
 })
 
@@ -3537,17 +3568,6 @@
     operands[1] = CONST1_RTX (<MODE>mode);
 })
 
-(define_split
-  [(set (match_operand 0 "nonimmediate_operand")
-        (match_operand 1 "general_operand"))]
-  "reload_completed
-   && (GET_MODE (operands[0]) == TFmode
-       || GET_MODE (operands[0]) == XFmode
-       || GET_MODE (operands[0]) == DFmode)
-   && !(ANY_FP_REG_P (operands[0]) || ANY_FP_REG_P (operands[1]))"
-  [(const_int 0)]
-  "ix86_split_long_move (operands); DONE;")
-
 (define_insn "swapxf"
   [(set (match_operand:XF 0 "register_operand" "+f")
        (match_operand:XF 1 "register_operand" "+f"))

Reply via email to