OLD | NEW |
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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2572 void MacroAssembler::Movq(Register dst, XMMRegister src) { | 2572 void MacroAssembler::Movq(Register dst, XMMRegister src) { |
2573 if (CpuFeatures::IsSupported(AVX)) { | 2573 if (CpuFeatures::IsSupported(AVX)) { |
2574 CpuFeatureScope scope(this, AVX); | 2574 CpuFeatureScope scope(this, AVX); |
2575 vmovq(dst, src); | 2575 vmovq(dst, src); |
2576 } else { | 2576 } else { |
2577 movq(dst, src); | 2577 movq(dst, src); |
2578 } | 2578 } |
2579 } | 2579 } |
2580 | 2580 |
2581 | 2581 |
| 2582 void MacroAssembler::Movmskpd(Register dst, XMMRegister src) { |
| 2583 if (CpuFeatures::IsSupported(AVX)) { |
| 2584 CpuFeatureScope scope(this, AVX); |
| 2585 vmovmskpd(dst, src); |
| 2586 } else { |
| 2587 movmskpd(dst, src); |
| 2588 } |
| 2589 } |
| 2590 |
| 2591 |
2582 void MacroAssembler::Xorpd(XMMRegister dst, XMMRegister src) { | 2592 void MacroAssembler::Xorpd(XMMRegister dst, XMMRegister src) { |
2583 if (CpuFeatures::IsSupported(AVX)) { | 2593 if (CpuFeatures::IsSupported(AVX)) { |
2584 CpuFeatureScope scope(this, AVX); | 2594 CpuFeatureScope scope(this, AVX); |
2585 vxorpd(dst, dst, src); | 2595 vxorpd(dst, dst, src); |
2586 } else { | 2596 } else { |
2587 xorpd(dst, src); | 2597 xorpd(dst, src); |
2588 } | 2598 } |
2589 } | 2599 } |
2590 | 2600 |
2591 | 2601 |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3373 Cvtlsi2sd(xmm0, result_reg); | 3383 Cvtlsi2sd(xmm0, result_reg); |
3374 ucomisd(xmm0, input_reg); | 3384 ucomisd(xmm0, input_reg); |
3375 j(not_equal, lost_precision, dst); | 3385 j(not_equal, lost_precision, dst); |
3376 j(parity_even, is_nan, dst); // NaN. | 3386 j(parity_even, is_nan, dst); // NaN. |
3377 if (minus_zero_mode == FAIL_ON_MINUS_ZERO) { | 3387 if (minus_zero_mode == FAIL_ON_MINUS_ZERO) { |
3378 Label done; | 3388 Label done; |
3379 // The integer converted back is equal to the original. We | 3389 // The integer converted back is equal to the original. We |
3380 // only have to test if we got -0 as an input. | 3390 // only have to test if we got -0 as an input. |
3381 testl(result_reg, result_reg); | 3391 testl(result_reg, result_reg); |
3382 j(not_zero, &done, Label::kNear); | 3392 j(not_zero, &done, Label::kNear); |
3383 movmskpd(result_reg, input_reg); | 3393 Movmskpd(result_reg, input_reg); |
3384 // Bit 0 contains the sign of the double in input_reg. | 3394 // Bit 0 contains the sign of the double in input_reg. |
3385 // If input was positive, we are ok and return 0, otherwise | 3395 // If input was positive, we are ok and return 0, otherwise |
3386 // jump to minus_zero. | 3396 // jump to minus_zero. |
3387 andl(result_reg, Immediate(1)); | 3397 andl(result_reg, Immediate(1)); |
3388 j(not_zero, minus_zero, dst); | 3398 j(not_zero, minus_zero, dst); |
3389 bind(&done); | 3399 bind(&done); |
3390 } | 3400 } |
3391 } | 3401 } |
3392 | 3402 |
3393 | 3403 |
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5201 movl(rax, dividend); | 5211 movl(rax, dividend); |
5202 shrl(rax, Immediate(31)); | 5212 shrl(rax, Immediate(31)); |
5203 addl(rdx, rax); | 5213 addl(rdx, rax); |
5204 } | 5214 } |
5205 | 5215 |
5206 | 5216 |
5207 } // namespace internal | 5217 } // namespace internal |
5208 } // namespace v8 | 5218 } // namespace v8 |
5209 | 5219 |
5210 #endif // V8_TARGET_ARCH_X64 | 5220 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |