projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ef476fd
)
Correct the calculation in APInt::logBase2().
author
Zhou Sheng
<zhousheng00@gmail.com>
Mon, 5 Mar 2007 16:42:58 +0000
(16:42 +0000)
committer
Zhou Sheng
<zhousheng00@gmail.com>
Mon, 5 Mar 2007 16:42:58 +0000
(16:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34929
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/APInt.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/APInt.h
b/include/llvm/ADT/APInt.h
index d7a604c41655112746537b5354ff7500a5d47a53..80221f2880a6039e49ef472700d689665f26947d 100644
(file)
--- 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.