diff options
| author | Bill Wendling <isanbard@gmail.com> | 2009-03-13 08:41:47 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2009-03-13 08:41:47 +0000 |
| commit | 798fd56d0f893f99dba97d62b3a1d90bac7ef36c (patch) | |
| tree | 12a1f6fa73a30984ab531602d005f43f1566b4b0 /llvm/lib | |
| parent | afc74e2326b94cc536bc0dbe887556f266ba16ff (diff) | |
| download | bcm5719-llvm-798fd56d0f893f99dba97d62b3a1d90bac7ef36c.tar.gz bcm5719-llvm-798fd56d0f893f99dba97d62b3a1d90bac7ef36c.zip | |
These instructions have special lowering that may lower them to SSE
instructions. Prevent that if we don't want implicit uses of SSE.
llvm-svn: 66877
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index d10e4bb345f..89228261659 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -113,31 +113,38 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM) setOperationAction(ISD::UINT_TO_FP , MVT::i16 , Promote); if (Subtarget->is64Bit()) { - setOperationAction(ISD::UINT_TO_FP , MVT::i64 , Expand); setOperationAction(ISD::UINT_TO_FP , MVT::i32 , Promote); + setOperationAction(ISD::UINT_TO_FP , MVT::i64 , Expand); } else { - if (X86ScalarSSEf64) { + if (!UseSoftFloat && !NoImplicitFloat && X86ScalarSSEf64) { // We have an impenetrably clever algorithm for ui64->double only. setOperationAction(ISD::UINT_TO_FP , MVT::i64 , Custom); // We have faster algorithm for ui32->single only. setOperationAction(ISD::UINT_TO_FP , MVT::i32 , Custom); - } else + } 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. setOperationAction(ISD::SINT_TO_FP , MVT::i1 , Promote); setOperationAction(ISD::SINT_TO_FP , MVT::i8 , Promote); - // SSE has no i16 to fp conversion, only i32 - if (X86ScalarSSEf32) { - setOperationAction(ISD::SINT_TO_FP , MVT::i16 , Promote); - // f32 and f64 cases are Legal, f80 case is not - setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Custom); + + if (!UseSoftFloat && !NoImplicitFloat) { + // SSE has no i16 to fp conversion, only i32 + if (X86ScalarSSEf32) { + setOperationAction(ISD::SINT_TO_FP , MVT::i16 , Promote); + // f32 and f64 cases are Legal, f80 case is not + setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Custom); + } else { + setOperationAction(ISD::SINT_TO_FP , MVT::i16 , Custom); + setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Custom); + } } else { - setOperationAction(ISD::SINT_TO_FP , MVT::i16 , Custom); - setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Custom); + setOperationAction(ISD::SINT_TO_FP , MVT::i16 , Promote); + setOperationAction(ISD::SINT_TO_FP , MVT::i32 , Promote); } // In 32-bit mode these are custom lowered. In 64-bit mode F32 and F64 @@ -4975,8 +4982,8 @@ SDValue X86TargetLowering::LowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG) { int SSFI = MF.getFrameInfo()->CreateStackObject(Size, Size); SDValue StackSlot = DAG.getFrameIndex(SSFI, getPointerTy()); SDValue Chain = DAG.getStore(DAG.getEntryNode(), dl, Op.getOperand(0), - StackSlot, - PseudoSourceValue::getFixedStack(SSFI), 0); + StackSlot, + PseudoSourceValue::getFixedStack(SSFI), 0); // Build the FILD SDVTList Tys; |

