diff options
author | John McCall <rjmccall@apple.com> | 2010-02-28 02:51:25 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-28 02:51:25 +0000 |
commit | dcb9a7ad3d2db5f6f4dd9d1632c78645656ff678 (patch) | |
tree | 7c4c61e7a7fdf82e76ac20e04481dbb5f6aeea21 /llvm/lib/Support/APInt.cpp | |
parent | abb1c7912ecdc61f04635ad46fce2f5a830d3670 (diff) | |
download | bcm5719-llvm-dcb9a7ad3d2db5f6f4dd9d1632c78645656ff678.tar.gz bcm5719-llvm-dcb9a7ad3d2db5f6f4dd9d1632c78645656ff678.zip |
Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-width
payloads. APFloat's internal folding routines always make QNaNs now,
instead of sometimes making QNaNs and sometimes SNaNs depending on the
type.
llvm-svn: 97364
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 3bce3f3ed3f..6a6384aa3f4 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -2344,13 +2344,21 @@ APInt::tcExtractBit(const integerPart *parts, unsigned int bit) & ((integerPart) 1 << bit % integerPartWidth)) != 0; } -/* Set the given bit of a bignum. */ +/* Set the given bit of a bignum. */ void APInt::tcSetBit(integerPart *parts, unsigned int bit) { parts[bit / integerPartWidth] |= (integerPart) 1 << (bit % integerPartWidth); } +/* Clears the given bit of a bignum. */ +void +APInt::tcClearBit(integerPart *parts, unsigned int bit) +{ + parts[bit / integerPartWidth] &= + ~((integerPart) 1 << (bit % integerPartWidth)); +} + /* Returns the bit number of the least significant set bit of a number. If the input number has no bits set -1U is returned. */ unsigned int |