diff options
| author | Dale Johannesen <dalej@apple.com> | 2009-10-23 04:02:51 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2009-10-23 04:02:51 +0000 |
| commit | 29a9919606a4790d496a3db568883b080ec57ff1 (patch) | |
| tree | 994c22ecfb8740ea4e4333a48fe709849c945a11 /lib/Support | |
| parent | 1caa0c6a612427636a06109b999b254bda758b11 (diff) | |
| download | external_llvm-29a9919606a4790d496a3db568883b080ec57ff1.zip external_llvm-29a9919606a4790d496a3db568883b080ec57ff1.tar.gz external_llvm-29a9919606a4790d496a3db568883b080ec57ff1.tar.bz2 | |
Commit fixes for half precision I noted in review, so
they don't get lost; I don't think the originator has
write access.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
| -rw-r--r-- | lib/Support/APFloat.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index 361614a..7e42e2d 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -2830,11 +2830,11 @@ APFloat::convertHalfAPFloatToAPInt() const myexponent = 0; mysignificand = 0; } else if (category==fcInfinity) { - myexponent = 0xff; + myexponent = 0x1f; mysignificand = 0; } else { assert(category == fcNaN && "Unknown category!"); - myexponent = 0xff; + myexponent = 0x1f; mysignificand = (uint32_t)*significandParts(); } @@ -3089,7 +3089,7 @@ APFloat::initFromHalfAPInt(const APInt & api) { assert(api.getBitWidth()==16); uint32_t i = (uint32_t)*api.getRawData(); - uint32_t myexponent = (i >> 15) & 0x1f; + uint32_t myexponent = (i >> 10) & 0x1f; uint32_t mysignificand = i & 0x3ff; initialize(&APFloat::IEEEhalf); |
