< prev index next >
src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
Print this page
*** 235,250 ****
bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) {
if (tmp->is_valid()) {
if (is_power_of_2(c + 1)) {
__ move(left, tmp);
! __ shift_left(left, log2_intptr(c + 1), left);
__ sub(left, tmp, result);
return true;
} else if (is_power_of_2(c - 1)) {
__ move(left, tmp);
! __ shift_left(left, log2_intptr(c - 1), left);
__ add(left, tmp, result);
return true;
}
}
return false;
--- 235,250 ----
bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) {
if (tmp->is_valid()) {
if (is_power_of_2(c + 1)) {
__ move(left, tmp);
! __ shift_left(left, log2_jint(c + 1), left);
__ sub(left, tmp, result);
return true;
} else if (is_power_of_2(c - 1)) {
__ move(left, tmp);
! __ shift_left(left, log2_jint(c - 1), left);
__ add(left, tmp, result);
return true;
}
}
return false;
< prev index next >