209 LIR_Opr pointer = new_pointer_register(); 210 __ move(LIR_OprFact::intptrConst(counter), pointer); 211 LIR_Address* addr = new LIR_Address(pointer, type); 212 increment_counter(addr, step); 213 } 214 215 void LIRGenerator::increment_counter(LIR_Address* addr, int step) { 216 __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr); 217 } 218 219 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) { 220 LIR_Opr scratch = FrameMap::Z_R1_opr; 221 __ load(new LIR_Address(base, disp, T_INT), scratch, info); 222 __ cmp(condition, scratch, c); 223 } 224 225 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) { 226 __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info); 227 } 228 229 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, LIR_Opr disp, BasicType type, CodeEmitInfo* info) { 230 __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info); 231 } 232 233 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { 234 if (tmp->is_valid()) { 235 if (is_power_of_2(c + 1)) { 236 __ move(left, tmp); 237 __ shift_left(left, log2_intptr(c + 1), left); 238 __ sub(left, tmp, result); 239 return true; 240 } else if (is_power_of_2(c - 1)) { 241 __ move(left, tmp); 242 __ shift_left(left, log2_intptr(c - 1), left); 243 __ add(left, tmp, result); 244 return true; 245 } 246 } 247 return false; 248 } 249 250 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) { 251 BasicType type = item->type(); 252 __ store(item, new LIR_Address(FrameMap::Z_SP_opr, in_bytes(offset_from_sp), type)); | 209 LIR_Opr pointer = new_pointer_register(); 210 __ move(LIR_OprFact::intptrConst(counter), pointer); 211 LIR_Address* addr = new LIR_Address(pointer, type); 212 increment_counter(addr, step); 213 } 214 215 void LIRGenerator::increment_counter(LIR_Address* addr, int step) { 216 __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr); 217 } 218 219 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) { 220 LIR_Opr scratch = FrameMap::Z_R1_opr; 221 __ load(new LIR_Address(base, disp, T_INT), scratch, info); 222 __ cmp(condition, scratch, c); 223 } 224 225 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) { 226 __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info); 227 } 228 229 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { 230 if (tmp->is_valid()) { 231 if (is_power_of_2(c + 1)) { 232 __ move(left, tmp); 233 __ shift_left(left, log2_intptr(c + 1), left); 234 __ sub(left, tmp, result); 235 return true; 236 } else if (is_power_of_2(c - 1)) { 237 __ move(left, tmp); 238 __ shift_left(left, log2_intptr(c - 1), left); 239 __ add(left, tmp, result); 240 return true; 241 } 242 } 243 return false; 244 } 245 246 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) { 247 BasicType type = item->type(); 248 __ store(item, new LIR_Address(FrameMap::Z_SP_opr, in_bytes(offset_from_sp), type)); |