| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |