1626 bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) { |
1626 bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) { |
1627 Node* arg = round_double_node(argument(0)); |
1627 Node* arg = round_double_node(argument(0)); |
1628 Node* n = NULL; |
1628 Node* n = NULL; |
1629 |
1629 |
1630 switch (id) { |
1630 switch (id) { |
1631 case vmIntrinsics::_dsin: n = new SinDNode(C, control(), arg); break; |
|
1632 case vmIntrinsics::_dcos: n = new CosDNode(C, control(), arg); break; |
|
1633 case vmIntrinsics::_dtan: n = new TanDNode(C, control(), arg); break; |
1631 case vmIntrinsics::_dtan: n = new TanDNode(C, control(), arg); break; |
1634 default: fatal_unexpected_iid(id); break; |
1632 default: fatal_unexpected_iid(id); break; |
1635 } |
1633 } |
1636 n = _gvn.transform(n); |
1634 n = _gvn.transform(n); |
1637 |
1635 |
1690 phi->init_req(2, n); |
1688 phi->init_req(2, n); |
1691 |
1689 |
1692 // Slow path - non-blocking leaf call |
1690 // Slow path - non-blocking leaf call |
1693 Node* call = NULL; |
1691 Node* call = NULL; |
1694 switch (id) { |
1692 switch (id) { |
1695 case vmIntrinsics::_dsin: |
|
1696 call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), |
|
1697 CAST_FROM_FN_PTR(address, SharedRuntime::dsin), |
|
1698 "Sin", NULL, arg, top()); |
|
1699 break; |
|
1700 case vmIntrinsics::_dcos: |
|
1701 call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), |
|
1702 CAST_FROM_FN_PTR(address, SharedRuntime::dcos), |
|
1703 "Cos", NULL, arg, top()); |
|
1704 break; |
|
1705 case vmIntrinsics::_dtan: |
1693 case vmIntrinsics::_dtan: |
1706 call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), |
1694 call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), |
1707 CAST_FROM_FN_PTR(address, SharedRuntime::dtan), |
1695 CAST_FROM_FN_PTR(address, SharedRuntime::dtan), |
1708 "Tan", NULL, arg, top()); |
1696 "Tan", NULL, arg, top()); |
1709 break; |
1697 break; |
1750 //------------------------------inline_math_native----------------------------- |
1738 //------------------------------inline_math_native----------------------------- |
1751 bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) { |
1739 bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) { |
1752 #define FN_PTR(f) CAST_FROM_FN_PTR(address, f) |
1740 #define FN_PTR(f) CAST_FROM_FN_PTR(address, f) |
1753 switch (id) { |
1741 switch (id) { |
1754 // These intrinsics are not properly supported on all hardware |
1742 // These intrinsics are not properly supported on all hardware |
1755 case vmIntrinsics::_dcos: return Matcher::has_match_rule(Op_CosD) ? inline_trig(id) : |
1743 case vmIntrinsics::_dsin: |
1756 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dcos), "COS"); |
1744 return StubRoutines::dsin() != NULL ? |
1757 case vmIntrinsics::_dsin: return Matcher::has_match_rule(Op_SinD) ? inline_trig(id) : |
1745 runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dsin(), "dsin") : |
1758 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dsin), "SIN"); |
1746 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dsin), "SIN"); |
|
1747 case vmIntrinsics::_dcos: |
|
1748 return StubRoutines::dcos() != NULL ? |
|
1749 runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dcos(), "dcos") : |
|
1750 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dcos), "COS"); |
1759 case vmIntrinsics::_dtan: return Matcher::has_match_rule(Op_TanD) ? inline_trig(id) : |
1751 case vmIntrinsics::_dtan: return Matcher::has_match_rule(Op_TanD) ? inline_trig(id) : |
1760 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dtan), "TAN"); |
1752 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dtan), "TAN"); |
1761 |
1753 |
1762 case vmIntrinsics::_dlog: |
1754 case vmIntrinsics::_dlog: |
1763 return StubRoutines::dlog() != NULL ? |
1755 return StubRoutines::dlog() != NULL ? |
1764 runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dlog(), "dlog") : |
1756 runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dlog(), "dlog") : |
1765 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog), "LOG"); |
1757 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog), "LOG"); |
1766 case vmIntrinsics::_dlog10: return Matcher::has_match_rule(Op_Log10D) ? inline_math(id) : |
1758 case vmIntrinsics::_dlog10: return Matcher::has_match_rule(Op_Log10D) ? inline_math(id) : |
1767 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog10), "LOG10"); |
1759 runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog10), "LOG10"); |
1768 |
1760 |
1769 // These intrinsics are supported on all hardware |
1761 // These intrinsics are supported on all hardware |
1770 case vmIntrinsics::_dsqrt: return Matcher::match_rule_supported(Op_SqrtD) ? inline_math(id) : false; |
1762 case vmIntrinsics::_dsqrt: return Matcher::match_rule_supported(Op_SqrtD) ? inline_math(id) : false; |