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

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

Issue 2175243002: [X87] [crankshaft] Fix Math.max(-0, 0) bug. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updated the bug description according to Jakob's comment Created 4 years, 5 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 | no next file » | 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 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" 7 #include "src/crankshaft/x87/lithium-codegen-x87.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after
1962 __ fld(1); 1962 __ fld(1);
1963 __ sub(esp, Immediate(2 * kPointerSize)); 1963 __ sub(esp, Immediate(2 * kPointerSize));
1964 __ fstp_s(MemOperand(esp, 0)); 1964 __ fstp_s(MemOperand(esp, 0));
1965 __ fstp_s(MemOperand(esp, kPointerSize)); 1965 __ fstp_s(MemOperand(esp, kPointerSize));
1966 __ pop(scratch_reg); 1966 __ pop(scratch_reg);
1967 __ or_(MemOperand(esp, 0), scratch_reg); 1967 __ or_(MemOperand(esp, 0), scratch_reg);
1968 X87Mov(left_reg, MemOperand(esp, 0), kX87FloatOperand); 1968 X87Mov(left_reg, MemOperand(esp, 0), kX87FloatOperand);
1969 __ pop(scratch_reg); // restore esp 1969 __ pop(scratch_reg); // restore esp
1970 } else { 1970 } else {
1971 // Since we operate on +0 and/or -0, addsd and andsd have the same effect. 1971 // Since we operate on +0 and/or -0, addsd and andsd have the same effect.
1972 X87Fxch(left_reg); 1972 // Should put the result in stX0
1973 __ fadd(1); 1973 __ fadd_i(1);
1974 } 1974 }
1975 __ jmp(&return_left, Label::kNear); 1975 __ jmp(&return_left, Label::kNear);
1976 1976
1977 __ bind(&check_nan_left); 1977 __ bind(&check_nan_left);
1978 __ fld(0); 1978 __ fld(0);
1979 __ fld(0); 1979 __ fld(0);
1980 __ FCmp(); // NaN check. 1980 __ FCmp(); // NaN check.
1981 __ j(parity_even, &return_left, Label::kNear); // left == NaN. 1981 __ j(parity_even, &return_left, Label::kNear); // left == NaN.
1982 1982
1983 __ bind(&return_right); 1983 __ bind(&return_right);
1984 X87Fxch(left_reg);
1985 X87Mov(left_reg, right_reg); 1984 X87Mov(left_reg, right_reg);
1986 1985
1987 __ bind(&return_left); 1986 __ bind(&return_left);
1988 } 1987 }
1989 } 1988 }
1990 1989
1991 1990
1992 void LCodeGen::DoArithmeticD(LArithmeticD* instr) { 1991 void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
1993 X87Register left = ToX87Register(instr->left()); 1992 X87Register left = ToX87Register(instr->left());
1994 X87Register right = ToX87Register(instr->right()); 1993 X87Register right = ToX87Register(instr->right());
(...skipping 3778 matching lines...) Expand 10 before | Expand all | Expand 10 after
5773 __ bind(deferred->exit()); 5772 __ bind(deferred->exit());
5774 __ bind(&done); 5773 __ bind(&done);
5775 } 5774 }
5776 5775
5777 #undef __ 5776 #undef __
5778 5777
5779 } // namespace internal 5778 } // namespace internal
5780 } // namespace v8 5779 } // namespace v8
5781 5780
5782 #endif // V8_TARGET_ARCH_X87 5781 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698