mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 07:39:31 +00:00
Handle more cases in APInt::getLowBitsSet's fast path.
llvm-svn: 145249
This commit is contained in:
parent
d576ee9a81
commit
a41c3f4eff
@ -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