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 #include "src/x64/assembler-x64.h" | 5 #include "src/x64/assembler-x64.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 | 8 |
9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
10 | 10 |
(...skipping 2995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3006 emit(0x66); | 3006 emit(0x66); |
3007 emit_optional_rex_32(reg); | 3007 emit_optional_rex_32(reg); |
3008 emit(0x0F); | 3008 emit(0x0F); |
3009 emit(0x72); | 3009 emit(0x72); |
3010 emit_sse_operand(rdx, reg); // rdx == 2 | 3010 emit_sse_operand(rdx, reg); // rdx == 2 |
3011 emit(imm8); | 3011 emit(imm8); |
3012 } | 3012 } |
3013 | 3013 |
3014 | 3014 |
3015 void Assembler::cvttss2si(Register dst, const Operand& src) { | 3015 void Assembler::cvttss2si(Register dst, const Operand& src) { |
| 3016 DCHECK(!IsEnabled(AVX)); |
3016 EnsureSpace ensure_space(this); | 3017 EnsureSpace ensure_space(this); |
3017 emit(0xF3); | 3018 emit(0xF3); |
3018 emit_optional_rex_32(dst, src); | 3019 emit_optional_rex_32(dst, src); |
3019 emit(0x0F); | 3020 emit(0x0F); |
3020 emit(0x2C); | 3021 emit(0x2C); |
3021 emit_operand(dst, src); | 3022 emit_operand(dst, src); |
3022 } | 3023 } |
3023 | 3024 |
3024 | 3025 |
3025 void Assembler::cvttss2si(Register dst, XMMRegister src) { | 3026 void Assembler::cvttss2si(Register dst, XMMRegister src) { |
| 3027 DCHECK(!IsEnabled(AVX)); |
3026 EnsureSpace ensure_space(this); | 3028 EnsureSpace ensure_space(this); |
3027 emit(0xF3); | 3029 emit(0xF3); |
3028 emit_optional_rex_32(dst, src); | 3030 emit_optional_rex_32(dst, src); |
3029 emit(0x0F); | 3031 emit(0x0F); |
3030 emit(0x2C); | 3032 emit(0x2C); |
3031 emit_sse_operand(dst, src); | 3033 emit_sse_operand(dst, src); |
3032 } | 3034 } |
3033 | 3035 |
3034 | 3036 |
3035 void Assembler::cvttsd2si(Register dst, const Operand& src) { | 3037 void Assembler::cvttsd2si(Register dst, const Operand& src) { |
| 3038 DCHECK(!IsEnabled(AVX)); |
3036 EnsureSpace ensure_space(this); | 3039 EnsureSpace ensure_space(this); |
3037 emit(0xF2); | 3040 emit(0xF2); |
3038 emit_optional_rex_32(dst, src); | 3041 emit_optional_rex_32(dst, src); |
3039 emit(0x0F); | 3042 emit(0x0F); |
3040 emit(0x2C); | 3043 emit(0x2C); |
3041 emit_operand(dst, src); | 3044 emit_operand(dst, src); |
3042 } | 3045 } |
3043 | 3046 |
3044 | 3047 |
3045 void Assembler::cvttsd2si(Register dst, XMMRegister src) { | 3048 void Assembler::cvttsd2si(Register dst, XMMRegister src) { |
| 3049 DCHECK(!IsEnabled(AVX)); |
3046 EnsureSpace ensure_space(this); | 3050 EnsureSpace ensure_space(this); |
3047 emit(0xF2); | 3051 emit(0xF2); |
3048 emit_optional_rex_32(dst, src); | 3052 emit_optional_rex_32(dst, src); |
3049 emit(0x0F); | 3053 emit(0x0F); |
3050 emit(0x2C); | 3054 emit(0x2C); |
3051 emit_sse_operand(dst, src); | 3055 emit_sse_operand(dst, src); |
3052 } | 3056 } |
3053 | 3057 |
3054 | 3058 |
3055 void Assembler::cvttsd2siq(Register dst, XMMRegister src) { | 3059 void Assembler::cvttsd2siq(Register dst, XMMRegister src) { |
| 3060 DCHECK(!IsEnabled(AVX)); |
3056 EnsureSpace ensure_space(this); | 3061 EnsureSpace ensure_space(this); |
3057 emit(0xF2); | 3062 emit(0xF2); |
3058 emit_rex_64(dst, src); | 3063 emit_rex_64(dst, src); |
3059 emit(0x0F); | 3064 emit(0x0F); |
3060 emit(0x2C); | 3065 emit(0x2C); |
3061 emit_sse_operand(dst, src); | 3066 emit_sse_operand(dst, src); |
3062 } | 3067 } |
3063 | 3068 |
3064 | 3069 |
3065 void Assembler::cvttsd2siq(Register dst, const Operand& src) { | 3070 void Assembler::cvttsd2siq(Register dst, const Operand& src) { |
| 3071 DCHECK(!IsEnabled(AVX)); |
3066 EnsureSpace ensure_space(this); | 3072 EnsureSpace ensure_space(this); |
3067 emit(0xF2); | 3073 emit(0xF2); |
3068 emit_rex_64(dst, src); | 3074 emit_rex_64(dst, src); |
3069 emit(0x0F); | 3075 emit(0x0F); |
3070 emit(0x2C); | 3076 emit(0x2C); |
3071 emit_sse_operand(dst, src); | 3077 emit_sse_operand(dst, src); |
3072 } | 3078 } |
3073 | 3079 |
3074 | 3080 |
3075 void Assembler::cvtlsi2sd(XMMRegister dst, const Operand& src) { | 3081 void Assembler::cvtlsi2sd(XMMRegister dst, const Operand& src) { |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3544 XMMRegister idst = {dst.code()}; | 3550 XMMRegister idst = {dst.code()}; |
3545 emit_vex_prefix(src, xmm0, idst, kL128, k66, k0F, kW1); | 3551 emit_vex_prefix(src, xmm0, idst, kL128, k66, k0F, kW1); |
3546 emit(0x7e); | 3552 emit(0x7e); |
3547 emit_sse_operand(src, dst); | 3553 emit_sse_operand(src, dst); |
3548 } | 3554 } |
3549 | 3555 |
3550 | 3556 |
3551 void Assembler::vmovapd(XMMRegister dst, XMMRegister src) { | 3557 void Assembler::vmovapd(XMMRegister dst, XMMRegister src) { |
3552 DCHECK(IsEnabled(AVX)); | 3558 DCHECK(IsEnabled(AVX)); |
3553 EnsureSpace ensure_space(this); | 3559 EnsureSpace ensure_space(this); |
3554 emit_vex_prefix(dst, xmm0, src, kLIG, k66, k0F, kWIG); | 3560 emit_vex_prefix(dst, xmm0, src, kL128, k66, k0F, kWIG); |
3555 emit(0x28); | 3561 emit(0x28); |
3556 emit_sse_operand(dst, src); | 3562 emit_sse_operand(dst, src); |
3557 } | 3563 } |
3558 | 3564 |
3559 | 3565 |
3560 void Assembler::vucomisd(XMMRegister dst, XMMRegister src) { | 3566 void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1, |
| 3567 XMMRegister src2, SIMDPrefix pp, LeadingOpcode m, VexW w) { |
3561 DCHECK(IsEnabled(AVX)); | 3568 DCHECK(IsEnabled(AVX)); |
3562 EnsureSpace ensure_space(this); | 3569 EnsureSpace ensure_space(this); |
3563 emit_vex_prefix(dst, xmm0, src, kLIG, k66, k0F, kWIG); | 3570 emit_vex_prefix(dst, src1, src2, kLIG, pp, m, w); |
3564 emit(0x2e); | |
3565 emit_sse_operand(dst, src); | |
3566 } | |
3567 | |
3568 | |
3569 void Assembler::vucomisd(XMMRegister dst, const Operand& src) { | |
3570 DCHECK(IsEnabled(AVX)); | |
3571 EnsureSpace ensure_space(this); | |
3572 emit_vex_prefix(dst, xmm0, src, kLIG, k66, k0F, kWIG); | |
3573 emit(0x2e); | |
3574 emit_sse_operand(dst, src); | |
3575 } | |
3576 | |
3577 | |
3578 void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1, | |
3579 XMMRegister src2) { | |
3580 DCHECK(IsEnabled(AVX)); | |
3581 EnsureSpace ensure_space(this); | |
3582 emit_vex_prefix(dst, src1, src2, kLIG, kF2, k0F, kWIG); | |
3583 emit(op); | 3571 emit(op); |
3584 emit_sse_operand(dst, src2); | 3572 emit_sse_operand(dst, src2); |
3585 } | 3573 } |
3586 | 3574 |
3587 | 3575 |
3588 void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1, | 3576 void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1, |
3589 const Operand& src2) { | 3577 const Operand& src2, SIMDPrefix pp, LeadingOpcode m, |
| 3578 VexW w) { |
3590 DCHECK(IsEnabled(AVX)); | 3579 DCHECK(IsEnabled(AVX)); |
3591 EnsureSpace ensure_space(this); | 3580 EnsureSpace ensure_space(this); |
3592 emit_vex_prefix(dst, src1, src2, kLIG, kF2, k0F, kWIG); | 3581 emit_vex_prefix(dst, src1, src2, kLIG, pp, m, w); |
3593 emit(op); | 3582 emit(op); |
3594 emit_sse_operand(dst, src2); | 3583 emit_sse_operand(dst, src2); |
3595 } | 3584 } |
3596 | 3585 |
3597 | 3586 |
3598 void Assembler::vps(byte op, XMMRegister dst, XMMRegister src1, | 3587 void Assembler::vps(byte op, XMMRegister dst, XMMRegister src1, |
3599 XMMRegister src2) { | 3588 XMMRegister src2) { |
3600 DCHECK(IsEnabled(AVX)); | 3589 DCHECK(IsEnabled(AVX)); |
3601 EnsureSpace ensure_space(this); | 3590 EnsureSpace ensure_space(this); |
3602 emit_vex_prefix(dst, src1, src2, kL128, kNone, k0F, kWIG); | 3591 emit_vex_prefix(dst, src1, src2, kL128, kNone, k0F, kWIG); |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4028 | 4017 |
4029 bool RelocInfo::IsInConstantPool() { | 4018 bool RelocInfo::IsInConstantPool() { |
4030 return false; | 4019 return false; |
4031 } | 4020 } |
4032 | 4021 |
4033 | 4022 |
4034 } // namespace internal | 4023 } // namespace internal |
4035 } // namespace v8 | 4024 } // namespace v8 |
4036 | 4025 |
4037 #endif // V8_TARGET_ARCH_X64 | 4026 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |