Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: src/crankshaft/arm/lithium-codegen-arm.cc

Issue 1695283002: [crankshaft][arm][mips] Fix Math.min(0, 0) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips64 too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/arm/lithium-codegen-arm.h" 5 #include "src/crankshaft/arm/lithium-codegen-arm.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h"
(...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 // Left equals right => check for -0. 1925 // Left equals right => check for -0.
1926 __ VFPCompareAndSetFlags(left_reg, 0.0); 1926 __ VFPCompareAndSetFlags(left_reg, 0.0);
1927 if (left_reg.is(result_reg) || right_reg.is(result_reg)) { 1927 if (left_reg.is(result_reg) || right_reg.is(result_reg)) {
1928 __ b(ne, &done); // left == right != 0. 1928 __ b(ne, &done); // left == right != 0.
1929 } else { 1929 } else {
1930 __ b(ne, &return_left); // left == right != 0. 1930 __ b(ne, &return_left); // left == right != 0.
1931 } 1931 }
1932 // At this point, both left and right are either 0 or -0. 1932 // At this point, both left and right are either 0 or -0.
1933 if (operation == HMathMinMax::kMathMin) { 1933 if (operation == HMathMinMax::kMathMin) {
1934 // We could use a single 'vorr' instruction here if we had NEON support. 1934 // We could use a single 'vorr' instruction here if we had NEON support.
1935 // The algorithm is: -((-L) + (-R)), which in case of L and R being
1936 // different registers is most efficiently expressed as -((-L) - R).
1935 __ vneg(left_reg, left_reg); 1937 __ vneg(left_reg, left_reg);
1936 __ vsub(result_reg, left_reg, right_reg); 1938 if (left_reg.is(right_reg)) {
1939 __ vadd(result_reg, left_reg, right_reg);
1940 } else {
1941 __ vsub(result_reg, left_reg, right_reg);
1942 }
1937 __ vneg(result_reg, result_reg); 1943 __ vneg(result_reg, result_reg);
1938 } else { 1944 } else {
1939 // Since we operate on +0 and/or -0, vadd and vand have the same effect; 1945 // Since we operate on +0 and/or -0, vadd and vand have the same effect;
1940 // the decision for vadd is easy because vand is a NEON instruction. 1946 // the decision for vadd is easy because vand is a NEON instruction.
1941 __ vadd(result_reg, left_reg, right_reg); 1947 __ vadd(result_reg, left_reg, right_reg);
1942 } 1948 }
1943 __ b(&done); 1949 __ b(&done);
1944 1950
1945 __ bind(&result_is_nan); 1951 __ bind(&result_is_nan);
1946 __ vadd(result_reg, left_reg, right_reg); 1952 __ vadd(result_reg, left_reg, right_reg);
(...skipping 3604 matching lines...) Expand 10 before | Expand all | Expand 10 after
5551 __ push(ToRegister(instr->function())); 5557 __ push(ToRegister(instr->function()));
5552 CallRuntime(Runtime::kPushBlockContext, instr); 5558 CallRuntime(Runtime::kPushBlockContext, instr);
5553 RecordSafepoint(Safepoint::kNoLazyDeopt); 5559 RecordSafepoint(Safepoint::kNoLazyDeopt);
5554 } 5560 }
5555 5561
5556 5562
5557 #undef __ 5563 #undef __
5558 5564
5559 } // namespace internal 5565 } // namespace internal
5560 } // namespace v8 5566 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698