mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-21 03:32:21 +00:00
Add long-overdue helpers for getting constants with known upper bits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23426 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5d735bf29b
commit
a58ef7b652
@ -55,6 +55,20 @@ public:
|
|||||||
///
|
///
|
||||||
inline uint64_t getRawValue() const { return Val.Unsigned; }
|
inline uint64_t getRawValue() const { return Val.Unsigned; }
|
||||||
|
|
||||||
|
/// getZExtValue - Return the constant zero extended as appropriate for this
|
||||||
|
/// type.
|
||||||
|
inline uint64_t getZExtValue() const {
|
||||||
|
unsigned Size = getType()->getPrimitiveSizeInBits();
|
||||||
|
return Val.Unsigned & (~0ULL >> (64-Size));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// getSExtValue - Return the constant sign extended as appropriate for this
|
||||||
|
/// type.
|
||||||
|
inline int64_t getSExtValue() const {
|
||||||
|
unsigned Size = getType()->getPrimitiveSizeInBits();
|
||||||
|
return (Val.Signed << (64-Size)) >> (64-Size);
|
||||||
|
}
|
||||||
|
|
||||||
/// isNullValue - Return true if this is the value that would be returned by
|
/// isNullValue - Return true if this is the value that would be returned by
|
||||||
/// getNullValue.
|
/// getNullValue.
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user