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

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

Issue 2695613004: Add several SIMD opcodes to IA32 (Closed)
Patch Set: Rebase 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/assembler-ia32-inl.h » ('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 2647 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 DCHECK(IsEnabled(SSE4_1)); 2658 DCHECK(IsEnabled(SSE4_1));
2659 EnsureSpace ensure_space(this); 2659 EnsureSpace ensure_space(this);
2660 EMIT(0x66); 2660 EMIT(0x66);
2661 EMIT(0x0F); 2661 EMIT(0x0F);
2662 EMIT(0x3A); 2662 EMIT(0x3A);
2663 EMIT(0x16); 2663 EMIT(0x16);
2664 emit_sse_operand(src, dst); 2664 emit_sse_operand(src, dst);
2665 EMIT(offset); 2665 EMIT(offset);
2666 } 2666 }
2667 2667
2668 void Assembler::pinsrw(XMMRegister dst, const Operand& src, int8_t offset) {
2669 DCHECK(is_uint8(offset));
2670 EnsureSpace ensure_space(this);
2671 EMIT(0x66);
2672 EMIT(0x0F);
2673 EMIT(0xC4);
2674 emit_sse_operand(dst, src);
2675 EMIT(offset);
2676 }
2668 2677
2669 void Assembler::pinsrd(XMMRegister dst, const Operand& src, int8_t offset) { 2678 void Assembler::pinsrd(XMMRegister dst, const Operand& src, int8_t offset) {
2670 DCHECK(IsEnabled(SSE4_1)); 2679 DCHECK(IsEnabled(SSE4_1));
2671 EnsureSpace ensure_space(this); 2680 EnsureSpace ensure_space(this);
2672 EMIT(0x66); 2681 EMIT(0x66);
2673 EMIT(0x0F); 2682 EMIT(0x0F);
2674 EMIT(0x3A); 2683 EMIT(0x3A);
2675 EMIT(0x22); 2684 EMIT(0x22);
2676 emit_sse_operand(dst, src); 2685 emit_sse_operand(dst, src);
2677 EMIT(offset); 2686 EMIT(offset);
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
2863 DCHECK(IsEnabled(BMI2)); 2872 DCHECK(IsEnabled(BMI2));
2864 DCHECK(is_uint8(imm8)); 2873 DCHECK(is_uint8(imm8));
2865 Register vreg = {0}; // VEX.vvvv unused 2874 Register vreg = {0}; // VEX.vvvv unused
2866 EnsureSpace ensure_space(this); 2875 EnsureSpace ensure_space(this);
2867 emit_vex_prefix(vreg, kLZ, kF2, k0F3A, kW0); 2876 emit_vex_prefix(vreg, kLZ, kF2, k0F3A, kW0);
2868 EMIT(0xF0); 2877 EMIT(0xF0);
2869 emit_operand(dst, src); 2878 emit_operand(dst, src);
2870 EMIT(imm8); 2879 EMIT(imm8);
2871 } 2880 }
2872 2881
2882 void Assembler::sse2_instr(XMMRegister dst, const Operand& src, byte prefix,
2883 byte escape, byte opcode) {
2884 EnsureSpace ensure_space(this);
2885 EMIT(prefix);
2886 EMIT(escape);
2887 EMIT(opcode);
2888 emit_sse_operand(dst, src);
2889 }
2890
2891 void Assembler::vinstr(byte op, XMMRegister dst, XMMRegister src1,
2892 const Operand& src2, SIMDPrefix pp, LeadingOpcode m,
2893 VexW w) {
2894 DCHECK(IsEnabled(AVX));
2895 EnsureSpace ensure_space(this);
2896 emit_vex_prefix(src1, kL128, pp, m, w);
2897 EMIT(op);
2898 emit_sse_operand(dst, src2);
2899 }
2873 2900
2874 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) { 2901 void Assembler::emit_sse_operand(XMMRegister reg, const Operand& adr) {
2875 Register ireg = { reg.code() }; 2902 Register ireg = { reg.code() };
2876 emit_operand(ireg, adr); 2903 emit_operand(ireg, adr);
2877 } 2904 }
2878 2905
2879 2906
2880 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) { 2907 void Assembler::emit_sse_operand(XMMRegister dst, XMMRegister src) {
2881 EMIT(0xC0 | dst.code() << 3 | src.code()); 2908 EMIT(0xC0 | dst.code() << 3 | src.code());
2882 } 2909 }
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
3070 } 3097 }
3071 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL); 3098 RelocInfo rinfo(isolate(), pc_, rmode, data, NULL);
3072 reloc_info_writer.Write(&rinfo); 3099 reloc_info_writer.Write(&rinfo);
3073 } 3100 }
3074 3101
3075 3102
3076 } // namespace internal 3103 } // namespace internal
3077 } // namespace v8 3104 } // namespace v8
3078 3105
3079 #endif // V8_TARGET_ARCH_IA32 3106 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/assembler-ia32.h ('k') | src/ia32/assembler-ia32-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698