i386.md (extend?f?f): Split to expander and pattern, refuse two memory operands in...
authorJan Hubicka <hubicka@freesoft.cz>
Fri, 19 Nov 1999 20:27:08 +0000 (21:27 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 19 Nov 1999 20:27:08 +0000 (20:27 +0000)
* i386.md (extend?f?f): Split to expander and pattern, refuse two
memory operands in patterns.
(fop*): Refuse two memory operands.

From-SVN: r30593

gcc/ChangeLog
gcc/config/i386/i386.md

index 53d964e1bf8e88c4356329249125fef1e1a1d3e0..663be335a8412559221f67365d3f96c681a4dd82 100644 (file)
@@ -1,5 +1,9 @@
 Fri Nov 19 06:32:19 CET 1999  Jan Hubicka  <hubicka@freesoft.cz>
 
+       * i386.md (extend?f?f): Split to expander and pattern, refuse two
+       memory operands in patterns.
+       (fop*): Refuse two memory operands.
+
        * i386.md (ashrsi3_31): Allow cltd when optimizing for size even
        on !TARGET_USE_CLTD CPUs.
 
index b5f3ee5cfae53655aad5dff2e4eb37c811307d5f..8567cd54ed2a9a0e00fa5ffd16e8733f9a4c7e18 100644 (file)
   [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -12)))
    (set (mem:DF (reg:SI 7)) (float_extend:XF (match_dup 1)))])
 
-(define_insn "extendsfdf2"
+(define_expand "extendsfdf2"
+  [(set (match_operand:DF 0 "nonimmediate_operand" "")
+        (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
+  "TARGET_80387"
+  "
+{
+  if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
+    operands[0] = force_reg (DFmode, operands[0]);
+}")
+
+(define_insn "*extendsfdf2_1"
   [(set (match_operand:DF 0 "nonimmediate_operand" "=f,m")
         (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fm,f")))]
-  "TARGET_80387"
+  "TARGET_80387
+   && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
   "*
 {
   switch (which_alternative)
 }"
   [(set_attr "type" "fmov")])
 
-(define_insn "extendsfxf2"
+(define_expand "extendsfxf2"
+  [(set (match_operand:XF 0 "nonimmediate_operand" "")
+        (float_extend:XF (match_operand:SF 1 "nonimmediate_operand" "")))]
+  "TARGET_80387"
+  "
+{
+  if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
+    operands[0] = force_reg (XFmode, operands[0]);
+}")
+
+(define_insn "*extendsfxf2_1"
   [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m")
         (float_extend:XF (match_operand:SF 1 "nonimmediate_operand" "fm,f")))]
-  "TARGET_80387"
+  "TARGET_80387
+   && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
   "*
 {
   switch (which_alternative)
 }"
   [(set_attr "type" "fmov")])
 
-(define_insn "extenddfxf2"
+(define_expand "extenddfxf2"
+  [(set (match_operand:XF 0 "nonimmediate_operand" "")
+        (float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "")))]
+  "TARGET_80387"
+  "
+{
+  if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
+    operands[0] = force_reg (XFmode, operands[0]);
+}")
+
+(define_insn "*extenddfxf2_1"
   [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m")
         (float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "fm,f")))]
-  "TARGET_80387"
+  "TARGET_80387
+   && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
   "*
 {
   switch (which_alternative)
        (match_operator:SF 3 "binary_fp_operator"
                        [(match_operand:SF 1 "nonimmediate_operand" "0,fm")
                         (match_operand:SF 2 "nonimmediate_operand" "fm,0")]))]
-  "TARGET_80387"
+  "TARGET_80387
+   && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
         (cond [(match_operand:SF 3 "mult_operator" "") 
        (match_operator:DF 3 "binary_fp_operator"
                        [(match_operand:DF 1 "nonimmediate_operand" "0,fm")
                         (match_operand:DF 2 "nonimmediate_operand" "fm,0")]))]
-  "TARGET_80387"
+  "TARGET_80387
+   && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
         (cond [(match_operand:DF 3 "mult_operator" "") 
        (match_operator:DF 3 "binary_fp_operator"
           [(float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fm,0"))
            (match_operand:DF 2 "register_operand" "0,f")]))]
-  "TARGET_80387"
+  "TARGET_80387
+   && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
   "* return output_387_binary_op (insn, operands);"
   [(set (attr "type") 
         (cond [(match_operand:DF 3 "mult_operator" "")