| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
| 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
| (...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 Label check_nan_left, check_zero, return_left, return_right, done; | 1899 Label check_nan_left, check_zero, return_left, return_right, done; |
| 1900 __ BranchF(&check_zero, &check_nan_left, eq, left_reg, right_reg); | 1900 __ BranchF(&check_zero, &check_nan_left, eq, left_reg, right_reg); |
| 1901 __ BranchF(&return_left, NULL, condition, left_reg, right_reg); | 1901 __ BranchF(&return_left, NULL, condition, left_reg, right_reg); |
| 1902 __ Branch(&return_right); | 1902 __ Branch(&return_right); |
| 1903 | 1903 |
| 1904 __ bind(&check_zero); | 1904 __ bind(&check_zero); |
| 1905 // left == right != 0. | 1905 // left == right != 0. |
| 1906 __ BranchF(&return_left, NULL, ne, left_reg, kDoubleRegZero); | 1906 __ BranchF(&return_left, NULL, ne, left_reg, kDoubleRegZero); |
| 1907 // At this point, both left and right are either 0 or -0. | 1907 // At this point, both left and right are either 0 or -0. |
| 1908 if (operation == HMathMinMax::kMathMin) { | 1908 if (operation == HMathMinMax::kMathMin) { |
| 1909 // The algorithm is: -((-L) + (-R)), which in case of L and R being |
| 1910 // different registers is most efficiently expressed as -((-L) - R). |
| 1909 __ neg_d(left_reg, left_reg); | 1911 __ neg_d(left_reg, left_reg); |
| 1910 __ sub_d(result_reg, left_reg, right_reg); | 1912 if (left_reg.is(right_reg)) { |
| 1913 __ add_d(result_reg, left_reg, right_reg); |
| 1914 } else { |
| 1915 __ sub_d(result_reg, left_reg, right_reg); |
| 1916 } |
| 1911 __ neg_d(result_reg, result_reg); | 1917 __ neg_d(result_reg, result_reg); |
| 1912 } else { | 1918 } else { |
| 1913 __ add_d(result_reg, left_reg, right_reg); | 1919 __ add_d(result_reg, left_reg, right_reg); |
| 1914 } | 1920 } |
| 1915 __ Branch(&done); | 1921 __ Branch(&done); |
| 1916 | 1922 |
| 1917 __ bind(&check_nan_left); | 1923 __ bind(&check_nan_left); |
| 1918 // left == NaN. | 1924 // left == NaN. |
| 1919 __ BranchF(NULL, &return_left, eq, left_reg, left_reg); | 1925 __ BranchF(NULL, &return_left, eq, left_reg, left_reg); |
| 1920 __ bind(&return_right); | 1926 __ bind(&return_right); |
| (...skipping 3852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5773 __ Push(at, ToRegister(instr->function())); | 5779 __ Push(at, ToRegister(instr->function())); |
| 5774 CallRuntime(Runtime::kPushBlockContext, instr); | 5780 CallRuntime(Runtime::kPushBlockContext, instr); |
| 5775 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5781 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5776 } | 5782 } |
| 5777 | 5783 |
| 5778 | 5784 |
| 5779 #undef __ | 5785 #undef __ |
| 5780 | 5786 |
| 5781 } // namespace internal | 5787 } // namespace internal |
| 5782 } // namespace v8 | 5788 } // namespace v8 |
| OLD | NEW |