< prev index next >

src/cpu/arm/vm/c1_LIRGenerator_arm.cpp

Print this page




 906         __ irem(left_arg->result(), right_arg->result(), out_reg, tmp, info);
 907       } else if (x->op() == Bytecodes::_idiv) {
 908         out_reg = FrameMap::R1_opr;
 909         __ idiv(left_arg->result(), right_arg->result(), out_reg, tmp, info);
 910       }
 911       __ move(out_reg, result);
 912 #endif // AARCH64
 913     }
 914 
 915 #ifdef AARCH64
 916   } else if (((x->op() == Bytecodes::_iadd) || (x->op() == Bytecodes::_isub)) && right_arg->is_constant()) {
 917     left_arg->load_item();
 918     jint c = right_arg->get_jint_constant();
 919     right_arg->dont_load_item();
 920     add_constant(left_arg->result(), (x->op() == Bytecodes::_iadd) ? c : -c, rlock_result(x));
 921 #endif // AARCH64
 922 
 923   } else {
 924     left_arg->load_item();
 925     if (x->op() == Bytecodes::_imul && right_arg->is_constant()) {
 926       int c = right_arg->get_jint_constant();
 927       if (c > 0 && (is_power_of_2(c) || is_power_of_2(c - 1) || is_power_of_2(c + 1))) {
 928         right_arg->dont_load_item();
 929       } else {
 930         right_arg->load_item();
 931       }
 932     } else {
 933       AARCH64_ONLY(assert(!right_arg->is_constant(), "constant right_arg is already handled by this moment");)
 934       right_arg->load_nonconstant();
 935     }
 936     rlock_result(x);
 937     assert(right_arg->is_constant() || right_arg->is_register(), "wrong state of right");
 938     arithmetic_op_int(x->op(), x->operand(), left_arg->result(), right_arg->result(), NULL);
 939   }
 940 }
 941 
 942 
 943 void LIRGenerator::do_ArithmeticOp(ArithmeticOp* x) {
 944   ValueTag tag = x->type()->tag();
 945   assert(x->x()->type()->tag() == tag && x->y()->type()->tag() == tag, "wrong parameters");
 946   switch (tag) {
 947     case floatTag:




 906         __ irem(left_arg->result(), right_arg->result(), out_reg, tmp, info);
 907       } else if (x->op() == Bytecodes::_idiv) {
 908         out_reg = FrameMap::R1_opr;
 909         __ idiv(left_arg->result(), right_arg->result(), out_reg, tmp, info);
 910       }
 911       __ move(out_reg, result);
 912 #endif // AARCH64
 913     }
 914 
 915 #ifdef AARCH64
 916   } else if (((x->op() == Bytecodes::_iadd) || (x->op() == Bytecodes::_isub)) && right_arg->is_constant()) {
 917     left_arg->load_item();
 918     jint c = right_arg->get_jint_constant();
 919     right_arg->dont_load_item();
 920     add_constant(left_arg->result(), (x->op() == Bytecodes::_iadd) ? c : -c, rlock_result(x));
 921 #endif // AARCH64
 922 
 923   } else {
 924     left_arg->load_item();
 925     if (x->op() == Bytecodes::_imul && right_arg->is_constant()) {
 926       jint c = right_arg->get_jint_constant();
 927       if (c > 0 && c < max_jint && (is_power_of_2(c) || is_power_of_2(c - 1) || is_power_of_2(c + 1))) {
 928         right_arg->dont_load_item();
 929       } else {
 930         right_arg->load_item();
 931       }
 932     } else {
 933       AARCH64_ONLY(assert(!right_arg->is_constant(), "constant right_arg is already handled by this moment");)
 934       right_arg->load_nonconstant();
 935     }
 936     rlock_result(x);
 937     assert(right_arg->is_constant() || right_arg->is_register(), "wrong state of right");
 938     arithmetic_op_int(x->op(), x->operand(), left_arg->result(), right_arg->result(), NULL);
 939   }
 940 }
 941 
 942 
 943 void LIRGenerator::do_ArithmeticOp(ArithmeticOp* x) {
 944   ValueTag tag = x->type()->tag();
 945   assert(x->x()->type()->tag() == tag && x->y()->type()->tag() == tag, "wrong parameters");
 946   switch (tag) {
 947     case floatTag:


< prev index next >