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 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2840 void Assembler::divss(XMMRegister dst, const Operand& src) { | 2840 void Assembler::divss(XMMRegister dst, const Operand& src) { |
2841 EnsureSpace ensure_space(this); | 2841 EnsureSpace ensure_space(this); |
2842 emit(0xF3); | 2842 emit(0xF3); |
2843 emit_optional_rex_32(dst, src); | 2843 emit_optional_rex_32(dst, src); |
2844 emit(0x0F); | 2844 emit(0x0F); |
2845 emit(0x5E); | 2845 emit(0x5E); |
2846 emit_sse_operand(dst, src); | 2846 emit_sse_operand(dst, src); |
2847 } | 2847 } |
2848 | 2848 |
2849 | 2849 |
| 2850 void Assembler::maxss(XMMRegister dst, XMMRegister src) { |
| 2851 EnsureSpace ensure_space(this); |
| 2852 emit(0xF3); |
| 2853 emit_optional_rex_32(dst, src); |
| 2854 emit(0x0F); |
| 2855 emit(0x5F); |
| 2856 emit_sse_operand(dst, src); |
| 2857 } |
| 2858 |
| 2859 |
| 2860 void Assembler::maxss(XMMRegister dst, const Operand& src) { |
| 2861 EnsureSpace ensure_space(this); |
| 2862 emit(0xF3); |
| 2863 emit_optional_rex_32(dst, src); |
| 2864 emit(0x0F); |
| 2865 emit(0x5F); |
| 2866 emit_sse_operand(dst, src); |
| 2867 } |
| 2868 |
| 2869 |
| 2870 void Assembler::minss(XMMRegister dst, XMMRegister src) { |
| 2871 EnsureSpace ensure_space(this); |
| 2872 emit(0xF3); |
| 2873 emit_optional_rex_32(dst, src); |
| 2874 emit(0x0F); |
| 2875 emit(0x5D); |
| 2876 emit_sse_operand(dst, src); |
| 2877 } |
| 2878 |
| 2879 |
| 2880 void Assembler::minss(XMMRegister dst, const Operand& src) { |
| 2881 EnsureSpace ensure_space(this); |
| 2882 emit(0xF3); |
| 2883 emit_optional_rex_32(dst, src); |
| 2884 emit(0x0F); |
| 2885 emit(0x5D); |
| 2886 emit_sse_operand(dst, src); |
| 2887 } |
| 2888 |
| 2889 |
| 2890 void Assembler::sqrtss(XMMRegister dst, XMMRegister src) { |
| 2891 EnsureSpace ensure_space(this); |
| 2892 emit(0xF3); |
| 2893 emit_optional_rex_32(dst, src); |
| 2894 emit(0x0F); |
| 2895 emit(0x51); |
| 2896 emit_sse_operand(dst, src); |
| 2897 } |
| 2898 |
| 2899 |
| 2900 void Assembler::sqrtss(XMMRegister dst, const Operand& src) { |
| 2901 EnsureSpace ensure_space(this); |
| 2902 emit(0xF3); |
| 2903 emit_optional_rex_32(dst, src); |
| 2904 emit(0x0F); |
| 2905 emit(0x51); |
| 2906 emit_sse_operand(dst, src); |
| 2907 } |
| 2908 |
| 2909 |
2850 void Assembler::ucomiss(XMMRegister dst, XMMRegister src) { | 2910 void Assembler::ucomiss(XMMRegister dst, XMMRegister src) { |
2851 EnsureSpace ensure_space(this); | 2911 EnsureSpace ensure_space(this); |
2852 emit_optional_rex_32(dst, src); | 2912 emit_optional_rex_32(dst, src); |
2853 emit(0x0f); | 2913 emit(0x0f); |
2854 emit(0x2e); | 2914 emit(0x2e); |
2855 emit_sse_operand(dst, src); | 2915 emit_sse_operand(dst, src); |
2856 } | 2916 } |
2857 | 2917 |
2858 | 2918 |
2859 void Assembler::ucomiss(XMMRegister dst, const Operand& src) { | 2919 void Assembler::ucomiss(XMMRegister dst, const Operand& src) { |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3172 void Assembler::divsd(XMMRegister dst, const Operand& src) { | 3232 void Assembler::divsd(XMMRegister dst, const Operand& src) { |
3173 EnsureSpace ensure_space(this); | 3233 EnsureSpace ensure_space(this); |
3174 emit(0xF2); | 3234 emit(0xF2); |
3175 emit_optional_rex_32(dst, src); | 3235 emit_optional_rex_32(dst, src); |
3176 emit(0x0F); | 3236 emit(0x0F); |
3177 emit(0x5E); | 3237 emit(0x5E); |
3178 emit_sse_operand(dst, src); | 3238 emit_sse_operand(dst, src); |
3179 } | 3239 } |
3180 | 3240 |
3181 | 3241 |
| 3242 void Assembler::maxsd(XMMRegister dst, XMMRegister src) { |
| 3243 EnsureSpace ensure_space(this); |
| 3244 emit(0xF2); |
| 3245 emit_optional_rex_32(dst, src); |
| 3246 emit(0x0F); |
| 3247 emit(0x5F); |
| 3248 emit_sse_operand(dst, src); |
| 3249 } |
| 3250 |
| 3251 |
| 3252 void Assembler::maxsd(XMMRegister dst, const Operand& src) { |
| 3253 EnsureSpace ensure_space(this); |
| 3254 emit(0xF2); |
| 3255 emit_optional_rex_32(dst, src); |
| 3256 emit(0x0F); |
| 3257 emit(0x5F); |
| 3258 emit_sse_operand(dst, src); |
| 3259 } |
| 3260 |
| 3261 |
| 3262 void Assembler::minsd(XMMRegister dst, XMMRegister src) { |
| 3263 EnsureSpace ensure_space(this); |
| 3264 emit(0xF2); |
| 3265 emit_optional_rex_32(dst, src); |
| 3266 emit(0x0F); |
| 3267 emit(0x5D); |
| 3268 emit_sse_operand(dst, src); |
| 3269 } |
| 3270 |
| 3271 |
| 3272 void Assembler::minsd(XMMRegister dst, const Operand& src) { |
| 3273 EnsureSpace ensure_space(this); |
| 3274 emit(0xF2); |
| 3275 emit_optional_rex_32(dst, src); |
| 3276 emit(0x0F); |
| 3277 emit(0x5D); |
| 3278 emit_sse_operand(dst, src); |
| 3279 } |
| 3280 |
| 3281 |
3182 void Assembler::andpd(XMMRegister dst, XMMRegister src) { | 3282 void Assembler::andpd(XMMRegister dst, XMMRegister src) { |
3183 EnsureSpace ensure_space(this); | 3283 EnsureSpace ensure_space(this); |
3184 emit(0x66); | 3284 emit(0x66); |
3185 emit_optional_rex_32(dst, src); | 3285 emit_optional_rex_32(dst, src); |
3186 emit(0x0F); | 3286 emit(0x0F); |
3187 emit(0x54); | 3287 emit(0x54); |
3188 emit_sse_operand(dst, src); | 3288 emit_sse_operand(dst, src); |
3189 } | 3289 } |
3190 | 3290 |
3191 | 3291 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3316 void Assembler::punpckhdq(XMMRegister dst, XMMRegister src) { | 3416 void Assembler::punpckhdq(XMMRegister dst, XMMRegister src) { |
3317 EnsureSpace ensure_space(this); | 3417 EnsureSpace ensure_space(this); |
3318 emit(0x66); | 3418 emit(0x66); |
3319 emit_optional_rex_32(dst, src); | 3419 emit_optional_rex_32(dst, src); |
3320 emit(0x0F); | 3420 emit(0x0F); |
3321 emit(0x6A); | 3421 emit(0x6A); |
3322 emit_sse_operand(dst, src); | 3422 emit_sse_operand(dst, src); |
3323 } | 3423 } |
3324 | 3424 |
3325 | 3425 |
3326 void Assembler::maxsd(XMMRegister dst, XMMRegister src) { | |
3327 EnsureSpace ensure_space(this); | |
3328 emit(0xF2); | |
3329 emit_optional_rex_32(dst, src); | |
3330 emit(0x0F); | |
3331 emit(0x5F); | |
3332 emit_sse_operand(dst, src); | |
3333 } | |
3334 | |
3335 | |
3336 void Assembler::maxsd(XMMRegister dst, const Operand& src) { | |
3337 EnsureSpace ensure_space(this); | |
3338 emit(0xF2); | |
3339 emit_optional_rex_32(dst, src); | |
3340 emit(0x0F); | |
3341 emit(0x5F); | |
3342 emit_sse_operand(dst, src); | |
3343 } | |
3344 | |
3345 | |
3346 void Assembler::minsd(XMMRegister dst, XMMRegister src) { | |
3347 EnsureSpace ensure_space(this); | |
3348 emit(0xF2); | |
3349 emit_optional_rex_32(dst, src); | |
3350 emit(0x0F); | |
3351 emit(0x5D); | |
3352 emit_sse_operand(dst, src); | |
3353 } | |
3354 | |
3355 | |
3356 void Assembler::minsd(XMMRegister dst, const Operand& src) { | |
3357 EnsureSpace ensure_space(this); | |
3358 emit(0xF2); | |
3359 emit_optional_rex_32(dst, src); | |
3360 emit(0x0F); | |
3361 emit(0x5D); | |
3362 emit_sse_operand(dst, src); | |
3363 } | |
3364 | |
3365 | |
3366 // AVX instructions | 3426 // AVX instructions |
3367 void Assembler::vfmasd(byte op, XMMRegister dst, XMMRegister src1, | 3427 void Assembler::vfmasd(byte op, XMMRegister dst, XMMRegister src1, |
3368 XMMRegister src2) { | 3428 XMMRegister src2) { |
3369 DCHECK(IsEnabled(FMA3)); | 3429 DCHECK(IsEnabled(FMA3)); |
3370 EnsureSpace ensure_space(this); | 3430 EnsureSpace ensure_space(this); |
3371 emit_vex_prefix(dst, src1, src2, kLIG, k66, k0F38, kW1); | 3431 emit_vex_prefix(dst, src1, src2, kLIG, k66, k0F38, kW1); |
3372 emit(op); | 3432 emit(op); |
3373 emit_sse_operand(dst, src2); | 3433 emit_sse_operand(dst, src2); |
3374 } | 3434 } |
3375 | 3435 |
(...skipping 21 matching lines...) Expand all Loading... |
3397 void Assembler::vfmass(byte op, XMMRegister dst, XMMRegister src1, | 3457 void Assembler::vfmass(byte op, XMMRegister dst, XMMRegister src1, |
3398 const Operand& src2) { | 3458 const Operand& src2) { |
3399 DCHECK(IsEnabled(FMA3)); | 3459 DCHECK(IsEnabled(FMA3)); |
3400 EnsureSpace ensure_space(this); | 3460 EnsureSpace ensure_space(this); |
3401 emit_vex_prefix(dst, src1, src2, kLIG, k66, k0F38, kW0); | 3461 emit_vex_prefix(dst, src1, src2, kLIG, k66, k0F38, kW0); |
3402 emit(op); | 3462 emit(op); |
3403 emit_sse_operand(dst, src2); | 3463 emit_sse_operand(dst, src2); |
3404 } | 3464 } |
3405 | 3465 |
3406 | 3466 |
| 3467 void Assembler::vucomisd(XMMRegister dst, XMMRegister src) { |
| 3468 DCHECK(IsEnabled(AVX)); |
| 3469 EnsureSpace ensure_space(this); |
| 3470 emit_vex_prefix(dst, xmm0, src, kLIG, k66, k0F, kWIG); |
| 3471 emit(0x2e); |
| 3472 emit_sse_operand(dst, src); |
| 3473 } |
| 3474 |
| 3475 |
| 3476 void Assembler::vucomisd(XMMRegister dst, const Operand& src) { |
| 3477 DCHECK(IsEnabled(AVX)); |
| 3478 EnsureSpace ensure_space(this); |
| 3479 emit_vex_prefix(dst, xmm0, src, kLIG, k66, k0F, kWIG); |
| 3480 emit(0x2e); |
| 3481 emit_sse_operand(dst, src); |
| 3482 } |
| 3483 |
| 3484 |
3407 void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1, | 3485 void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1, |
3408 XMMRegister src2) { | 3486 XMMRegister src2) { |
3409 DCHECK(IsEnabled(AVX)); | 3487 DCHECK(IsEnabled(AVX)); |
3410 EnsureSpace ensure_space(this); | 3488 EnsureSpace ensure_space(this); |
3411 emit_vex_prefix(dst, src1, src2, kLIG, kF2, k0F, kWIG); | 3489 emit_vex_prefix(dst, src1, src2, kLIG, kF2, k0F, kWIG); |
3412 emit(op); | 3490 emit(op); |
3413 emit_sse_operand(dst, src2); | 3491 emit_sse_operand(dst, src2); |
3414 } | 3492 } |
3415 | 3493 |
3416 | 3494 |
3417 void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1, | 3495 void Assembler::vsd(byte op, XMMRegister dst, XMMRegister src1, |
3418 const Operand& src2) { | 3496 const Operand& src2) { |
3419 DCHECK(IsEnabled(AVX)); | 3497 DCHECK(IsEnabled(AVX)); |
3420 EnsureSpace ensure_space(this); | 3498 EnsureSpace ensure_space(this); |
3421 emit_vex_prefix(dst, src1, src2, kLIG, kF2, k0F, kWIG); | 3499 emit_vex_prefix(dst, src1, src2, kLIG, kF2, k0F, kWIG); |
3422 emit(op); | 3500 emit(op); |
3423 emit_sse_operand(dst, src2); | 3501 emit_sse_operand(dst, src2); |
3424 } | 3502 } |
3425 | 3503 |
3426 | 3504 |
| 3505 void Assembler::vucomiss(XMMRegister dst, XMMRegister src) { |
| 3506 DCHECK(IsEnabled(AVX)); |
| 3507 EnsureSpace ensure_space(this); |
| 3508 emit_vex_prefix(dst, xmm0, src, kLIG, kNone, k0F, kWIG); |
| 3509 emit(0x2e); |
| 3510 emit_sse_operand(dst, src); |
| 3511 } |
| 3512 |
| 3513 |
| 3514 void Assembler::vucomiss(XMMRegister dst, const Operand& src) { |
| 3515 DCHECK(IsEnabled(AVX)); |
| 3516 EnsureSpace ensure_space(this); |
| 3517 emit_vex_prefix(dst, xmm0, src, kLIG, kNone, k0F, kWIG); |
| 3518 emit(0x2e); |
| 3519 emit_sse_operand(dst, src); |
| 3520 } |
| 3521 |
| 3522 |
| 3523 void Assembler::vss(byte op, XMMRegister dst, XMMRegister src1, |
| 3524 XMMRegister src2) { |
| 3525 DCHECK(IsEnabled(AVX)); |
| 3526 EnsureSpace ensure_space(this); |
| 3527 emit_vex_prefix(dst, src1, src2, kLIG, kF3, k0F, kWIG); |
| 3528 emit(op); |
| 3529 emit_sse_operand(dst, src2); |
| 3530 } |
| 3531 |
| 3532 |
| 3533 void Assembler::vss(byte op, XMMRegister dst, XMMRegister src1, |
| 3534 const Operand& src2) { |
| 3535 DCHECK(IsEnabled(AVX)); |
| 3536 EnsureSpace ensure_space(this); |
| 3537 emit_vex_prefix(dst, src1, src2, kLIG, kF3, k0F, kWIG); |
| 3538 emit(op); |
| 3539 emit_sse_operand(dst, src2); |
| 3540 } |
| 3541 |
| 3542 |
3427 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) { | 3543 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) { |
3428 Register ireg = { reg.code() }; | 3544 Register ireg = { reg.code() }; |
3429 emit_operand(ireg, adr); | 3545 emit_operand(ireg, adr); |
3430 } | 3546 } |
3431 | 3547 |
3432 | 3548 |
3433 void Assembler::emit_sse_operand(Register reg, const Operand& adr) { | 3549 void Assembler::emit_sse_operand(Register reg, const Operand& adr) { |
3434 Register ireg = {reg.code()}; | 3550 Register ireg = {reg.code()}; |
3435 emit_operand(ireg, adr); | 3551 emit_operand(ireg, adr); |
3436 } | 3552 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3530 | 3646 |
3531 | 3647 |
3532 bool RelocInfo::IsInConstantPool() { | 3648 bool RelocInfo::IsInConstantPool() { |
3533 return false; | 3649 return false; |
3534 } | 3650 } |
3535 | 3651 |
3536 | 3652 |
3537 } } // namespace v8::internal | 3653 } } // namespace v8::internal |
3538 | 3654 |
3539 #endif // V8_TARGET_ARCH_X64 | 3655 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |