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

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

Issue 1420653005: [x64] Implemennt vroundsd AVX instruction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/compiler/x64/code-generator-x64.cc ('k') | src/x64/assembler-x64.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" 7 #include "src/crankshaft/x64/lithium-codegen-x64.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 3578 matching lines...) Expand 10 before | Expand all | Expand 10 after
3589 XMMRegister input_reg = ToDoubleRegister(instr->value()); 3589 XMMRegister input_reg = ToDoubleRegister(instr->value());
3590 3590
3591 if (CpuFeatures::IsSupported(SSE4_1)) { 3591 if (CpuFeatures::IsSupported(SSE4_1)) {
3592 CpuFeatureScope scope(masm(), SSE4_1); 3592 CpuFeatureScope scope(masm(), SSE4_1);
3593 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { 3593 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
3594 // Deoptimize if minus zero. 3594 // Deoptimize if minus zero.
3595 __ Movq(output_reg, input_reg); 3595 __ Movq(output_reg, input_reg);
3596 __ subq(output_reg, Immediate(1)); 3596 __ subq(output_reg, Immediate(1));
3597 DeoptimizeIf(overflow, instr, Deoptimizer::kMinusZero); 3597 DeoptimizeIf(overflow, instr, Deoptimizer::kMinusZero);
3598 } 3598 }
3599 __ roundsd(xmm_scratch, input_reg, kRoundDown); 3599 __ Roundsd(xmm_scratch, input_reg, kRoundDown);
3600 __ Cvttsd2si(output_reg, xmm_scratch); 3600 __ Cvttsd2si(output_reg, xmm_scratch);
3601 __ cmpl(output_reg, Immediate(0x1)); 3601 __ cmpl(output_reg, Immediate(0x1));
3602 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow); 3602 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow);
3603 } else { 3603 } else {
3604 Label negative_sign, done; 3604 Label negative_sign, done;
3605 // Deoptimize on unordered. 3605 // Deoptimize on unordered.
3606 __ Xorpd(xmm_scratch, xmm_scratch); // Zero the register. 3606 __ Xorpd(xmm_scratch, xmm_scratch); // Zero the register.
3607 __ Ucomisd(input_reg, xmm_scratch); 3607 __ Ucomisd(input_reg, xmm_scratch);
3608 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN); 3608 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN);
3609 __ j(below, &negative_sign, Label::kNear); 3609 __ j(below, &negative_sign, Label::kNear);
(...skipping 2259 matching lines...) Expand 10 before | Expand all | Expand 10 after
5869 RecordSafepoint(Safepoint::kNoLazyDeopt); 5869 RecordSafepoint(Safepoint::kNoLazyDeopt);
5870 } 5870 }
5871 5871
5872 5872
5873 #undef __ 5873 #undef __
5874 5874
5875 } // namespace internal 5875 } // namespace internal
5876 } // namespace v8 5876 } // namespace v8
5877 5877
5878 #endif // V8_TARGET_ARCH_X64 5878 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/compiler/x64/code-generator-x64.cc ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698