mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
[APInt] Rewrite getLoBits in a way that will do one less memory allocation in the multiword case. Rewrite getHiBits to use the class method version of lshr instead of the one in APIntOps. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299243 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -724,13 +724,14 @@ bool APInt::isSplat(unsigned SplatSizeInBits) const {
|
||||
|
||||
/// This function returns the high "numBits" bits of this APInt.
|
||||
APInt APInt::getHiBits(unsigned numBits) const {
|
||||
return APIntOps::lshr(*this, BitWidth - numBits);
|
||||
return this->lshr(BitWidth - numBits);
|
||||
}
|
||||
|
||||
/// This function returns the low "numBits" bits of this APInt.
|
||||
APInt APInt::getLoBits(unsigned numBits) const {
|
||||
return APIntOps::lshr(APIntOps::shl(*this, BitWidth - numBits),
|
||||
BitWidth - numBits);
|
||||
APInt Result(getLowBitsSet(BitWidth, numBits));
|
||||
Result &= *this;
|
||||
return Result;
|
||||
}
|
||||
|
||||
unsigned APInt::countLeadingZerosSlowCase() const {
|
||||
|
||||
Reference in New Issue
Block a user