708 709 value2.set_destroys_register(); 710 711 value.load_item(); 712 value1.load_item(); 713 value2.load_item(); 714 715 LIR_Opr calc_input = value.result(); 716 LIR_Opr calc_input1 = value1.result(); 717 LIR_Opr calc_input2 = value2.result(); 718 LIR_Opr calc_result = rlock_result(x); 719 720 switch (x->id()) { 721 case vmIntrinsics::_fmaD: __ fmad(calc_input, calc_input1, calc_input2, calc_result); break; 722 case vmIntrinsics::_fmaF: __ fmaf(calc_input, calc_input1, calc_input2, calc_result); break; 723 default: ShouldNotReachHere(); 724 } 725 726 } 727 728 729 void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { 730 assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type"); 731 732 if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog || 733 x->id() == vmIntrinsics::_dpow || x->id() == vmIntrinsics::_dcos || 734 x->id() == vmIntrinsics::_dsin || x->id() == vmIntrinsics::_dtan || 735 x->id() == vmIntrinsics::_dlog10) { 736 do_LibmIntrinsic(x); 737 return; 738 } 739 740 LIRItem value(x->argument_at(0), this); 741 742 bool use_fpu = false; 743 if (UseSSE < 2) { 744 value.set_destroys_register(); 745 } 746 value.load_item(); 747 | 708 709 value2.set_destroys_register(); 710 711 value.load_item(); 712 value1.load_item(); 713 value2.load_item(); 714 715 LIR_Opr calc_input = value.result(); 716 LIR_Opr calc_input1 = value1.result(); 717 LIR_Opr calc_input2 = value2.result(); 718 LIR_Opr calc_result = rlock_result(x); 719 720 switch (x->id()) { 721 case vmIntrinsics::_fmaD: __ fmad(calc_input, calc_input1, calc_input2, calc_result); break; 722 case vmIntrinsics::_fmaF: __ fmaf(calc_input, calc_input1, calc_input2, calc_result); break; 723 default: ShouldNotReachHere(); 724 } 725 726 } 727 728 void LIRGenerator::do_BitIntrinsic(Intrinsic* x) { 729 address routine = NULL; 730 731 if (x->id() == vmIntrinsics::_setBit) 732 routine = StubRoutines::setBit(); 733 else if (x->id() == vmIntrinsics::_clrBit) 734 routine = StubRoutines::clrBit(); 735 736 assert(routine != NULL, "bit intrinsic not available"); 737 738 LIRItem bits(x->argument_at(0), this); 739 LIRItem index(x->argument_at(1), this); 740 741 bits.load_item(); 742 LIR_Address* a = new LIR_Address(bits.result(), T_BYTE); 743 744 BasicTypeList signature(2); 745 signature.append(T_ADDRESS); 746 signature.append(T_INT); 747 748 CallingConvention* cc = frame_map()->c_calling_convention(&signature); 749 750 LIR_Opr addr = new_pointer_register(); 751 __ leal(LIR_OprFact::address(a), addr); 752 __ move(addr, cc->at(0)); 753 754 index.load_item_force(cc->at(1)); 755 756 __ call_runtime_leaf(routine, getThreadTemp(), LIR_OprFact::illegalOpr, cc->args()); 757 } 758 759 void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { 760 assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type"); 761 762 if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog || 763 x->id() == vmIntrinsics::_dpow || x->id() == vmIntrinsics::_dcos || 764 x->id() == vmIntrinsics::_dsin || x->id() == vmIntrinsics::_dtan || 765 x->id() == vmIntrinsics::_dlog10) { 766 do_LibmIntrinsic(x); 767 return; 768 } 769 770 LIRItem value(x->argument_at(0), this); 771 772 bool use_fpu = false; 773 if (UseSSE < 2) { 774 value.set_destroys_register(); 775 } 776 value.load_item(); 777 |