src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp
changeset 52675 7d3cde494494
parent 52031 ecb72543c632
child 58273 08a5148e7c4e
equal deleted inserted replaced
52674:c9325aa887da 52675:7d3cde494494
   242 
   242 
   243 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) {
   243 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) {
   244   if (tmp->is_valid() && c > 0 && c < max_jint) {
   244   if (tmp->is_valid() && c > 0 && c < max_jint) {
   245     if (is_power_of_2(c + 1)) {
   245     if (is_power_of_2(c + 1)) {
   246       __ move(left, tmp);
   246       __ move(left, tmp);
   247       __ shift_left(left, log2_intptr(c + 1), left);
   247       __ shift_left(left, log2_jint(c + 1), left);
   248       __ sub(left, tmp, result);
   248       __ sub(left, tmp, result);
   249       return true;
   249       return true;
   250     } else if (is_power_of_2(c - 1)) {
   250     } else if (is_power_of_2(c - 1)) {
   251       __ move(left, tmp);
   251       __ move(left, tmp);
   252       __ shift_left(left, log2_intptr(c - 1), left);
   252       __ shift_left(left, log2_jint(c - 1), left);
   253       __ add(left, tmp, result);
   253       __ add(left, tmp, result);
   254       return true;
   254       return true;
   255     }
   255     }
   256   }
   256   }
   257   return false;
   257   return false;