Mercurial > hg > truffle
diff src/share/vm/utilities/globalDefinitions.hpp @ 568:30663ca5e8f4
6805724: ModLNode::Ideal() generates functionally incorrect graph when divisor is any (2^k-1) constant.
Summary: C2, ModLNode::Ideal() generates functionally incorrect graph when divisor is any (2^k-1) constant.
Reviewed-by: rasbold
author | twisti |
---|---|
date | Mon, 16 Feb 2009 07:19:26 -0800 |
parents | 7628781568e1 |
children | dca06e7f503d |
line wrap: on
line diff
--- a/src/share/vm/utilities/globalDefinitions.hpp Fri Feb 13 09:09:35 2009 -0800 +++ b/src/share/vm/utilities/globalDefinitions.hpp Mon Feb 16 07:19:26 2009 -0800 @@ -907,6 +907,14 @@ 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) {