< prev index next >

src/cpu/x86/vm/c1_LIRGenerator_x86.cpp

Print this page




 790   if (type == objectType)
 791     __ cas_obj(addr, cmp.result(), val.result(), ill, ill);
 792   else if (type == intType)
 793     __ cas_int(addr, cmp.result(), val.result(), ill, ill);
 794   else if (type == longType)
 795     __ cas_long(addr, cmp.result(), val.result(), ill, ill);
 796   else {
 797     ShouldNotReachHere();
 798   }
 799 
 800   // generate conditional move of boolean result
 801   LIR_Opr result = rlock_result(x);
 802   __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
 803            result, as_BasicType(type));
 804   if (type == objectType) {   // Write-barrier needed for Object fields.
 805     // Seems to be precise
 806     post_barrier(addr, val.result());
 807   }
 808 }
 809 


























 810 
 811 void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
 812   assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type");
 813 
 814   if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog ||
 815       x->id() == vmIntrinsics::_dpow || x->id() == vmIntrinsics::_dcos ||
 816       x->id() == vmIntrinsics::_dsin || x->id() == vmIntrinsics::_dtan ||
 817       x->id() == vmIntrinsics::_dlog10) {
 818     do_LibmIntrinsic(x);
 819     return;
 820   }
 821 
 822   LIRItem value(x->argument_at(0), this);
 823 
 824   bool use_fpu = false;
 825   if (UseSSE < 2) {
 826     value.set_destroys_register();
 827   }
 828   value.load_item();
 829 




 790   if (type == objectType)
 791     __ cas_obj(addr, cmp.result(), val.result(), ill, ill);
 792   else if (type == intType)
 793     __ cas_int(addr, cmp.result(), val.result(), ill, ill);
 794   else if (type == longType)
 795     __ cas_long(addr, cmp.result(), val.result(), ill, ill);
 796   else {
 797     ShouldNotReachHere();
 798   }
 799 
 800   // generate conditional move of boolean result
 801   LIR_Opr result = rlock_result(x);
 802   __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0),
 803            result, as_BasicType(type));
 804   if (type == objectType) {   // Write-barrier needed for Object fields.
 805     // Seems to be precise
 806     post_barrier(addr, val.result());
 807   }
 808 }
 809 
 810 void LIRGenerator::do_FmaIntrinsic(Intrinsic* x) {
 811   assert(x->number_of_arguments() == 3);
 812   assert(UseFMA, "Needs FMA instructions support.");
 813   LIRItem value(x->argument_at(0), this);
 814   LIRItem value1(x->argument_at(1), this);
 815   LIRItem value2(x->argument_at(2), this);
 816 
 817   value2.set_destroys_register();
 818 
 819   value.load_item();
 820   value1.load_item();
 821   value2.load_item();
 822 
 823   LIR_Opr calc_input = value.result();
 824   LIR_Opr calc_input1 = value1.result();
 825   LIR_Opr calc_input2 = value2.result();
 826   LIR_Opr calc_result = rlock_result(x);
 827 
 828   switch (x->id()) {
 829   case vmIntrinsics::_fmaD:   __ fmad(calc_input, calc_input1, calc_input2, calc_result); break;
 830   case vmIntrinsics::_fmaF:   __ fmaf(calc_input, calc_input1, calc_input2, calc_result); break;
 831   default:                    ShouldNotReachHere();
 832   }
 833 
 834 }
 835 
 836 
 837 void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
 838   assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type");
 839 
 840   if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog ||
 841       x->id() == vmIntrinsics::_dpow || x->id() == vmIntrinsics::_dcos ||
 842       x->id() == vmIntrinsics::_dsin || x->id() == vmIntrinsics::_dtan ||
 843       x->id() == vmIntrinsics::_dlog10) {
 844     do_LibmIntrinsic(x);
 845     return;
 846   }
 847 
 848   LIRItem value(x->argument_at(0), this);
 849 
 850   bool use_fpu = false;
 851   if (UseSSE < 2) {
 852     value.set_destroys_register();
 853   }
 854   value.load_item();
 855 


< prev index next >