diff options
| author | Dale Johannesen <dalej@apple.com> | 2009-03-23 21:16:53 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2009-03-23 21:16:53 +0000 |
| commit | 93eefa004308c8b3e1202cc3f9342526a3a378bd (patch) | |
| tree | cda2caf113edd506150c199d404f1be45195d048 /llvm/lib/Support | |
| parent | 2441a7df96359e47f70814729f64c3bff664492f (diff) | |
| download | bcm5719-llvm-93eefa004308c8b3e1202cc3f9342526a3a378bd.tar.gz bcm5719-llvm-93eefa004308c8b3e1202cc3f9342526a3a378bd.zip | |
Fix internal representation of fp80 to be the
same as a normal i80 {low64, high16} rather
than its own {high64, low16}. A depressing number
of places know about this; I think I got them all.
Bitcode readers and writers convert back to the old
form to avoid breaking compatibility.
llvm-svn: 67562
Diffstat (limited to 'llvm/lib/Support')
| -rw-r--r-- | llvm/lib/Support/APFloat.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index d7f0d821598..2ee6a276fdf 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -2603,10 +2603,9 @@ APFloat::convertF80LongDoubleAPFloatToAPInt() const } uint64_t words[2]; - words[0] = ((uint64_t)(sign & 1) << 63) | - ((myexponent & 0x7fffLL) << 48) | - ((mysignificand >>16) & 0xffffffffffffLL); - words[1] = mysignificand & 0xffff; + words[0] = mysignificand; + words[1] = ((uint64_t)(sign & 1) << 15) | + (myexponent & 0x7fffLL); return APInt(80, 2, words); } @@ -2764,14 +2763,13 @@ APFloat::initFromF80LongDoubleAPInt(const APInt &api) assert(api.getBitWidth()==80); uint64_t i1 = api.getRawData()[0]; uint64_t i2 = api.getRawData()[1]; - uint64_t myexponent = (i1 >> 48) & 0x7fff; - uint64_t mysignificand = ((i1 << 16) & 0xffffffffffff0000ULL) | - (i2 & 0xffff); + uint64_t myexponent = (i2 & 0x7fff); + uint64_t mysignificand = i1; initialize(&APFloat::x87DoubleExtended); assert(partCount()==2); - sign = static_cast<unsigned int>(i1>>63); + sign = static_cast<unsigned int>(i2>>15); if (myexponent==0 && mysignificand==0) { // exponent, significand meaningless category = fcZero; |

