src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 6875026 Sdiff src/cpu/x86/vm

src/cpu/x86/vm/c1_LIRGenerator_x86.cpp

Print this page




 857 
 858   switch(x->id()) {
 859     case vmIntrinsics::_dabs:   __ abs  (calc_input, calc_result, LIR_OprFact::illegalOpr); break;
 860     case vmIntrinsics::_dsqrt:  __ sqrt (calc_input, calc_result, LIR_OprFact::illegalOpr); break;
 861     case vmIntrinsics::_dsin:   __ sin  (calc_input, calc_result, tmp1, tmp2);              break;
 862     case vmIntrinsics::_dcos:   __ cos  (calc_input, calc_result, tmp1, tmp2);              break;
 863     case vmIntrinsics::_dtan:   __ tan  (calc_input, calc_result, tmp1, tmp2);              break;
 864     case vmIntrinsics::_dlog:   __ log  (calc_input, calc_result, tmp1);                    break;
 865     case vmIntrinsics::_dlog10: __ log10(calc_input, calc_result, tmp1);                    break;
 866     default:                    ShouldNotReachHere();
 867   }
 868 
 869   if (use_fpu) {
 870     __ move(calc_result, x->operand());
 871   }
 872 }
 873 
 874 
 875 void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
 876   assert(x->number_of_arguments() == 5, "wrong type");




 877   LIRItem src(x->argument_at(0), this);
 878   LIRItem src_pos(x->argument_at(1), this);
 879   LIRItem dst(x->argument_at(2), this);
 880   LIRItem dst_pos(x->argument_at(3), this);
 881   LIRItem length(x->argument_at(4), this);
 882 
 883   // operands for arraycopy must use fixed registers, otherwise
 884   // LinearScan will fail allocation (because arraycopy always needs a
 885   // call)
 886 
 887 #ifndef _LP64
 888   src.load_item_force     (FrameMap::rcx_oop_opr);
 889   src_pos.load_item_force (FrameMap::rdx_opr);
 890   dst.load_item_force     (FrameMap::rax_oop_opr);
 891   dst_pos.load_item_force (FrameMap::rbx_opr);
 892   length.load_item_force  (FrameMap::rdi_opr);
 893   LIR_Opr tmp =           (FrameMap::rsi_opr);
 894 #else
 895 
 896   // The java calling convention will give us enough registers


 899   // positions are not similar enough to pick one as the best.
 900   // Also because the java calling convention is a "shifted" version
 901   // of the C convention we can process the java args trivially into C
 902   // args without worry of overwriting during the xfer
 903 
 904   src.load_item_force     (FrameMap::as_oop_opr(j_rarg0));
 905   src_pos.load_item_force (FrameMap::as_opr(j_rarg1));
 906   dst.load_item_force     (FrameMap::as_oop_opr(j_rarg2));
 907   dst_pos.load_item_force (FrameMap::as_opr(j_rarg3));
 908   length.load_item_force  (FrameMap::as_opr(j_rarg4));
 909 
 910   LIR_Opr tmp =           FrameMap::as_opr(j_rarg5);
 911 #endif // LP64
 912 
 913   set_no_result(x);
 914 
 915   int flags;
 916   ciArrayKlass* expected_type;
 917   arraycopy_helper(x, &flags, &expected_type);
 918 
 919   CodeEmitInfo* info = state_for(x, x->state()); // we may want to have stack (deoptimization?)
 920   __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp, expected_type, flags, info); // does add_safepoint
 921 }
 922 
 923 
 924 // _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f
 925 // _i2b, _i2c, _i2s
 926 LIR_Opr fixed_register_for(BasicType type) {
 927   switch (type) {
 928     case T_FLOAT:  return FrameMap::fpu0_float_opr;
 929     case T_DOUBLE: return FrameMap::fpu0_double_opr;
 930     case T_INT:    return FrameMap::rax_opr;
 931     case T_LONG:   return FrameMap::long0_opr;
 932     default:       ShouldNotReachHere(); return LIR_OprFact::illegalOpr;
 933   }
 934 }
 935 
 936 void LIRGenerator::do_Convert(Convert* x) {
 937   // flags that vary for the different operations and different SSE-settings
 938   bool fixed_input, fixed_result, round_result, needs_stub;
 939 




 857 
 858   switch(x->id()) {
 859     case vmIntrinsics::_dabs:   __ abs  (calc_input, calc_result, LIR_OprFact::illegalOpr); break;
 860     case vmIntrinsics::_dsqrt:  __ sqrt (calc_input, calc_result, LIR_OprFact::illegalOpr); break;
 861     case vmIntrinsics::_dsin:   __ sin  (calc_input, calc_result, tmp1, tmp2);              break;
 862     case vmIntrinsics::_dcos:   __ cos  (calc_input, calc_result, tmp1, tmp2);              break;
 863     case vmIntrinsics::_dtan:   __ tan  (calc_input, calc_result, tmp1, tmp2);              break;
 864     case vmIntrinsics::_dlog:   __ log  (calc_input, calc_result, tmp1);                    break;
 865     case vmIntrinsics::_dlog10: __ log10(calc_input, calc_result, tmp1);                    break;
 866     default:                    ShouldNotReachHere();
 867   }
 868 
 869   if (use_fpu) {
 870     __ move(calc_result, x->operand());
 871   }
 872 }
 873 
 874 
 875 void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
 876   assert(x->number_of_arguments() == 5, "wrong type");
 877 
 878   // Make all state_for calls early since they can emit code
 879   CodeEmitInfo* info = state_for(x, x->state());
 880 
 881   LIRItem src(x->argument_at(0), this);
 882   LIRItem src_pos(x->argument_at(1), this);
 883   LIRItem dst(x->argument_at(2), this);
 884   LIRItem dst_pos(x->argument_at(3), this);
 885   LIRItem length(x->argument_at(4), this);
 886 
 887   // operands for arraycopy must use fixed registers, otherwise
 888   // LinearScan will fail allocation (because arraycopy always needs a
 889   // call)
 890 
 891 #ifndef _LP64
 892   src.load_item_force     (FrameMap::rcx_oop_opr);
 893   src_pos.load_item_force (FrameMap::rdx_opr);
 894   dst.load_item_force     (FrameMap::rax_oop_opr);
 895   dst_pos.load_item_force (FrameMap::rbx_opr);
 896   length.load_item_force  (FrameMap::rdi_opr);
 897   LIR_Opr tmp =           (FrameMap::rsi_opr);
 898 #else
 899 
 900   // The java calling convention will give us enough registers


 903   // positions are not similar enough to pick one as the best.
 904   // Also because the java calling convention is a "shifted" version
 905   // of the C convention we can process the java args trivially into C
 906   // args without worry of overwriting during the xfer
 907 
 908   src.load_item_force     (FrameMap::as_oop_opr(j_rarg0));
 909   src_pos.load_item_force (FrameMap::as_opr(j_rarg1));
 910   dst.load_item_force     (FrameMap::as_oop_opr(j_rarg2));
 911   dst_pos.load_item_force (FrameMap::as_opr(j_rarg3));
 912   length.load_item_force  (FrameMap::as_opr(j_rarg4));
 913 
 914   LIR_Opr tmp =           FrameMap::as_opr(j_rarg5);
 915 #endif // LP64
 916 
 917   set_no_result(x);
 918 
 919   int flags;
 920   ciArrayKlass* expected_type;
 921   arraycopy_helper(x, &flags, &expected_type);
 922 

 923   __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp, expected_type, flags, info); // does add_safepoint
 924 }
 925 
 926 
 927 // _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f
 928 // _i2b, _i2c, _i2s
 929 LIR_Opr fixed_register_for(BasicType type) {
 930   switch (type) {
 931     case T_FLOAT:  return FrameMap::fpu0_float_opr;
 932     case T_DOUBLE: return FrameMap::fpu0_double_opr;
 933     case T_INT:    return FrameMap::rax_opr;
 934     case T_LONG:   return FrameMap::long0_opr;
 935     default:       ShouldNotReachHere(); return LIR_OprFact::illegalOpr;
 936   }
 937 }
 938 
 939 void LIRGenerator::do_Convert(Convert* x) {
 940   // flags that vary for the different operations and different SSE-settings
 941   bool fixed_input, fixed_result, round_result, needs_stub;
 942 


src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File