diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-12 15:35:40 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-12 15:35:40 +0000 |
| commit | 5f6a9072882f97076910f94f3cc470a567c5bf20 (patch) | |
| tree | 67ea94598b8e81db6162e4cf1de15ef1012b391f /llvm/lib/Support/APInt.cpp | |
| parent | f1828ef3c6009fea5d88b3ca116e71cc90df6ff0 (diff) | |
| download | bcm5719-llvm-5f6a9072882f97076910f94f3cc470a567c5bf20.tar.gz bcm5719-llvm-5f6a9072882f97076910f94f3cc470a567c5bf20.zip | |
MathExtras: Bring Count(Trailing|Leading)Ones and CountPopulation in line with countTrailingZeros
Update all callers.
llvm-svn: 228930
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
| -rw-r--r-- | llvm/lib/Support/APInt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 0ddc2ab8af3..50a639cc51e 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -713,7 +713,7 @@ unsigned APInt::countLeadingZerosSlowCase() const { unsigned APInt::countLeadingOnes() const { if (isSingleWord()) - return CountLeadingOnes_64(VAL << (APINT_BITS_PER_WORD - BitWidth)); + return llvm::countLeadingOnes(VAL << (APINT_BITS_PER_WORD - BitWidth)); unsigned highWordBits = BitWidth % APINT_BITS_PER_WORD; unsigned shift; @@ -724,13 +724,13 @@ unsigned APInt::countLeadingOnes() const { shift = APINT_BITS_PER_WORD - highWordBits; } int i = getNumWords() - 1; - unsigned Count = CountLeadingOnes_64(pVal[i] << shift); + unsigned Count = llvm::countLeadingOnes(pVal[i] << shift); if (Count == highWordBits) { for (i--; i >= 0; --i) { if (pVal[i] == -1ULL) Count += APINT_BITS_PER_WORD; else { - Count += CountLeadingOnes_64(pVal[i]); + Count += llvm::countLeadingOnes(pVal[i]); break; } } @@ -756,14 +756,14 @@ unsigned APInt::countTrailingOnesSlowCase() const { for (; i < getNumWords() && pVal[i] == -1ULL; ++i) Count += APINT_BITS_PER_WORD; if (i < getNumWords()) - Count += CountTrailingOnes_64(pVal[i]); + Count += llvm::countTrailingOnes(pVal[i]); return std::min(Count, BitWidth); } unsigned APInt::countPopulationSlowCase() const { unsigned Count = 0; for (unsigned i = 0; i < getNumWords(); ++i) - Count += CountPopulation_64(pVal[i]); + Count += llvm::countPopulation(pVal[i]); return Count; } |

