< prev index next >

src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp

Print this page




 581     info = state_for(x);
 582 
 583     if (x->op() == Bytecodes::_irem) {
 584       __ irem(left_arg->result(), right_arg->result(), x->operand(), tmp, NULL);
 585     } else if (x->op() == Bytecodes::_idiv) {
 586       __ idiv(left_arg->result(), right_arg->result(), x->operand(), tmp, NULL);
 587     }
 588 
 589   } else if (x->op() == Bytecodes::_iadd || x->op() == Bytecodes::_isub) {
 590     if (right.is_constant()
 591         && Assembler::operand_valid_for_add_sub_immediate(right.get_jint_constant())) {
 592       right.load_nonconstant();
 593     } else {
 594       right.load_item();
 595     }
 596     rlock_result(x);
 597     arithmetic_op_int(x->op(), x->operand(), left_arg->result(), right_arg->result(), LIR_OprFact::illegalOpr);
 598   } else {
 599     assert (x->op() == Bytecodes::_imul, "expect imul");
 600     if (right.is_constant()) {
 601       int c = right.get_jint_constant();
 602       if (! is_power_of_2(c) && ! is_power_of_2(c + 1) && ! is_power_of_2(c - 1)) {
 603         // Cannot use constant op.
 604         right.load_item();
 605       } else {
 606         right.dont_load_item();

 607       }
 608     } else {
 609       right.load_item();
 610     }
 611     rlock_result(x);
 612     arithmetic_op_int(x->op(), x->operand(), left_arg->result(), right_arg->result(), new_register(T_INT));
 613   }
 614 }
 615 
 616 void LIRGenerator::do_ArithmeticOp(ArithmeticOp* x) {
 617   // when an operand with use count 1 is the left operand, then it is
 618   // likely that no move for 2-operand-LIR-form is necessary
 619   if (x->is_commutative() && x->y()->as_Constant() == NULL && x->x()->use_count() > x->y()->use_count()) {
 620     x->swap_operands();
 621   }
 622 
 623   ValueTag tag = x->type()->tag();
 624   assert(x->x()->type()->tag() == tag && x->y()->type()->tag() == tag, "wrong parameters");
 625   switch (tag) {
 626     case floatTag:




 581     info = state_for(x);
 582 
 583     if (x->op() == Bytecodes::_irem) {
 584       __ irem(left_arg->result(), right_arg->result(), x->operand(), tmp, NULL);
 585     } else if (x->op() == Bytecodes::_idiv) {
 586       __ idiv(left_arg->result(), right_arg->result(), x->operand(), tmp, NULL);
 587     }
 588 
 589   } else if (x->op() == Bytecodes::_iadd || x->op() == Bytecodes::_isub) {
 590     if (right.is_constant()
 591         && Assembler::operand_valid_for_add_sub_immediate(right.get_jint_constant())) {
 592       right.load_nonconstant();
 593     } else {
 594       right.load_item();
 595     }
 596     rlock_result(x);
 597     arithmetic_op_int(x->op(), x->operand(), left_arg->result(), right_arg->result(), LIR_OprFact::illegalOpr);
 598   } else {
 599     assert (x->op() == Bytecodes::_imul, "expect imul");
 600     if (right.is_constant()) {
 601       jint c = right.get_jint_constant();
 602       if (c > 0 && c < max_jint && (is_power_of_2(c) || is_power_of_2(c - 1) || is_power_of_2(c + 1))) {
 603         right_arg->dont_load_item();

 604       } else {
 605         // Cannot use constant op.
 606         right_arg->load_item();
 607       }
 608     } else {
 609       right.load_item();
 610     }
 611     rlock_result(x);
 612     arithmetic_op_int(x->op(), x->operand(), left_arg->result(), right_arg->result(), new_register(T_INT));
 613   }
 614 }
 615 
 616 void LIRGenerator::do_ArithmeticOp(ArithmeticOp* x) {
 617   // when an operand with use count 1 is the left operand, then it is
 618   // likely that no move for 2-operand-LIR-form is necessary
 619   if (x->is_commutative() && x->y()->as_Constant() == NULL && x->x()->use_count() > x->y()->use_count()) {
 620     x->swap_operands();
 621   }
 622 
 623   ValueTag tag = x->type()->tag();
 624   assert(x->x()->type()->tag() == tag && x->y()->type()->tag() == tag, "wrong parameters");
 625   switch (tag) {
 626     case floatTag:


< prev index next >