mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 00:11:00 +00:00
Handle more cases in APInt::getLowBitsSet's fast path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145249 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
64acc57b23
commit
39a2eb7dea
@ -497,8 +497,8 @@ public:
|
||||
if (loBitsSet == APINT_BITS_PER_WORD)
|
||||
return APInt(numBits, -1ULL);
|
||||
// For small values, return quickly.
|
||||
if (numBits < APINT_BITS_PER_WORD)
|
||||
return APInt(numBits, (1ULL << loBitsSet) - 1);
|
||||
if (loBitsSet <= APINT_BITS_PER_WORD)
|
||||
return APInt(numBits, -1ULL >> (APINT_BITS_PER_WORD - loBitsSet));
|
||||
return getAllOnesValue(numBits).lshr(numBits - loBitsSet);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user