From 4230512f32759410b2fcf8bef1037d6c3b4ecad6 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Fri, 21 Sep 2007 22:09:37 +0000 Subject: Change APFloat::convertFromInteger to take the incoming bit width instead of number of words allocated, which makes it actually work for int->APF conversions. Adjust callers. Add const to one of the APInt constructors to prevent surprising match when called with const argument. llvm-svn: 42210 --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 34fca4d6239..340125e761c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3215,7 +3215,8 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { const uint64_t zero[] = {0, 0}; APFloat apf = APFloat(APInt(MVT::getSizeInBits(VT), 2, zero)); uint64_t x = 1ULL << ShiftAmt; - (void)apf.convertFromInteger(&x, 1, false, APFloat::rmTowardZero); + (void)apf.convertFromInteger(&x, MVT::getSizeInBits(NVT), false, + APFloat::rmTowardZero); Tmp2 = DAG.getConstantFP(apf, VT); Tmp3 = DAG.getSetCC(TLI.getSetCCResultTy(), Node->getOperand(0), Tmp2, ISD::SETLT); -- cgit v1.2.3