diff options
author | Dale Johannesen <dalej@apple.com> | 2007-09-21 22:09:37 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-09-21 22:09:37 +0000 |
commit | 910993e8dc49a25d9da3b53de4a82568c14e91cc (patch) | |
tree | 3dbc8815c0b1b48e3bdaf73a2b46004c3827bbcf /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
parent | 3f65f02d25b920c3cef4dd8a8fc8fc76cad1236e (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 34fca4d623..340125e761 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/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); |