comparison src/share/vm/opto/library_call.cpp @ 3352:6759698e3140

7133857: exp() and pow() should use the x87 ISA on x86 Summary: use x87 instructions to implement exp() and pow() in interpreter/c1/c2. Reviewed-by: kvn, never, twisti
author roland
date Tue, 15 May 2012 10:10:23 +0200
parents 8f972594effc
children 8b0a4867acf0
comparison
equal deleted inserted replaced
72:ce67ce06986a 73:bfa67237da1c
1555 1555
1556 // If this inlining ever returned NaN in the past, we do not intrinsify it 1556 // If this inlining ever returned NaN in the past, we do not intrinsify it
1557 // every again. NaN results requires StrictMath.exp handling. 1557 // every again. NaN results requires StrictMath.exp handling.
1558 if (too_many_traps(Deoptimization::Reason_intrinsic)) return false; 1558 if (too_many_traps(Deoptimization::Reason_intrinsic)) return false;
1559 1559
1560 // Do not intrinsify on older platforms which lack cmove.
1561 if (ConditionalMoveLimit == 0) return false;
1562
1563 _sp += arg_size(); // restore stack pointer 1560 _sp += arg_size(); // restore stack pointer
1564 Node *x = pop_math_arg(); 1561 Node *x = pop_math_arg();
1565 Node *result = _gvn.transform(new (C, 2) ExpDNode(0,x)); 1562 Node *result = _gvn.transform(new (C, 2) ExpDNode(0,x));
1566 1563
1567 //------------------- 1564 //-------------------
1800 1797
1801 // These intrinsics are supported on all hardware 1798 // These intrinsics are supported on all hardware
1802 case vmIntrinsics::_dsqrt: return Matcher::has_match_rule(Op_SqrtD) ? inline_sqrt(id) : false; 1799 case vmIntrinsics::_dsqrt: return Matcher::has_match_rule(Op_SqrtD) ? inline_sqrt(id) : false;
1803 case vmIntrinsics::_dabs: return Matcher::has_match_rule(Op_AbsD) ? inline_abs(id) : false; 1800 case vmIntrinsics::_dabs: return Matcher::has_match_rule(Op_AbsD) ? inline_abs(id) : false;
1804 1801
1805 // These intrinsics don't work on X86. The ad implementation doesn't
1806 // handle NaN's properly. Instead of returning infinity, the ad
1807 // implementation returns a NaN on overflow. See bug: 6304089
1808 // Once the ad implementations are fixed, change the code below
1809 // to match the intrinsics above
1810
1811 case vmIntrinsics::_dexp: return 1802 case vmIntrinsics::_dexp: return
1803 Matcher::has_match_rule(Op_ExpD) ? inline_exp(id) :
1812 runtime_math(OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dexp), "EXP"); 1804 runtime_math(OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dexp), "EXP");
1813 case vmIntrinsics::_dpow: return 1805 case vmIntrinsics::_dpow: return
1806 Matcher::has_match_rule(Op_PowD) ? inline_pow(id) :
1814 runtime_math(OptoRuntime::Math_DD_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dpow), "POW"); 1807 runtime_math(OptoRuntime::Math_DD_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dpow), "POW");
1815 1808
1816 // These intrinsics are not yet correctly implemented 1809 // These intrinsics are not yet correctly implemented
1817 case vmIntrinsics::_datan2: 1810 case vmIntrinsics::_datan2:
1818 return false; 1811 return false;