Fix longdouble -> uint conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42143 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen 2007-09-19 17:53:26 +00:00
parent 6693da003b
commit f4d4832724

View File

@ -3211,8 +3211,9 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
SDOperand True, False; SDOperand True, False;
MVT::ValueType VT = Node->getOperand(0).getValueType(); MVT::ValueType VT = Node->getOperand(0).getValueType();
MVT::ValueType NVT = Node->getValueType(0); MVT::ValueType NVT = Node->getValueType(0);
unsigned ShiftAmt = MVT::getSizeInBits(Node->getValueType(0))-1; unsigned ShiftAmt = MVT::getSizeInBits(NVT)-1;
Tmp2 = DAG.getConstantFP((double)(1ULL << ShiftAmt), VT); Tmp2 = DAG.getConstantFP(APFloat(APInt(MVT::getSizeInBits(VT),
1ULL << ShiftAmt)), VT);
Tmp3 = DAG.getSetCC(TLI.getSetCCResultTy(), Tmp3 = DAG.getSetCC(TLI.getSetCCResultTy(),
Node->getOperand(0), Tmp2, ISD::SETLT); Node->getOperand(0), Tmp2, ISD::SETLT);
True = DAG.getNode(ISD::FP_TO_SINT, NVT, Node->getOperand(0)); True = DAG.getNode(ISD::FP_TO_SINT, NVT, Node->getOperand(0));