diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-11 19:32:35 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-11 19:32:35 +0000 |
commit | 38d2ff4ac0133c138f7d372f0ea6d2c4e1f24c4f (patch) | |
tree | f28a23e469c89be1f58b42d6d2136e54939cd95c /lib/Support | |
parent | 57a76605f0e7989787cfaddd9be546ab5ab28044 (diff) | |
download | external_llvm-38d2ff4ac0133c138f7d372f0ea6d2c4e1f24c4f.zip external_llvm-38d2ff4ac0133c138f7d372f0ea6d2c4e1f24c4f.tar.gz external_llvm-38d2ff4ac0133c138f7d372f0ea6d2c4e1f24c4f.tar.bz2 |
Replace a hand-coded leading one counting loop with the magic from MathExtras.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/APInt.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index 031bbb8..a60bff3 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -723,14 +723,7 @@ unsigned APInt::countLeadingZerosSlowCase() const { } static unsigned countLeadingOnes_64(uint64_t V, unsigned skip) { - unsigned Count = 0; - if (skip) - V <<= skip; - while (V && (V & (1ULL << 63))) { - Count++; - V <<= 1; - } - return Count; + return CountLeadingOnes_64(V << skip); } unsigned APInt::countLeadingOnes() const { |