diff options
author | Dale Johannesen <dalej@apple.com> | 2008-10-09 23:00:39 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-10-09 23:00:39 +0000 |
commit | 6e547b4aeea29737f4aecad5b2cdaccb86989c20 (patch) | |
tree | 90d6731fd446c04df49383b8a23da0461337ba09 /lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 49cc7cec5d3bb722e7bad032233e6d763fba494f (diff) | |
download | external_llvm-6e547b4aeea29737f4aecad5b2cdaccb86989c20.zip external_llvm-6e547b4aeea29737f4aecad5b2cdaccb86989c20.tar.gz external_llvm-6e547b4aeea29737f4aecad5b2cdaccb86989c20.tar.bz2 |
Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger. Restore return value to
IEEE754. Adjust all users accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57329 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index f9cfeb1..77e9bda 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -93,8 +93,10 @@ unsigned FastISel::getRegForValue(Value *V) { uint64_t x[2]; uint32_t IntBitWidth = IntVT.getSizeInBits(); - if (!Flt.convertToInteger(x, IntBitWidth, /*isSigned=*/true, - APFloat::rmTowardZero) != APFloat::opOK) { + bool isExact; + (void) Flt.convertToInteger(x, IntBitWidth, /*isSigned=*/true, + APFloat::rmTowardZero, &isExact); + if (isExact) { APInt IntVal(IntBitWidth, 2, x); unsigned IntegerReg = getRegForValue(ConstantInt::get(IntVal)); @@ -711,8 +713,10 @@ unsigned FastISel::FastEmit_rf_(MVT::SimpleValueType VT, ISD::NodeType Opcode, uint64_t x[2]; uint32_t IntBitWidth = IntVT.getSizeInBits(); - if (Flt.convertToInteger(x, IntBitWidth, /*isSigned=*/true, - APFloat::rmTowardZero) != APFloat::opOK) + bool isExact; + (void) Flt.convertToInteger(x, IntBitWidth, /*isSigned=*/true, + APFloat::rmTowardZero, &isExact); + if (!isExact) return 0; APInt IntVal(IntBitWidth, 2, x); |