Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
567:bbef4344adb2 | 568:30663ca5e8f4 |
---|---|
905 if (!is_power_of_2(x)) basic_fatal("x must be a power of 2"); | 905 if (!is_power_of_2(x)) basic_fatal("x must be a power of 2"); |
906 #endif | 906 #endif |
907 return log2_intptr(x); | 907 return log2_intptr(x); |
908 } | 908 } |
909 | 909 |
910 //* the argument must be exactly a power of 2 | |
911 inline int exact_log2_long(jlong x) { | |
912 #ifdef ASSERT | |
913 if (!is_power_of_2_long(x)) basic_fatal("x must be a power of 2"); | |
914 #endif | |
915 return log2_long(x); | |
916 } | |
917 | |
910 | 918 |
911 // returns integer round-up to the nearest multiple of s (s must be a power of two) | 919 // returns integer round-up to the nearest multiple of s (s must be a power of two) |
912 inline intptr_t round_to(intptr_t x, uintx s) { | 920 inline intptr_t round_to(intptr_t x, uintx s) { |
913 #ifdef ASSERT | 921 #ifdef ASSERT |
914 if (!is_power_of_2(s)) basic_fatal("s must be a power of 2"); | 922 if (!is_power_of_2(s)) basic_fatal("s must be a power of 2"); |