OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1782 Label check_nan_left, check_zero, return_left, return_right, done; | 1782 Label check_nan_left, check_zero, return_left, return_right, done; |
1783 __ BranchF(&check_zero, &check_nan_left, eq, left_reg, right_reg); | 1783 __ BranchF(&check_zero, &check_nan_left, eq, left_reg, right_reg); |
1784 __ BranchF(&return_left, NULL, condition, left_reg, right_reg); | 1784 __ BranchF(&return_left, NULL, condition, left_reg, right_reg); |
1785 __ Branch(&return_right); | 1785 __ Branch(&return_right); |
1786 | 1786 |
1787 __ bind(&check_zero); | 1787 __ bind(&check_zero); |
1788 // left == right != 0. | 1788 // left == right != 0. |
1789 __ BranchF(&return_left, NULL, ne, left_reg, kDoubleRegZero); | 1789 __ BranchF(&return_left, NULL, ne, left_reg, kDoubleRegZero); |
1790 // At this point, both left and right are either 0 or -0. | 1790 // At this point, both left and right are either 0 or -0. |
1791 if (operation == HMathMinMax::kMathMin) { | 1791 if (operation == HMathMinMax::kMathMin) { |
| 1792 // The algorithm is: -((-L) + (-R)), which in case of L and R being |
| 1793 // different registers is most efficiently expressed as -((-L) - R). |
1792 __ neg_d(left_reg, left_reg); | 1794 __ neg_d(left_reg, left_reg); |
1793 __ sub_d(result_reg, left_reg, right_reg); | 1795 if (left_reg.is(right_reg)) { |
| 1796 __ add_d(result_reg, left_reg, right_reg); |
| 1797 } else { |
| 1798 __ sub_d(result_reg, left_reg, right_reg); |
| 1799 } |
1794 __ neg_d(result_reg, result_reg); | 1800 __ neg_d(result_reg, result_reg); |
1795 } else { | 1801 } else { |
1796 __ add_d(result_reg, left_reg, right_reg); | 1802 __ add_d(result_reg, left_reg, right_reg); |
1797 } | 1803 } |
1798 __ Branch(&done); | 1804 __ Branch(&done); |
1799 | 1805 |
1800 __ bind(&check_nan_left); | 1806 __ bind(&check_nan_left); |
1801 // left == NaN. | 1807 // left == NaN. |
1802 __ BranchF(NULL, &return_left, eq, left_reg, left_reg); | 1808 __ BranchF(NULL, &return_left, eq, left_reg, left_reg); |
1803 __ bind(&return_right); | 1809 __ bind(&return_right); |
(...skipping 3765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5569 __ Push(at, ToRegister(instr->function())); | 5575 __ Push(at, ToRegister(instr->function())); |
5570 CallRuntime(Runtime::kPushBlockContext, instr); | 5576 CallRuntime(Runtime::kPushBlockContext, instr); |
5571 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5577 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5572 } | 5578 } |
5573 | 5579 |
5574 | 5580 |
5575 #undef __ | 5581 #undef __ |
5576 | 5582 |
5577 } // namespace internal | 5583 } // namespace internal |
5578 } // namespace v8 | 5584 } // namespace v8 |
OLD | NEW |