* i386.md (floathi*): Deal with SSE.
authorJan Hubicka <jh@suse.cz>
Sun, 9 Feb 2003 22:59:20 +0000 (23:59 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 9 Feb 2003 22:59:20 +0000 (22:59 +0000)
From-SVN: r62611

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

index e7449de84be0f1d964492f9914f2aee1dac91983..6ef5c8464cd378ff79ee18443e7c2b10740cb2e4 100644 (file)
@@ -1,3 +1,7 @@
+Sun Feb  9 23:58:33 CET 2003  Jan Hubicka  <jh@suse.cz>
+
+       * i386.md (floathi*): Deal with SSE.
+
 Sun Feb  9 23:54:59 CET 2003  Jan Hubicka  <jh@suse.cz>
 
        * simplify-rtx.c (simplify_unary_operation,
index 97c6d9e6a75b857f68c7dfbc928944ac4b6af3ef..a751513bd274362b638819f8ae8559edbded04be 100644 (file)
 ;; Even though we only accept memory inputs, the backend _really_
 ;; wants to be able to do this between registers.
 
-(define_insn "floathisf2"
+(define_expand "floathisf2"
+  [(set (match_operand:SF 0 "register_operand" "")
+       (float:SF (match_operand:HI 1 "nonimmediate_operand" "")))]
+  "TARGET_SSE || TARGET_80387"
+{
+  if (TARGET_SSE && TARGET_SSE_MATH)
+    {
+      emit_insn (gen_floatsisf2 (operands[0],
+                                convert_to_mode (SImode, operands[1], 0)));
+      DONE;
+    }
+})
+
+(define_insn "*floathisf2_1"
   [(set (match_operand:SF 0 "register_operand" "=f,f")
        (float:SF (match_operand:HI 1 "nonimmediate_operand" "m,r")))]
-  "TARGET_80387 && !TARGET_SSE"
+  "TARGET_80387 && (!TARGET_SSE || !TARGET_SSE_MATH)"
   "@
    fild%z1\t%1
    #"
   DONE;
 })
 
-(define_insn "floathidf2"
+(define_expand "floathidf2"
+  [(set (match_operand:DF 0 "register_operand" "")
+       (float:DF (match_operand:HI 1 "nonimmediate_operand" "")))]
+  "TARGET_SSE2 || TARGET_80387"
+{
+  if (TARGET_SSE && TARGET_SSE_MATH)
+    {
+      emit_insn (gen_floatsidf2 (operands[0],
+                                convert_to_mode (SImode, operands[1], 0)));
+      DONE;
+    }
+})
+
+(define_insn "*floathidf2_1"
   [(set (match_operand:DF 0 "register_operand" "=f,f")
        (float:DF (match_operand:HI 1 "nonimmediate_operand" "m,r")))]
-  "TARGET_80387 && !TARGET_SSE2"
+  "TARGET_80387 && (!TARGET_SSE2 || !TARGET_SSE_MATH)"
   "@
    fild%z1\t%1
    #"