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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 990963003: [turbofan] Unify Math.floor / Math.ceil optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « src/ia32/assembler-ia32.h ('k') | src/math.js » ('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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
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 3680 matching lines...) Expand 10 before | Expand all | Expand 10 after
3691 // Deoptimize on negative zero. 3691 // Deoptimize on negative zero.
3692 Label non_zero; 3692 Label non_zero;
3693 __ xorps(xmm_scratch, xmm_scratch); // Zero the register. 3693 __ xorps(xmm_scratch, xmm_scratch); // Zero the register.
3694 __ ucomisd(input_reg, xmm_scratch); 3694 __ ucomisd(input_reg, xmm_scratch);
3695 __ j(not_equal, &non_zero, Label::kNear); 3695 __ j(not_equal, &non_zero, Label::kNear);
3696 __ movmskpd(output_reg, input_reg); 3696 __ movmskpd(output_reg, input_reg);
3697 __ test(output_reg, Immediate(1)); 3697 __ test(output_reg, Immediate(1));
3698 DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero); 3698 DeoptimizeIf(not_zero, instr, Deoptimizer::kMinusZero);
3699 __ bind(&non_zero); 3699 __ bind(&non_zero);
3700 } 3700 }
3701 __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown); 3701 __ roundsd(xmm_scratch, input_reg, kRoundDown);
3702 __ cvttsd2si(output_reg, Operand(xmm_scratch)); 3702 __ cvttsd2si(output_reg, Operand(xmm_scratch));
3703 // Overflow is signalled with minint. 3703 // Overflow is signalled with minint.
3704 __ cmp(output_reg, 0x1); 3704 __ cmp(output_reg, 0x1);
3705 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow); 3705 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
3706 } else { 3706 } else {
3707 Label negative_sign, done; 3707 Label negative_sign, done;
3708 // Deoptimize on unordered. 3708 // Deoptimize on unordered.
3709 __ xorps(xmm_scratch, xmm_scratch); // Zero the register. 3709 __ xorps(xmm_scratch, xmm_scratch); // Zero the register.
3710 __ ucomisd(input_reg, xmm_scratch); 3710 __ ucomisd(input_reg, xmm_scratch);
3711 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN); 3711 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN);
(...skipping 2069 matching lines...) Expand 10 before | Expand all | Expand 10 after
5781 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5781 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5782 RecordSafepoint(Safepoint::kNoLazyDeopt); 5782 RecordSafepoint(Safepoint::kNoLazyDeopt);
5783 } 5783 }
5784 5784
5785 5785
5786 #undef __ 5786 #undef __
5787 5787
5788 } } // namespace v8::internal 5788 } } // namespace v8::internal
5789 5789
5790 #endif // V8_TARGET_ARCH_IA32 5790 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698