mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-19 00:20:25 +00:00
Remove some DAG combiner assumptions about sizes
of integer types. Fix the isMask APInt method to actually work (hopefully) rather than crashing because it adds apints of different bitwidths. It looks like isShiftedMask is also broken, but I'm leaving that one to the APInt people (it is not used anywhere). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52142 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -130,7 +130,7 @@ class APInt {
|
||||
// the word size (64).
|
||||
return *this;
|
||||
|
||||
// Mask out the hight bits.
|
||||
// Mask out the high bits.
|
||||
uint64_t mask = ~uint64_t(0ULL) >> (APINT_BITS_PER_WORD - wordBits);
|
||||
if (isSingleWord())
|
||||
VAL &= mask;
|
||||
@@ -1280,7 +1280,8 @@ inline bool isSignedIntN(uint32_t N, const APInt& APIVal) {
|
||||
/// @returns true if the argument APInt value is a sequence of ones
|
||||
/// starting at the least significant bit with the remainder zero.
|
||||
inline bool isMask(uint32_t numBits, const APInt& APIVal) {
|
||||
return APIVal.getBoolValue() && ((APIVal + APInt(numBits,1)) & APIVal) == 0;
|
||||
return numBits <= APIVal.getBitWidth() &&
|
||||
APIVal == APInt::getLowBitsSet(APIVal.getBitWidth(), numBits);
|
||||
}
|
||||
|
||||
/// @returns true if the argument APInt value contains a sequence of ones
|
||||
|
Reference in New Issue
Block a user