mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
6603011: RFE: Optimize long division
Transform long division by constant into multiply Reviewed-by: never, kvn
This commit is contained in:
parent
bb7ccea4ff
commit
72313bcf20
7 changed files with 483 additions and 207 deletions
|
@ -890,7 +890,7 @@ inline int log2_long(jlong x) {
|
|||
i++; p *= 2;
|
||||
}
|
||||
// p = 2^(i+1) && x < p (i.e., 2^i <= x < 2^(i+1))
|
||||
// (if p = 0 then overflow occured and i = 31)
|
||||
// (if p = 0 then overflow occured and i = 63)
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue