aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhou Sheng <zhousheng00@gmail.com>2007-03-05 16:42:58 +0000
committerZhou Sheng <zhousheng00@gmail.com>2007-03-05 16:42:58 +0000
commit3130835bdf4e965309fa3cbed1bfc976a04324f8 (patch)
treea0e7901c3cb016ae8e8e4c033af2510edfcd4adf
parentef476fdce2d194b5b335c15cd8a545ceeeb633b1 (diff)
downloadexternal_llvm-3130835bdf4e965309fa3cbed1bfc976a04324f8.zip
external_llvm-3130835bdf4e965309fa3cbed1bfc976a04324f8.tar.gz
external_llvm-3130835bdf4e965309fa3cbed1bfc976a04324f8.tar.bz2
Correct the calculation in APInt::logBase2().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34929 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/APInt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index d7a604c..80221f2 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -697,7 +697,7 @@ public:
/// @returns the floor log base 2 of this APInt.
inline uint32_t logBase2() const {
- return getNumWords() * APINT_BITS_PER_WORD - 1 - countLeadingZeros();
+ return BitWidth - 1 - countLeadingZeros();
}
/// @brief Converts this APInt to a double value.