Correct the calculation in APInt::logBase2().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34929 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zhou Sheng 2007-03-05 16:42:58 +00:00
parent ef476fdce2
commit 3130835bdf

View File

@ -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.