mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Replace Count{Leading,Trailing}Zeros_{32,64} with count{Leading,Trailing}Zeros.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182680 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -692,14 +692,14 @@ unsigned APInt::countLeadingZerosSlowCase() const {
|
||||
unsigned i = getNumWords();
|
||||
integerPart MSW = pVal[i-1] & MSWMask;
|
||||
if (MSW)
|
||||
return CountLeadingZeros_64(MSW) - (APINT_BITS_PER_WORD - BitsInMSW);
|
||||
return llvm::countLeadingZeros(MSW) - (APINT_BITS_PER_WORD - BitsInMSW);
|
||||
|
||||
unsigned Count = BitsInMSW;
|
||||
for (--i; i > 0u; --i) {
|
||||
if (pVal[i-1] == 0)
|
||||
Count += APINT_BITS_PER_WORD;
|
||||
else {
|
||||
Count += CountLeadingZeros_64(pVal[i-1]);
|
||||
Count += llvm::countLeadingZeros(pVal[i-1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -735,13 +735,13 @@ unsigned APInt::countLeadingOnes() const {
|
||||
|
||||
unsigned APInt::countTrailingZeros() const {
|
||||
if (isSingleWord())
|
||||
return std::min(unsigned(CountTrailingZeros_64(VAL)), BitWidth);
|
||||
return std::min(unsigned(llvm::countTrailingZeros(VAL)), BitWidth);
|
||||
unsigned Count = 0;
|
||||
unsigned i = 0;
|
||||
for (; i < getNumWords() && pVal[i] == 0; ++i)
|
||||
Count += APINT_BITS_PER_WORD;
|
||||
if (i < getNumWords())
|
||||
Count += CountTrailingZeros_64(pVal[i]);
|
||||
Count += llvm::countTrailingZeros(pVal[i]);
|
||||
return std::min(Count, BitWidth);
|
||||
}
|
||||
|
||||
@@ -1512,7 +1512,7 @@ static void KnuthDiv(unsigned *u, unsigned *v, unsigned *q, unsigned* r,
|
||||
// and v so that its high bits are shifted to the top of v's range without
|
||||
// overflow. Note that this can require an extra word in u so that u must
|
||||
// be of length m+n+1.
|
||||
unsigned shift = CountLeadingZeros_32(v[n-1]);
|
||||
unsigned shift = countLeadingZeros(v[n-1]);
|
||||
unsigned v_carry = 0;
|
||||
unsigned u_carry = 0;
|
||||
if (shift) {
|
||||
|
Reference in New Issue
Block a user