projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
636a02b
)
Optimize 96-bit division a little bit.
author
Jakub Staszak
<jstaszak@apple.com>
Wed, 27 Jul 2011 16:00:40 +0000
(16:00 +0000)
committer
Jakub Staszak
<jstaszak@apple.com>
Wed, 27 Jul 2011 16:00:40 +0000
(16:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136222
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/BlockFrequency.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/BlockFrequency.cpp
b/lib/Support/BlockFrequency.cpp
index 0bc784081042cb908711027a0a62e7c41734e4cf..a63bf83f20394344f003fcd37cca980f7e6d8ccc 100644
(file)
--- a/
lib/Support/BlockFrequency.cpp
+++ b/
lib/Support/BlockFrequency.cpp
@@
-46,8
+46,9
@@
void mult96bit(uint64_t freq, uint32_t N, uint64_t W[2]) {
uint64_t div96bit(uint64_t W[2], uint32_t D) {
uint64_t y = W[0];
uint64_t x = W[1];
+ int i;
- for (i
nt i = 1; i <= 64
; ++i) {
+ for (i
= 1; i <= 64 && x
; ++i) {
uint32_t t = (int)x >> 31;
x = (x << 1) | (y >> 63);
y = y << 1;
@@
-57,7
+58,7
@@
uint64_t div96bit(uint64_t W[2], uint32_t D) {
}
}
- return y;
+ return y
<< (64 - i + 1)
;
}
}