diff options
author | Dale Johannesen <dalej@apple.com> | 2007-09-19 23:55:34 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-09-19 23:55:34 +0000 |
commit | 7d67e547b5e9342309885582e2e25e393fb80d8c (patch) | |
tree | b7d7ac595164fd8aa6cc2401c99de4930cbc2147 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | d0e360e16e4651eea3247d57e41aab0d5c93b0b6 (diff) | |
download | bcm5719-llvm-7d67e547b5e9342309885582e2e25e393fb80d8c.tar.gz bcm5719-llvm-7d67e547b5e9342309885582e2e25e393fb80d8c.zip |
More long double fixes. x86_64 should build now.
llvm-svn: 42155
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 3744c4ad663..92c0f2445bc 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1591,8 +1591,14 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, case ISD::ANY_EXTEND: case ISD::ZERO_EXTEND: return getConstant(Val, VT); case ISD::TRUNCATE: return getConstant(Val, VT); - case ISD::SINT_TO_FP: return getConstantFP(C->getSignExtended(), VT); - case ISD::UINT_TO_FP: return getConstantFP(C->getValue(), VT); + case ISD::UINT_TO_FP: + 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); + return getConstantFP(apf, VT); + } case ISD::BIT_CONVERT: if (VT == MVT::f32 && C->getValueType(0) == MVT::i32) return getConstantFP(BitsToFloat(Val), VT); @@ -1669,8 +1675,12 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, case ISD::FP_EXTEND: // This can return overflow, underflow, or inexact; we don't care. // FIXME need to be more flexible about rounding mode. + // FIXME need to be more flexible about rounding mode. (void) V.convert(VT==MVT::f32 ? APFloat::IEEEsingle : - APFloat::IEEEdouble, + VT==MVT::f64 ? APFloat::IEEEdouble : + VT==MVT::f80 ? APFloat::x87DoubleExtended : + VT==MVT::f128 ? APFloat::IEEEquad : + APFloat::Bogus, APFloat::rmNearestTiesToEven); return getConstantFP(V, VT); case ISD::FP_TO_SINT: |