Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: src/ia32/assembler-ia32.cc

Issue 2747783004: [ia32] Supplement shift instructions for SIMD (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/ia32/disasm-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 2502 matching lines...) Expand 10 before | Expand all | Expand 10 after
2513 DCHECK(is_uint8(imm8)); 2513 DCHECK(is_uint8(imm8));
2514 EnsureSpace ensure_space(this); 2514 EnsureSpace ensure_space(this);
2515 EMIT(0x66); 2515 EMIT(0x66);
2516 EMIT(0x0F); 2516 EMIT(0x0F);
2517 EMIT(0x3A); 2517 EMIT(0x3A);
2518 EMIT(0x17); 2518 EMIT(0x17);
2519 emit_sse_operand(src, dst); 2519 emit_sse_operand(src, dst);
2520 EMIT(imm8); 2520 EMIT(imm8);
2521 } 2521 }
2522 2522
2523
2524 void Assembler::ptest(XMMRegister dst, XMMRegister src) { 2523 void Assembler::ptest(XMMRegister dst, XMMRegister src) {
2525 DCHECK(IsEnabled(SSE4_1)); 2524 DCHECK(IsEnabled(SSE4_1));
2526 EnsureSpace ensure_space(this); 2525 EnsureSpace ensure_space(this);
2527 EMIT(0x66); 2526 EMIT(0x66);
2528 EMIT(0x0F); 2527 EMIT(0x0F);
2529 EMIT(0x38); 2528 EMIT(0x38);
2530 EMIT(0x17); 2529 EMIT(0x17);
2531 emit_sse_operand(dst, src); 2530 emit_sse_operand(dst, src);
2532 } 2531 }
2533 2532
2533 void Assembler::psllw(XMMRegister reg, int8_t shift) {
2534 EnsureSpace ensure_space(this);
2535 EMIT(0x66);
2536 EMIT(0x0F);
2537 EMIT(0x71);
2538 emit_sse_operand(esi, reg); // esi == 6
2539 EMIT(shift);
2540 }
2534 2541
2535 void Assembler::pslld(XMMRegister reg, int8_t shift) { 2542 void Assembler::pslld(XMMRegister reg, int8_t shift) {
2536 EnsureSpace ensure_space(this); 2543 EnsureSpace ensure_space(this);
2537 EMIT(0x66); 2544 EMIT(0x66);
2538 EMIT(0x0F); 2545 EMIT(0x0F);
2539 EMIT(0x72); 2546 EMIT(0x72);
2540 emit_sse_operand(esi, reg); // esi == 6 2547 emit_sse_operand(esi, reg); // esi == 6
2541 EMIT(shift); 2548 EMIT(shift);
2542 } 2549 }
2543 2550
2551 void Assembler::psrlw(XMMRegister reg, int8_t shift) {
2552 EnsureSpace ensure_space(this);
2553 EMIT(0x66);
2554 EMIT(0x0F);
2555 EMIT(0x71);
2556 emit_sse_operand(edx, reg); // edx == 2
2557 EMIT(shift);
2558 }
2544 2559
2545 void Assembler::psrld(XMMRegister reg, int8_t shift) { 2560 void Assembler::psrld(XMMRegister reg, int8_t shift) {
2546 EnsureSpace ensure_space(this); 2561 EnsureSpace ensure_space(this);
2547 EMIT(0x66); 2562 EMIT(0x66);
2548 EMIT(0x0F); 2563 EMIT(0x0F);
2549 EMIT(0x72); 2564 EMIT(0x72);
2550 emit_sse_operand(edx, reg); // edx == 2 2565 emit_sse_operand(edx, reg); // edx == 2
2551 EMIT(shift); 2566 EMIT(shift);
2552 } 2567 }
2553 2568
2569 void Assembler::psraw(XMMRegister reg, int8_t shift) {
2570 EnsureSpace ensure_space(this);
2571 EMIT(0x66);
2572 EMIT(0x0F);
2573 EMIT(0x71);
2574 emit_sse_operand(esp, reg); // esp == 4
2575 EMIT(shift);
2576 }
2577
2578 void Assembler::psrad(XMMRegister reg, int8_t shift) {
2579 EnsureSpace ensure_space(this);
2580 EMIT(0x66);
2581 EMIT(0x0F);
2582 EMIT(0x72);
2583 emit_sse_operand(esp, reg); // esp == 4
2584 EMIT(shift);
2585 }
2554 2586
2555 void Assembler::psllq(XMMRegister reg, int8_t shift) { 2587 void Assembler::psllq(XMMRegister reg, int8_t shift) {
2556 EnsureSpace ensure_space(this); 2588 EnsureSpace ensure_space(this);
2557 EMIT(0x66); 2589 EMIT(0x66);
2558 EMIT(0x0F); 2590 EMIT(0x0F);
2559 EMIT(0x73); 2591 EMIT(0x73);
2560 emit_sse_operand(esi, reg); // esi == 6 2592 emit_sse_operand(esi, reg); // esi == 6
2561 EMIT(shift); 2593 EMIT(shift);
2562 } 2594 }
2563 2595
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 2789
2758 void Assembler::vpd(byte op, XMMRegister dst, XMMRegister src1, 2790 void Assembler::vpd(byte op, XMMRegister dst, XMMRegister src1,
2759 const Operand& src2) { 2791 const Operand& src2) {
2760 DCHECK(IsEnabled(AVX)); 2792 DCHECK(IsEnabled(AVX));
2761 EnsureSpace ensure_space(this); 2793 EnsureSpace ensure_space(this);
2762 emit_vex_prefix(src1, kL128, k66, k0F, kWIG); 2794 emit_vex_prefix(src1, kL128, k66, k0F, kWIG);
2763 EMIT(op); 2795 EMIT(op);
2764 emit_sse_operand(dst, src2); 2796 emit_sse_operand(dst, src2);
2765 } 2797 }
2766 2798
2799 void Assembler::vpsllw(XMMRegister dst, XMMRegister src, int8_t imm8) {
2800 XMMRegister iop = {6};
2801 vinstr(0x71, iop, dst, Operand(src), k66, k0F, kWIG);
2802 EMIT(imm8);
2803 }
2804
2805 void Assembler::vpslld(XMMRegister dst, XMMRegister src, int8_t imm8) {
2806 XMMRegister iop = {6};
2807 vinstr(0x72, iop, dst, Operand(src), k66, k0F, kWIG);
2808 EMIT(imm8);
2809 }
2810
2811 void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, int8_t imm8) {
2812 XMMRegister iop = {2};
2813 vinstr(0x71, iop, dst, Operand(src), k66, k0F, kWIG);
2814 EMIT(imm8);
2815 }
2816
2817 void Assembler::vpsrld(XMMRegister dst, XMMRegister src, int8_t imm8) {
2818 XMMRegister iop = {2};
2819 vinstr(0x72, iop, dst, Operand(src), k66, k0F, kWIG);
2820 EMIT(imm8);
2821 }
2822
2823 void Assembler::vpsraw(XMMRegister dst, XMMRegister src, int8_t imm8) {
2824 XMMRegister iop = {4};
2825 vinstr(0x71, iop, dst, Operand(src), k66, k0F, kWIG);
2826 EMIT(imm8);
2827 }
2828
2829 void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int8_t imm8) {
2830 XMMRegister iop = {4};
2831 vinstr(0x72, iop, dst, Operand(src), k66, k0F, kWIG);
2832 EMIT(imm8);
2833 }
2767 2834
2768 void Assembler::bmi1(byte op, Register reg, Register vreg, const Operand& rm) { 2835 void Assembler::bmi1(byte op, Register reg, Register vreg, const Operand& rm) {
2769 DCHECK(IsEnabled(BMI1)); 2836 DCHECK(IsEnabled(BMI1));
2770 EnsureSpace ensure_space(this); 2837 EnsureSpace ensure_space(this);
2771 emit_vex_prefix(vreg, kLZ, kNone, k0F38, kW0); 2838 emit_vex_prefix(vreg, kLZ, kNone, k0F38, kW0);
2772 EMIT(op); 2839 EMIT(op);
2773 emit_operand(reg, rm); 2840 emit_operand(reg, rm);
2774 } 2841 }
2775 2842
2776 2843
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
3054 } 3121 }
3055 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); 3122 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
3056 reloc_info_writer.Write(&rinfo); 3123 reloc_info_writer.Write(&rinfo);
3057 } 3124 }
3058 3125
3059 3126
3060 } // namespace internal 3127 } // namespace internal
3061 } // namespace v8 3128 } // namespace v8
3062 3129
3063 #endif // V8_TARGET_ARCH_IA32 3130 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/ia32/disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698