diff options
author | Dale Johannesen <dalej@apple.com> | 2007-09-19 17:53:26 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-09-19 17:53:26 +0000 |
commit | f4d4832724eb45f94d63e6a7ab932b8f77279587 (patch) | |
tree | 6e63cc7d95d7c3b6c4e27bbcbdcf375c74b2560f | |
parent | 6693da003b826b5a5755fb3d97941d52f36cbb5d (diff) |
Fix longdouble -> uint conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42143 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index c4290c8aa5..10a5f212e0 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3211,8 +3211,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { SDOperand True, False; MVT::ValueType VT = Node->getOperand(0).getValueType(); MVT::ValueType NVT = Node->getValueType(0); - unsigned ShiftAmt = MVT::getSizeInBits(Node->getValueType(0))-1; - Tmp2 = DAG.getConstantFP((double)(1ULL << ShiftAmt), VT); + unsigned ShiftAmt = MVT::getSizeInBits(NVT)-1; + Tmp2 = DAG.getConstantFP(APFloat(APInt(MVT::getSizeInBits(VT), + 1ULL << ShiftAmt)), VT); Tmp3 = DAG.getSetCC(TLI.getSetCCResultTy(), Node->getOperand(0), Tmp2, ISD::SETLT); True = DAG.getNode(ISD::FP_TO_SINT, NVT, Node->getOperand(0)); |