mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
6805724: ModLNode::Ideal() generates functionally incorrect graph when divisor is any (2^k-1) constant
C2, ModLNode::Ideal() generates functionally incorrect graph when divisor is any (2^k-1) constant. Reviewed-by: rasbold
This commit is contained in:
parent
a2ed00b650
commit
dd25f39709
3 changed files with 89 additions and 1 deletions
|
@ -907,6 +907,14 @@ inline int exact_log2(intptr_t x) {
|
|||
return log2_intptr(x);
|
||||
}
|
||||
|
||||
//* the argument must be exactly a power of 2
|
||||
inline int exact_log2_long(jlong x) {
|
||||
#ifdef ASSERT
|
||||
if (!is_power_of_2_long(x)) basic_fatal("x must be a power of 2");
|
||||
#endif
|
||||
return log2_long(x);
|
||||
}
|
||||
|
||||
|
||||
// returns integer round-up to the nearest multiple of s (s must be a power of two)
|
||||
inline intptr_t round_to(intptr_t x, uintx s) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue