Skip to content

Commit

Permalink
Commit fixes for half precision I noted in review, so
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Dale Johannesen committed Oct 23, 2009
1 parent 81dc786 commit a223aed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Support/APFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a223aed

Please sign in to comment.