Fix longdouble -> uint conversion.
authorDale Johannesen <dalej@apple.com>
Wed, 19 Sep 2007 17:53:26 +0000 (17:53 +0000)
committerDale Johannesen <dalej@apple.com>
Wed, 19 Sep 2007 17:53:26 +0000 (17:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42143 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index c4290c8aa502581bea0a7819964007f398f4b982..10a5f212e0230624507526c4479a10f3772b3d9a 100644 (file)
@@ -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));