Fix two bugs in 104348:

Case where MMX is disabled wasn't handled right.
MMX->MMX bitconverts are Legal.

llvm-svn: 104336
This commit is contained in:
Dale Johannesen 2010-05-21 18:40:15 +00:00
parent 3fe900e410
commit 6361e3e8a2
1 changed files with 9 additions and 3 deletions

View File

@ -217,10 +217,13 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
if (!X86ScalarSSEf64) { if (!X86ScalarSSEf64) {
setOperationAction(ISD::BIT_CONVERT , MVT::f32 , Expand); setOperationAction(ISD::BIT_CONVERT , MVT::f32 , Expand);
setOperationAction(ISD::BIT_CONVERT , MVT::i32 , Expand); setOperationAction(ISD::BIT_CONVERT , MVT::i32 , Expand);
if (Subtarget->is64Bit() && Subtarget->hasMMX() && !DisableMMX) { if (Subtarget->is64Bit()) {
// Without SSE, i64->f64 goes through memory; i64->MMX is legal.
setOperationAction(ISD::BIT_CONVERT , MVT::i64 , Custom);
setOperationAction(ISD::BIT_CONVERT , MVT::f64 , Expand); 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; return Op;
if (DstVT==MVT::i64 && SrcVT.isVector()) if (DstVT==MVT::i64 && SrcVT.isVector())
return Op; return Op;
// MMX <=> MMX conversions are Legal.
if (SrcVT.isVector() && DstVT.isVector())
return Op;
// All other conversions need to be expanded. // All other conversions need to be expanded.
return SDValue(); return SDValue();
} }