mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-16 00:33:10 +00:00
add a getSignBit method, elimiante virtual method from getBitMask()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34916 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
82a60eca8f
commit
f298fd0428
@ -106,9 +106,15 @@ public:
|
|||||||
/// that can be set by an unsigned version of this type. This is 0xFF for
|
/// that can be set by an unsigned version of this type. This is 0xFF for
|
||||||
/// sbyte/ubyte, 0xFFFF for shorts, etc.
|
/// sbyte/ubyte, 0xFFFF for shorts, etc.
|
||||||
uint64_t getBitMask() const {
|
uint64_t getBitMask() const {
|
||||||
return ~uint64_t(0UL) >> (64-getPrimitiveSizeInBits());
|
return ~uint64_t(0UL) >> (64-getBitWidth());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getSignBit - Return a uint64_t with just the most significant bit set (the
|
||||||
|
/// sign bit, if the value is treated as a signed number).
|
||||||
|
uint64_t getSignBit() const {
|
||||||
|
return 1ULL << (getBitWidth()-1);
|
||||||
|
}
|
||||||
|
|
||||||
/// For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
|
/// For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
|
||||||
/// @returns a bit mask with ones set for all the bits of this type.
|
/// @returns a bit mask with ones set for all the bits of this type.
|
||||||
/// @brief Get a bit mask for this type.
|
/// @brief Get a bit mask for this type.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user