SSE does not support i64 SINT_TO_FP (FP stack doesn't either, but we custom
authorEvan Cheng <evan.cheng@apple.com>
Tue, 17 Jan 2006 02:32:49 +0000 (02:32 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Tue, 17 Jan 2006 02:32:49 +0000 (02:32 +0000)
expand it), so ask legalizer to expand i32 UINT_TO_FP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25386 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index 153db5514ec2a8b92afdd1a83ca13c50efd2ea9e..5ed9691ebbcfb7c2aaa329b81af58dea29cc3587 100644 (file)
@@ -52,7 +52,12 @@ X86TargetLowering::X86TargetLowering(TargetMachine &TM)
   setOperationAction(ISD::UINT_TO_FP       , MVT::i1   , Promote);
   setOperationAction(ISD::UINT_TO_FP       , MVT::i8   , Promote);
   setOperationAction(ISD::UINT_TO_FP       , MVT::i16  , Promote);
-  setOperationAction(ISD::UINT_TO_FP       , MVT::i32  , Promote);
+
+  if (X86ScalarSSE)
+    // No SSE i64 SINT_TO_FP, so expand i32 UINT_TO_FP instead.
+    setOperationAction(ISD::UINT_TO_FP     , MVT::i32  , Expand);
+  else
+    setOperationAction(ISD::UINT_TO_FP     , MVT::i32  , Promote);
 
   // Promote i1/i8 SINT_TO_FP to larger SINT_TO_FP's, as X86 doesn't have
   // this operation.