4 iterate <instr,supp>, ptest,17h, pmuldq,28h, pcmpeqq,29h, packusdw,2Bh, pminsb,38h, pminsd,39h, pminuw,3Ah, pminud,3Bh, pmaxsb,3Ch, pmaxsd,3Dh, pmaxuw,3Eh, pmaxud,3Fh, pmulld,40h, phminposuw,41h
\r
5 macro instr? dest*,src*
\r
6 SSE.basic_instruction 66h,<38h,supp>,16,dest,src
\r
10 iterate <instr,supp>, roundps,08h, roundpd,09h, roundss,0Ah, roundsd,0Bh, blendps,0Ch, blendpd,0Dh, pblendw,0Eh, dpps,40h, dppd,41h, mpsadbw,42h
\r
11 macro instr? dest*,src*,imm*
\r
12 SSE.basic_instruction_imm8 66h,<3Ah,supp>,16,dest,src,imm
\r
16 iterate <instr,supp>, pblendvb,10h, blendvps,14h, blendvpd,15h
\r
17 macro instr? dest*,src*,sel*
\r
18 SSE.parse_operand @dest,dest
\r
19 SSE.parse_operand @src,src
\r
20 SSE.parse_operand @aux,sel
\r
21 if @dest.type = 'mmreg' & (@src.type = 'mem' | @src.type = 'mmreg') & @aux.type = 'mmreg' & @aux.size = 16 & @aux.rm = 0
\r
22 if @dest.size or @src.size and not 16
\r
23 err 'invalid operand size'
\r
25 @src.opcode_prefix = 66h
\r
26 x86.store_instruction <0Fh,38h,supp>,@src,@dest.rm
\r
28 err 'invalid combination of operands'
\r
33 iterate <conv,code,msize>, bw,0,8, bd,1,4, bq,2,2, wd,3,8, wq,4,4, dq,5,8
\r
34 macro pmovsx#conv? dest*,src*
\r
35 SSE.basic_instruction 66h,<38h,20h+code>,msize,dest,src
\r
37 macro pmovzx#conv? dest*,src*
\r
38 SSE.basic_instruction 66h,<38h,30h+code>,msize,dest,src
\r
42 macro insertps? dest*,src*,sel*
\r
43 SSE.basic_instruction_imm8 66h,<3Ah,21h>,4,dest,src,sel
\r
46 macro extractps? dest*,src*,sel*
\r
47 x86.parse_operand @dest,dest
\r
48 SSE.parse_operand @src,src
\r
49 x86.parse_operand @aux,sel
\r
50 if @dest.type = 'reg' & @src.type = 'mmreg' & @aux.type = 'imm'
\r
51 if x86.mode = 64 & @dest.size = 8
\r
54 if @dest.size <> 4 | @src.size and not 16 | @aux.size and not 1
\r
55 err 'invalid operand size'
\r
57 @dest.opcode_prefix = 66h
\r
58 x86.store_instruction <0Fh,3Ah,17h>,@dest,@src.rm,1,@aux.imm
\r
60 err 'invalid combination of operands'
\r
64 macro pinsrb? dest*,src*,sel*
\r
65 SSE.parse_operand @dest,dest
\r
66 x86.parse_operand @src,src
\r
67 x86.parse_operand @aux,sel
\r
68 if (@dest.type = 'mmreg' & @dest.size = 16) & (@src.type = 'reg' | @src.type = 'mem') & @aux.type = 'imm'
\r
69 if (@src.type = 'reg' & @src.size <> 4) | (@src.type = 'mem' & @src.size and not 1) | @aux.size and not 1
\r
70 err 'invalid operand size'
\r
72 @src.opcode_prefix = 66h
\r
73 x86.store_instruction <0Fh,3Ah,20h>,@src,@dest.rm,1,@aux.imm
\r
75 err 'invalid combination of operands'
\r
79 macro pinsrd? dest*,src*,sel*
\r
80 SSE.parse_operand @dest,dest
\r
81 x86.parse_operand @src,src
\r
82 x86.parse_operand @aux,sel
\r
83 if (@dest.type = 'mmreg' & @dest.size = 16) & (@src.type = 'reg' | @src.type = 'mem') & @aux.type = 'imm'
\r
84 if @src.size and not 4 | @aux.size and not 1
\r
85 err 'invalid operand size'
\r
87 @src.opcode_prefix = 66h
\r
88 x86.store_instruction <0Fh,3Ah,22h>,@src,@dest.rm,1,@aux.imm
\r
90 err 'invalid combination of operands'
\r
94 macro pinsrq? dest*,src*,sel*
\r
95 SSE.parse_operand @dest,dest
\r
96 x86.parse_operand @src,src
\r
97 x86.parse_operand @aux,sel
\r
98 if (@dest.type = 'mmreg' & @dest.size = 16) & (@src.type = 'reg' | @src.type = 'mem') & @aux.type = 'imm'
\r
99 if @src.size and not 8 | @aux.size and not 1
\r
100 err 'invalid operand size'
\r
103 err 'instruction requires long mode'
\r
105 @src.opcode_prefix = 66h
\r
106 @src.rex_prefix = 48h
\r
107 x86.store_instruction <0Fh,3Ah,22h>,@src,@dest.rm,1,@aux.imm
\r
109 err 'invalid combination of operands'
\r
113 macro pextrb? dest*,src*,sel*
\r
114 x86.parse_operand @dest,dest
\r
115 SSE.parse_operand @src,src
\r
116 x86.parse_operand @aux,sel
\r
117 if (@dest.type = 'reg' | @dest.type = 'mem') & (@src.type = 'mmreg' & @src.size = 16) & @aux.type = 'imm'
\r
118 if x86.mode = 64 & @dest.type = 'reg' & @dest.size = 8
\r
121 if (@dest.type = 'reg' & @dest.size <> 4) | (@dest.size = 'mem' & @dest.size and not 1) | @aux.size and not 1
\r
122 err 'invalid operand size'
\r
124 @dest.opcode_prefix = 66h
\r
125 x86.store_instruction <0Fh,3Ah,14h>,@dest,@src.rm,1,@aux.imm
\r
127 err 'invalid combination of operands'
\r
131 macro pextrw? dest*,src*,sel*
\r
132 x86.parse_operand @dest,dest
\r
133 SSE.parse_operand @src,src
\r
134 x86.parse_operand @aux,sel
\r
135 if @dest.type = 'reg' & @src.type = 'mmreg' & @aux.type = 'imm'
\r
136 if x86.mode = 64 & @dest.size = 8
\r
139 if @dest.size <> 4 | @aux.size and not 1
\r
140 err 'invalid operand size'
\r
142 MMX.select_operand_prefix @src,@src.size
\r
143 x86.store_instruction <0Fh,0C5h>,@src,@dest.rm,1,@aux.imm
\r
144 else if @dest.type = 'mem' & (@src.type = 'mmreg' & @src.size = 16) & @aux.type = 'imm'
\r
145 if @dest.size and not 2 | @aux.size and not 1
\r
146 err 'invalid operand size'
\r
148 @dest.opcode_prefix = 66h
\r
149 x86.store_instruction <0Fh,3Ah,15h>,@dest,@src.rm,1,@aux.imm
\r
151 err 'invalid combination of operands'
\r
155 macro pextrd? dest*,src*,sel*
\r
156 x86.parse_operand @dest,dest
\r
157 SSE.parse_operand @src,src
\r
158 x86.parse_operand @aux,sel
\r
159 if (@dest.type = 'reg' | @dest.type = 'mem') & (@src.type = 'mmreg' & @src.size = 16) & @aux.type = 'imm'
\r
160 if x86.mode = 64 & @dest.type = 'reg' & @dest.size = 8
\r
163 if @dest.size and not 4 | @aux.size and not 1
\r
164 err 'invalid operand size'
\r
166 @dest.opcode_prefix = 66h
\r
167 x86.store_instruction <0Fh,3Ah,16h>,@dest,@src.rm,1,@aux.imm
\r
169 err 'invalid combination of operands'
\r
173 macro pextrq? dest*,src*,sel*
\r
174 x86.parse_operand @dest,dest
\r
175 SSE.parse_operand @src,src
\r
176 x86.parse_operand @aux,sel
\r
177 if (@dest.type = 'reg' | @dest.type = 'mem') & (@src.type = 'mmreg' & @src.size = 16) & @aux.type = 'imm'
\r
178 if @dest.size and not 8 | @aux.size and not 1
\r
179 err 'invalid operand size'
\r
182 err 'instruction requires long mode'
\r
184 @dest.opcode_prefix = 66h
\r
185 @dest.rex_prefix = 48h
\r
186 x86.store_instruction <0Fh,3Ah,16h>,@dest,@src.rm,1,@aux.imm
\r
188 err 'invalid combination of operands'
\r
192 macro movntdqa? dest*,src*
\r
193 SSE.parse_operand @dest,dest
\r
194 SSE.parse_operand @src,src
\r
195 if @dest.type = 'mmreg' & @src.type = 'mem'
\r
196 if (@dest.size or @src.size) and not 16
\r
197 err 'invalid operand size'
\r
199 @src.opcode_prefix = 66h
\r
200 x86.store_instruction <0Fh,38h,2Ah>,@src,@dest.rm
\r
202 err 'invalid combination of operands'
\r