1651 //------------------------------inline_exp------------------------------------- |
1651 //------------------------------inline_exp------------------------------------- |
1652 // Inline exp instructions, if possible. The Intel hardware only misses |
1652 // Inline exp instructions, if possible. The Intel hardware only misses |
1653 // really odd corner cases (+/- Infinity). Just uncommon-trap them. |
1653 // really odd corner cases (+/- Infinity). Just uncommon-trap them. |
1654 bool LibraryCallKit::inline_exp() { |
1654 bool LibraryCallKit::inline_exp() { |
1655 Node* arg = round_double_node(argument(0)); |
1655 Node* arg = round_double_node(argument(0)); |
1656 Node* n = _gvn.transform(new (C) ExpDNode(0, arg)); |
1656 Node* n = _gvn.transform(new (C) ExpDNode(C, control(), arg)); |
1657 |
1657 |
1658 finish_pow_exp(n, arg, NULL, OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dexp), "EXP"); |
1658 finish_pow_exp(n, arg, NULL, OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dexp), "EXP"); |
1659 |
1659 |
1660 C->set_has_split_ifs(true); // Has chance for split-if optimization |
1660 C->set_has_split_ifs(true); // Has chance for split-if optimization |
1661 return true; |
1661 return true; |
1686 |
1686 |
1687 Node* result = NULL; |
1687 Node* result = NULL; |
1688 |
1688 |
1689 if (!too_many_traps(Deoptimization::Reason_intrinsic)) { |
1689 if (!too_many_traps(Deoptimization::Reason_intrinsic)) { |
1690 // Short form: skip the fancy tests and just check for NaN result. |
1690 // Short form: skip the fancy tests and just check for NaN result. |
1691 result = _gvn.transform(new (C) PowDNode(0, x, y)); |
1691 result = _gvn.transform(new (C) PowDNode(C, control(), x, y)); |
1692 } else { |
1692 } else { |
1693 // If this inlining ever returned NaN in the past, include all |
1693 // If this inlining ever returned NaN in the past, include all |
1694 // checks + call to the runtime. |
1694 // checks + call to the runtime. |
1695 |
1695 |
1696 // Set the merge point for If node with condition of (x <= 0.0) |
1696 // Set the merge point for If node with condition of (x <= 0.0) |
1713 |
1713 |
1714 // Fast path not-taken, i.e. slow path |
1714 // Fast path not-taken, i.e. slow path |
1715 Node *complex_path = _gvn.transform( new (C) IfTrueNode(if1) ); |
1715 Node *complex_path = _gvn.transform( new (C) IfTrueNode(if1) ); |
1716 |
1716 |
1717 // Set fast path result |
1717 // Set fast path result |
1718 Node *fast_result = _gvn.transform( new (C) PowDNode(0, x, y) ); |
1718 Node *fast_result = _gvn.transform( new (C) PowDNode(C, control(), x, y) ); |
1719 phi->init_req(3, fast_result); |
1719 phi->init_req(3, fast_result); |
1720 |
1720 |
1721 // Complex path |
1721 // Complex path |
1722 // Build the second if node (if y is long) |
1722 // Build the second if node (if y is long) |
1723 // Node for (long)y |
1723 // Node for (long)y |
1773 // Check if (1&(long)y)!=0?, if so the result is negative |
1773 // Check if (1&(long)y)!=0?, if so the result is negative |
1774 Node *bol3 = _gvn.transform( new (C) BoolNode( cmpeq1, BoolTest::ne ) ); |
1774 Node *bol3 = _gvn.transform( new (C) BoolNode( cmpeq1, BoolTest::ne ) ); |
1775 // abs(x) |
1775 // abs(x) |
1776 Node *absx=_gvn.transform( new (C) AbsDNode(x)); |
1776 Node *absx=_gvn.transform( new (C) AbsDNode(x)); |
1777 // abs(x)^y |
1777 // abs(x)^y |
1778 Node *absxpowy = _gvn.transform( new (C) PowDNode(0, absx, y) ); |
1778 Node *absxpowy = _gvn.transform( new (C) PowDNode(C, control(), absx, y) ); |
1779 // -abs(x)^y |
1779 // -abs(x)^y |
1780 Node *negabsxpowy = _gvn.transform(new (C) NegDNode (absxpowy)); |
1780 Node *negabsxpowy = _gvn.transform(new (C) NegDNode (absxpowy)); |
1781 // (1&(long)y)==1?-DPow(abs(x), y):DPow(abs(x), y) |
1781 // (1&(long)y)==1?-DPow(abs(x), y):DPow(abs(x), y) |
1782 Node *signresult = NULL; |
1782 Node *signresult = NULL; |
1783 if (ConditionalMoveLimit != 0) { |
1783 if (ConditionalMoveLimit != 0) { |