//* 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); }
inline void MacroAssembler::round_to(Register r, int modulus) { assert(is_power_of_2_long((jlong)modulus), "must be power of 2"); addi(r, r, modulus-1); clrrdi(r, r, log2_long((jlong)modulus)); }