Fix two bugs in 104348:
authorDale Johannesen <dalej@apple.com>
Fri, 21 May 2010 18:40:15 +0000 (18:40 +0000)
committerDale Johannesen <dalej@apple.com>
Fri, 21 May 2010 18:40:15 +0000 (18:40 +0000)
Case where MMX is disabled wasn't handled right.
MMX->MMX bitconverts are Legal.

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

lib/Target/X86/X86ISelLowering.cpp

index 78144abe807c4aa63e4c437e1be3e2a8e709bcf1..7095b3efd7c05a2cda79e08875c814d49e83b07e 100644 (file)
@@ -217,10 +217,13 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
   if (!X86ScalarSSEf64) {
     setOperationAction(ISD::BIT_CONVERT      , MVT::f32  , Expand);
     setOperationAction(ISD::BIT_CONVERT      , MVT::i32  , Expand);
-    if (Subtarget->is64Bit() && Subtarget->hasMMX() && !DisableMMX) {
-      // Without SSE, i64->f64 goes through memory; i64->MMX is legal.
-      setOperationAction(ISD::BIT_CONVERT    , MVT::i64  , Custom);
+    if (Subtarget->is64Bit()) {
       setOperationAction(ISD::BIT_CONVERT    , MVT::f64  , Expand);
+      // Without SSE, i64->f64 goes through memory; i64->MMX is Legal.
+      if (Subtarget->hasMMX() && !DisableMMX)
+        setOperationAction(ISD::BIT_CONVERT    , MVT::i64  , Custom);
+      else 
+        setOperationAction(ISD::BIT_CONVERT    , MVT::i64  , Expand);
     }
   }
 
@@ -7486,6 +7489,9 @@ SDValue X86TargetLowering::LowerBIT_CONVERT(SDValue Op,
     return Op;
   if (DstVT==MVT::i64 && SrcVT.isVector())
     return Op;
+  // MMX <=> MMX conversions are Legal.
+  if (SrcVT.isVector() && DstVT.isVector())
+    return Op;
   // All other conversions need to be expanded.
   return SDValue();
 }