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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 3748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3759 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 3759 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
3760 | 3760 |
3761 if (CpuFeatures::IsSupported(SSE4_1)) { | 3761 if (CpuFeatures::IsSupported(SSE4_1)) { |
3762 CpuFeatureScope scope(masm(), SSE4_1); | 3762 CpuFeatureScope scope(masm(), SSE4_1); |
3763 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 3763 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
3764 // Deoptimize if minus zero. | 3764 // Deoptimize if minus zero. |
3765 __ movq(output_reg, input_reg); | 3765 __ movq(output_reg, input_reg); |
3766 __ subq(output_reg, Immediate(1)); | 3766 __ subq(output_reg, Immediate(1)); |
3767 DeoptimizeIf(overflow, instr, Deoptimizer::kMinusZero); | 3767 DeoptimizeIf(overflow, instr, Deoptimizer::kMinusZero); |
3768 } | 3768 } |
3769 __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown); | 3769 __ roundsd(xmm_scratch, input_reg, kRoundDown); |
3770 __ cvttsd2si(output_reg, xmm_scratch); | 3770 __ cvttsd2si(output_reg, xmm_scratch); |
3771 __ cmpl(output_reg, Immediate(0x1)); | 3771 __ cmpl(output_reg, Immediate(0x1)); |
3772 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow); | 3772 DeoptimizeIf(overflow, instr, Deoptimizer::kOverflow); |
3773 } else { | 3773 } else { |
3774 Label negative_sign, done; | 3774 Label negative_sign, done; |
3775 // Deoptimize on unordered. | 3775 // Deoptimize on unordered. |
3776 __ xorps(xmm_scratch, xmm_scratch); // Zero the register. | 3776 __ xorps(xmm_scratch, xmm_scratch); // Zero the register. |
3777 __ ucomisd(input_reg, xmm_scratch); | 3777 __ ucomisd(input_reg, xmm_scratch); |
3778 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN); | 3778 DeoptimizeIf(parity_even, instr, Deoptimizer::kNaN); |
3779 __ j(below, &negative_sign, Label::kNear); | 3779 __ j(below, &negative_sign, Label::kNear); |
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5939 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5939 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5940 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5940 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5941 } | 5941 } |
5942 | 5942 |
5943 | 5943 |
5944 #undef __ | 5944 #undef __ |
5945 | 5945 |
5946 } } // namespace v8::internal | 5946 } } // namespace v8::internal |
5947 | 5947 |
5948 #endif // V8_TARGET_ARCH_X64 | 5948 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |