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 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 void MacroAssembler::Movmskpd(Register dst, XMMRegister src) { | 2622 void MacroAssembler::Movmskpd(Register dst, XMMRegister src) { |
2623 if (CpuFeatures::IsSupported(AVX)) { | 2623 if (CpuFeatures::IsSupported(AVX)) { |
2624 CpuFeatureScope scope(this, AVX); | 2624 CpuFeatureScope scope(this, AVX); |
2625 vmovmskpd(dst, src); | 2625 vmovmskpd(dst, src); |
2626 } else { | 2626 } else { |
2627 movmskpd(dst, src); | 2627 movmskpd(dst, src); |
2628 } | 2628 } |
2629 } | 2629 } |
2630 | 2630 |
2631 | 2631 |
| 2632 void MacroAssembler::Ucomiss(XMMRegister src1, XMMRegister src2) { |
| 2633 if (CpuFeatures::IsSupported(AVX)) { |
| 2634 CpuFeatureScope scope(this, AVX); |
| 2635 vucomiss(src1, src2); |
| 2636 } else { |
| 2637 ucomiss(src1, src2); |
| 2638 } |
| 2639 } |
| 2640 |
| 2641 |
| 2642 void MacroAssembler::Ucomiss(XMMRegister src1, const Operand& src2) { |
| 2643 if (CpuFeatures::IsSupported(AVX)) { |
| 2644 CpuFeatureScope scope(this, AVX); |
| 2645 vucomiss(src1, src2); |
| 2646 } else { |
| 2647 ucomiss(src1, src2); |
| 2648 } |
| 2649 } |
| 2650 |
| 2651 |
| 2652 void MacroAssembler::Ucomisd(XMMRegister src1, XMMRegister src2) { |
| 2653 if (CpuFeatures::IsSupported(AVX)) { |
| 2654 CpuFeatureScope scope(this, AVX); |
| 2655 vucomisd(src1, src2); |
| 2656 } else { |
| 2657 ucomisd(src1, src2); |
| 2658 } |
| 2659 } |
| 2660 |
| 2661 |
| 2662 void MacroAssembler::Ucomisd(XMMRegister src1, const Operand& src2) { |
| 2663 if (CpuFeatures::IsSupported(AVX)) { |
| 2664 CpuFeatureScope scope(this, AVX); |
| 2665 vucomisd(src1, src2); |
| 2666 } else { |
| 2667 ucomisd(src1, src2); |
| 2668 } |
| 2669 } |
| 2670 |
| 2671 |
2632 void MacroAssembler::Xorpd(XMMRegister dst, XMMRegister src) { | 2672 void MacroAssembler::Xorpd(XMMRegister dst, XMMRegister src) { |
2633 if (CpuFeatures::IsSupported(AVX)) { | 2673 if (CpuFeatures::IsSupported(AVX)) { |
2634 CpuFeatureScope scope(this, AVX); | 2674 CpuFeatureScope scope(this, AVX); |
2635 vxorpd(dst, dst, src); | 2675 vxorpd(dst, dst, src); |
2636 } else { | 2676 } else { |
2637 xorpd(dst, src); | 2677 xorpd(dst, src); |
2638 } | 2678 } |
2639 } | 2679 } |
2640 | 2680 |
2641 | 2681 |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3340 j(zero, &done, Label::kNear); | 3380 j(zero, &done, Label::kNear); |
3341 cmpl(result_reg, Immediate(1)); | 3381 cmpl(result_reg, Immediate(1)); |
3342 j(overflow, &conv_failure, Label::kNear); | 3382 j(overflow, &conv_failure, Label::kNear); |
3343 movl(result_reg, Immediate(0)); | 3383 movl(result_reg, Immediate(0)); |
3344 setcc(sign, result_reg); | 3384 setcc(sign, result_reg); |
3345 subl(result_reg, Immediate(1)); | 3385 subl(result_reg, Immediate(1)); |
3346 andl(result_reg, Immediate(255)); | 3386 andl(result_reg, Immediate(255)); |
3347 jmp(&done, Label::kNear); | 3387 jmp(&done, Label::kNear); |
3348 bind(&conv_failure); | 3388 bind(&conv_failure); |
3349 Set(result_reg, 0); | 3389 Set(result_reg, 0); |
3350 ucomisd(input_reg, temp_xmm_reg); | 3390 Ucomisd(input_reg, temp_xmm_reg); |
3351 j(below, &done, Label::kNear); | 3391 j(below, &done, Label::kNear); |
3352 Set(result_reg, 255); | 3392 Set(result_reg, 255); |
3353 bind(&done); | 3393 bind(&done); |
3354 } | 3394 } |
3355 | 3395 |
3356 | 3396 |
3357 void MacroAssembler::LoadUint32(XMMRegister dst, | 3397 void MacroAssembler::LoadUint32(XMMRegister dst, |
3358 Register src) { | 3398 Register src) { |
3359 if (FLAG_debug_code) { | 3399 if (FLAG_debug_code) { |
3360 cmpq(src, Immediate(0xffffffff)); | 3400 cmpq(src, Immediate(0xffffffff)); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3414 } | 3454 } |
3415 | 3455 |
3416 | 3456 |
3417 void MacroAssembler::DoubleToI(Register result_reg, XMMRegister input_reg, | 3457 void MacroAssembler::DoubleToI(Register result_reg, XMMRegister input_reg, |
3418 XMMRegister scratch, | 3458 XMMRegister scratch, |
3419 MinusZeroMode minus_zero_mode, | 3459 MinusZeroMode minus_zero_mode, |
3420 Label* lost_precision, Label* is_nan, | 3460 Label* lost_precision, Label* is_nan, |
3421 Label* minus_zero, Label::Distance dst) { | 3461 Label* minus_zero, Label::Distance dst) { |
3422 Cvttsd2si(result_reg, input_reg); | 3462 Cvttsd2si(result_reg, input_reg); |
3423 Cvtlsi2sd(xmm0, result_reg); | 3463 Cvtlsi2sd(xmm0, result_reg); |
3424 ucomisd(xmm0, input_reg); | 3464 Ucomisd(xmm0, input_reg); |
3425 j(not_equal, lost_precision, dst); | 3465 j(not_equal, lost_precision, dst); |
3426 j(parity_even, is_nan, dst); // NaN. | 3466 j(parity_even, is_nan, dst); // NaN. |
3427 if (minus_zero_mode == FAIL_ON_MINUS_ZERO) { | 3467 if (minus_zero_mode == FAIL_ON_MINUS_ZERO) { |
3428 Label done; | 3468 Label done; |
3429 // The integer converted back is equal to the original. We | 3469 // The integer converted back is equal to the original. We |
3430 // only have to test if we got -0 as an input. | 3470 // only have to test if we got -0 as an input. |
3431 testl(result_reg, result_reg); | 3471 testl(result_reg, result_reg); |
3432 j(not_zero, &done, Label::kNear); | 3472 j(not_zero, &done, Label::kNear); |
3433 Movmskpd(result_reg, input_reg); | 3473 Movmskpd(result_reg, input_reg); |
3434 // Bit 0 contains the sign of the double in input_reg. | 3474 // Bit 0 contains the sign of the double in input_reg. |
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5251 movl(rax, dividend); | 5291 movl(rax, dividend); |
5252 shrl(rax, Immediate(31)); | 5292 shrl(rax, Immediate(31)); |
5253 addl(rdx, rax); | 5293 addl(rdx, rax); |
5254 } | 5294 } |
5255 | 5295 |
5256 | 5296 |
5257 } // namespace internal | 5297 } // namespace internal |
5258 } // namespace v8 | 5298 } // namespace v8 |
5259 | 5299 |
5260 #endif // V8_TARGET_ARCH_X64 | 5300 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |