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 | 4230512f32759410b2fcf8bef1037d6c3b4ecad6 (patch) | |
| tree | 41a70987c8e1c8169b9b795b985a7e3665739e37 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
| parent | 361e52f39ca714f88f2509b21eede156f954bad0 (diff) | |
| download | bcm5719-llvm-4230512f32759410b2fcf8bef1037d6c3b4ecad6.tar.gz bcm5719-llvm-4230512f32759410b2fcf8bef1037d6c3b4ecad6.zip | |
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
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 92c0f2445bc..042868d7bb1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1595,8 +1595,10 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, case ISD::SINT_TO_FP: { const uint64_t zero[] = {0, 0}; APFloat apf = APFloat(APInt(MVT::getSizeInBits(VT), 2, zero)); - (void)apf.convertFromInteger(&Val, 1, Opcode==ISD::SINT_TO_FP, - APFloat::rmTowardZero); + (void)apf.convertFromInteger(&Val, + MVT::getSizeInBits(Operand.getValueType()), + Opcode==ISD::SINT_TO_FP, + APFloat::rmTowardZero); return getConstantFP(apf, VT); } case ISD::BIT_CONVERT: |

