Rev 7836 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7836 | leency | 1 | |
2 | ; Copyright (c) 1999-2021, Tomasz Grysztar. |
||
9459 | leency | 3 | ; All rights reserved. |
7836 | leency | 4 | |
5 | |||
6 | or [vex_required],8 |
||
7 | avx_single_source_pd_instruction_er: |
||
8 | or [operand_flags],2+4+8 |
||
9 | jmp avx_pd_instruction |
||
10 | avx_single_source_pd_instruction_sae_evex: |
||
11 | or [vex_required],8 |
||
12 | or [operand_flags],2+4 |
||
13 | jmp avx_pd_instruction |
||
14 | avx_pd_instruction_imm8: |
||
15 | mov [immediate_size],1 |
||
16 | jmp avx_pd_instruction |
||
17 | avx_pd_instruction_er: |
||
18 | or [operand_flags],8 |
||
19 | avx_pd_instruction_sae: |
||
20 | or [operand_flags],4 |
||
21 | avx_pd_instruction: |
||
22 | mov [opcode_prefix],66h |
||
23 | or [rex_prefix],80h |
||
24 | mov cx,0800h |
||
25 | jmp avx_instruction_with_broadcast |
||
26 | avx_pd_instruction_38_evex: |
||
27 | or [vex_required],8 |
||
28 | mov [supplemental_code],al |
||
29 | mov al,38h |
||
30 | jmp avx_pd_instruction |
||
31 | avx_cvtps2dq_instruction: |
||
32 | mov [opcode_prefix],66h |
||
33 | jmp avx_single_source_ps_instruction_er |
||
34 | avx_cvtudq2ps_instruction: |
||
35 | mov [opcode_prefix],0F2h |
||
36 | avx_single_source_ps_instruction_er_evex: |
||
37 | or [vex_required],8 |
||
38 | avx_single_source_ps_instruction_er: |
||
39 | or [operand_flags],2+4+8 |
||
40 | jmp avx_ps_instruction |
||
41 | avx_single_source_ps_instruction_noevex: |
||
42 | or [operand_flags],2 |
||
43 | or [vex_required],2 |
||
44 | jmp avx_ps_instruction |
||
45 | avx_ps_instruction_imm8: |
||
46 | mov [immediate_size],1 |
||
47 | jmp avx_ps_instruction |
||
48 | avx_ps_instruction_er: |
||
49 | or [operand_flags],8 |
||
50 | avx_ps_instruction_sae: |
||
51 | or [operand_flags],4 |
||
52 | avx_ps_instruction: |
||
53 | mov cx,0400h |
||
54 | jmp avx_instruction_with_broadcast |
||
55 | avx_ps_instruction_66_38_evex: |
||
56 | or [vex_required],8 |
||
57 | mov [opcode_prefix],66h |
||
58 | mov [supplemental_code],al |
||
59 | mov al,38h |
||
60 | jmp avx_ps_instruction |
||
61 | avx_sd_instruction_er: |
||
62 | or [operand_flags],8 |
||
63 | avx_sd_instruction_sae: |
||
64 | or [operand_flags],4 |
||
65 | avx_sd_instruction: |
||
66 | mov [opcode_prefix],0F2h |
||
67 | or [rex_prefix],80h |
||
68 | mov cl,8 |
||
69 | jmp avx_instruction |
||
70 | avx_ss_instruction_er: |
||
71 | or [operand_flags],8 |
||
72 | avx_ss_instruction_sae: |
||
73 | or [operand_flags],4 |
||
74 | avx_ss_instruction: |
||
75 | mov [opcode_prefix],0F3h |
||
76 | mov cl,4 |
||
77 | jmp avx_instruction |
||
78 | avx_ss_instruction_noevex: |
||
79 | or [vex_required],2 |
||
80 | jmp avx_ss_instruction |
||
81 | avx_single_source_q_instruction_38_evex: |
||
82 | or [operand_flags],2 |
||
83 | avx_q_instruction_38_evex: |
||
84 | or [vex_required],8 |
||
85 | avx_q_instruction_38: |
||
86 | mov [supplemental_code],al |
||
87 | mov al,38h |
||
88 | jmp avx_q_instruction |
||
89 | avx_q_instruction_38_w1_evex: |
||
90 | or [vex_required],8 |
||
91 | avx_q_instruction_38_w1: |
||
92 | or [rex_prefix],8 |
||
93 | jmp avx_q_instruction_38 |
||
94 | avx_q_instruction_3a_imm8_w1: |
||
95 | or [rex_prefix],8 |
||
96 | jmp avx_q_instruction_3a_imm8 |
||
97 | avx_q_instruction_3a_imm8_evex: |
||
98 | or [vex_required],8 |
||
99 | avx_q_instruction_3a_imm8: |
||
100 | mov [immediate_size],1 |
||
101 | mov [supplemental_code],al |
||
102 | mov al,3Ah |
||
103 | jmp avx_q_instruction |
||
104 | avx_q_instruction_evex: |
||
105 | or [vex_required],8 |
||
106 | avx_q_instruction: |
||
107 | or [rex_prefix],80h |
||
108 | mov ch,8 |
||
109 | jmp avx_pi_instruction |
||
110 | avx_single_source_d_instruction_38_evex_w1: |
||
111 | or [rex_prefix],8 |
||
112 | avx_single_source_d_instruction_38_evex: |
||
113 | or [vex_required],8 |
||
114 | avx_single_source_d_instruction_38: |
||
115 | or [operand_flags],2 |
||
116 | jmp avx_d_instruction_38 |
||
117 | avx_d_instruction_38_evex: |
||
118 | or [vex_required],8 |
||
119 | avx_d_instruction_38: |
||
120 | mov [supplemental_code],al |
||
121 | mov al,38h |
||
122 | jmp avx_d_instruction |
||
123 | avx_d_instruction_3a_imm8_evex: |
||
124 | mov [immediate_size],1 |
||
125 | or [vex_required],8 |
||
126 | mov [supplemental_code],al |
||
127 | mov al,3Ah |
||
128 | jmp avx_d_instruction |
||
129 | avx_single_source_d_instruction_imm8: |
||
130 | or [operand_flags],2 |
||
131 | mov [immediate_size],1 |
||
132 | jmp avx_d_instruction |
||
133 | avx_d_instruction_evex: |
||
134 | or [vex_required],8 |
||
135 | avx_d_instruction: |
||
136 | mov ch,4 |
||
137 | jmp avx_pi_instruction |
||
138 | avx_bw_instruction_3a_imm8_w1_evex: |
||
139 | or [rex_prefix],8 |
||
140 | avx_bw_instruction_3a_imm8_evex: |
||
141 | mov [immediate_size],1 |
||
142 | or [vex_required],8 |
||
143 | mov [supplemental_code],al |
||
144 | mov al,3Ah |
||
145 | jmp avx_bw_instruction |
||
146 | avx_single_source_bw_instruction_38: |
||
147 | or [operand_flags],2 |
||
148 | avx_bw_instruction_38: |
||
149 | mov [supplemental_code],al |
||
150 | mov al,38h |
||
151 | avx_bw_instruction: |
||
152 | xor ch,ch |
||
153 | avx_pi_instruction: |
||
154 | mov [opcode_prefix],66h |
||
155 | xor cl,cl |
||
156 | jmp avx_instruction_with_broadcast |
||
157 | avx_bw_instruction_38_w1_evex: |
||
158 | or [rex_prefix],8 |
||
159 | avx_bw_instruction_38_evex: |
||
160 | or [vex_required],8 |
||
161 | jmp avx_bw_instruction_38 |
||
162 | avx_pd_instruction_noevex: |
||
163 | xor cl,cl |
||
164 | or [vex_required],2 |
||
165 | mov [opcode_prefix],66h |
||
166 | jmp avx_instruction |
||
167 | avx_ps_instruction_noevex: |
||
168 | or [vex_required],2 |
||
169 | mov [opcode_prefix],0F2h |
||
170 | xor cl,cl |
||
171 | jmp avx_instruction |
||
172 | avx_instruction: |
||
173 | xor ch,ch |
||
174 | avx_instruction_with_broadcast: |
||
175 | mov [mmx_size],cl |
||
176 | mov [broadcast_size],ch |
||
177 | mov [base_code],0Fh |
||
178 | mov [extended_code],al |
||
179 | avx_xop_common: |
||
180 | or [vex_required],1 |
||
181 | lods byte [esi] |
||
182 | call get_size_operator |
||
183 | cmp al,10h |
||
184 | jne invalid_operand |
||
185 | avx_reg: |
||
186 | lods byte [esi] |
||
187 | call convert_avx_register |
||
188 | mov [postbyte_register],al |
||
189 | call take_avx512_mask |
||
190 | avx_vex_reg: |
||
191 | test [operand_flags],2 |
||
192 | jnz avx_vex_reg_ok |
||
193 | lods byte [esi] |
||
194 | cmp al,',' |
||
195 | jne invalid_operand |
||
196 | call take_avx_register |
||
197 | mov [vex_register],al |
||
198 | avx_vex_reg_ok: |
||
199 | mov al,[mmx_size] |
||
200 | or al,al |
||
201 | jz avx_regs_size_ok |
||
202 | mov ah,[operand_size] |
||
203 | or ah,ah |
||
204 | jz avx_regs_size_ok |
||
205 | cmp al,ah |
||
206 | je avx_regs_size_ok |
||
207 | ja invalid_operand_size |
||
208 | cmp ah,16 |
||
209 | jne invalid_operand_size |
||
210 | avx_regs_size_ok: |
||
211 | lods byte [esi] |
||
212 | cmp al,',' |
||
213 | jne invalid_operand |
||
214 | avx_regs_rm: |
||
215 | call take_avx_rm |
||
216 | jc avx_regs_reg |
||
217 | mov al,[immediate_size] |
||
218 | cmp al,1 |
||
219 | je mmx_imm8 |
||
220 | jb instruction_ready |
||
221 | cmp al,-4 |
||
222 | je sse_cmp_mem_ok |
||
223 | cmp byte [esi],',' |
||
224 | jne invalid_operand |
||
225 | inc esi |
||
226 | call take_avx_register |
||
227 | shl al,4 |
||
228 | jc invalid_operand |
||
229 | or byte [value],al |
||
230 | test al,80h |
||
231 | jz avx_regs_mem_reg_store |
||
232 | cmp [code_type],64 |
||
233 | jne invalid_operand |
||
234 | avx_regs_mem_reg_store: |
||
235 | call take_imm4_if_needed |
||
236 | call store_instruction_with_imm8 |
||
237 | jmp instruction_assembled |
||
238 | avx_regs_reg: |
||
239 | mov bl,al |
||
240 | call take_avx512_rounding |
||
241 | mov al,[immediate_size] |
||
242 | cmp al,1 |
||
243 | je mmx_nomem_imm8 |
||
244 | jb nomem_instruction_ready |
||
245 | cmp al,-4 |
||
246 | je sse_cmp_nomem_ok |
||
247 | lods byte [esi] |
||
248 | cmp al,',' |
||
249 | jne invalid_operand |
||
250 | mov al,bl |
||
251 | shl al,4 |
||
252 | jc invalid_operand |
||
253 | or byte [value],al |
||
254 | test al,80h |
||
255 | jz avx_regs_reg_ |
||
256 | cmp [code_type],64 |
||
257 | jne invalid_operand |
||
258 | avx_regs_reg_: |
||
259 | call take_avx_rm |
||
260 | jc avx_regs_reg_reg |
||
261 | cmp [immediate_size],-2 |
||
262 | jg invalid_operand |
||
263 | or [rex_prefix],8 |
||
264 | call take_imm4_if_needed |
||
265 | call store_instruction_with_imm8 |
||
266 | jmp instruction_assembled |
||
267 | avx_regs_reg_reg: |
||
268 | shl al,4 |
||
269 | jc invalid_operand |
||
270 | and byte [value],1111b |
||
271 | or byte [value],al |
||
272 | call take_imm4_if_needed |
||
273 | call store_nomem_instruction |
||
274 | mov al,byte [value] |
||
275 | stos byte [edi] |
||
276 | jmp instruction_assembled |
||
277 | take_avx_rm: |
||
278 | xor cl,cl |
||
279 | xchg cl,[operand_size] |
||
280 | lods byte [esi] |
||
281 | call get_size_operator |
||
282 | cmp al,'[' |
||
283 | je take_avx_mem |
||
284 | cmp al,10h |
||
285 | jne invalid_operand |
||
286 | mov [operand_size],cl |
||
287 | lods byte [esi] |
||
288 | call convert_avx_register |
||
289 | or cl,cl |
||
290 | jnz avx_reg_ok |
||
291 | or cl,[mmx_size] |
||
292 | jz avx_reg_ok |
||
293 | cmp ah,cl |
||
294 | je avx_reg_ok |
||
295 | jb invalid_operand_size |
||
296 | cmp ah,16 |
||
297 | jne invalid_operand_size |
||
298 | avx_reg_ok: |
||
299 | stc |
||
300 | ret |
||
301 | take_avx_mem: |
||
302 | push ecx |
||
303 | call get_address |
||
304 | cmp byte [esi],'{' |
||
305 | jne avx_mem_ok |
||
306 | inc esi |
||
307 | lods byte [esi] |
||
308 | cmp al,1Fh |
||
309 | jne invalid_operand |
||
310 | mov al,[esi] |
||
311 | shr al,4 |
||
312 | cmp al,1 |
||
313 | jne invalid_operand |
||
314 | mov al,[mmx_size] |
||
315 | or al,al |
||
316 | jnz avx_mem_broadcast_check |
||
317 | mov eax,[esp] |
||
318 | or al,al |
||
319 | jnz avx_mem_broadcast_check |
||
320 | mov al,[broadcast_size] |
||
321 | mov [mmx_size],al |
||
322 | mov ah,cl |
||
323 | lods byte [esi] |
||
324 | and al,1111b |
||
325 | mov cl,al |
||
326 | mov al,[broadcast_size] |
||
327 | shl al,cl |
||
328 | mov [esp],al |
||
329 | mov cl,ah |
||
330 | jmp avx_mem_broadcast_ok |
||
331 | avx_mem_broadcast_check: |
||
332 | bsf eax,eax |
||
333 | xchg al,[broadcast_size] |
||
334 | mov [mmx_size],al |
||
335 | bsf eax,eax |
||
336 | jz invalid_operand |
||
337 | mov ah,[broadcast_size] |
||
338 | sub ah,al |
||
339 | lods byte [esi] |
||
340 | and al,1111b |
||
341 | cmp al,ah |
||
342 | jne invalid_operand_size |
||
343 | avx_mem_broadcast_ok: |
||
344 | or [vex_required],40h |
||
345 | lods byte [esi] |
||
346 | cmp al,'}' |
||
347 | jne invalid_operand |
||
348 | avx_mem_ok: |
||
349 | pop eax |
||
350 | or al,al |
||
351 | jz avx_mem_size_deciding |
||
352 | xchg al,[operand_size] |
||
353 | cmp [mmx_size],0 |
||
354 | jne avx_mem_size_enforced |
||
355 | or al,al |
||
356 | jz avx_mem_size_ok |
||
357 | cmp al,[operand_size] |
||
358 | jne operand_sizes_do_not_match |
||
359 | avx_mem_size_ok: |
||
360 | clc |
||
361 | ret |
||
362 | avx_mem_size_deciding: |
||
363 | mov al,[operand_size] |
||
364 | cmp [mmx_size],0 |
||
365 | jne avx_mem_size_enforced |
||
366 | cmp al,16 |
||
367 | je avx_mem_size_ok |
||
368 | cmp al,32 |
||
369 | je avx_mem_size_ok |
||
370 | cmp al,64 |
||
371 | je avx_mem_size_ok |
||
372 | or al,al |
||
373 | jnz invalid_operand_size |
||
374 | call recoverable_unknown_size |
||
375 | avx_mem_size_enforced: |
||
376 | or al,al |
||
377 | jz avx_mem_size_ok |
||
378 | cmp al,[mmx_size] |
||
379 | je avx_mem_size_ok |
||
380 | jmp invalid_operand_size |
||
381 | take_imm4_if_needed: |
||
382 | cmp [immediate_size],-3 |
||
383 | jne imm4_ok |
||
384 | push ebx ecx edx |
||
385 | lods byte [esi] |
||
386 | cmp al,',' |
||
387 | jne invalid_operand |
||
388 | lods byte [esi] |
||
389 | cmp al,'(' |
||
390 | jne invalid_operand |
||
391 | call get_byte_value |
||
392 | test al,11110000b |
||
393 | jnz value_out_of_range |
||
394 | or byte [value],al |
||
395 | pop edx ecx ebx |
||
396 | imm4_ok: |
||
397 | ret |
||
398 | take_avx512_mask: |
||
399 | cmp byte [esi],'{' |
||
400 | jne avx512_masking_ok |
||
401 | test [operand_flags],10h |
||
402 | jnz invalid_operand |
||
403 | inc esi |
||
404 | lods byte [esi] |
||
405 | cmp al,14h |
||
406 | jne invalid_operand |
||
407 | lods byte [esi] |
||
408 | mov ah,al |
||
409 | shr ah,4 |
||
410 | cmp ah,5 |
||
411 | jne invalid_operand |
||
412 | and al,111b |
||
413 | or al,al |
||
414 | jz invalid_operand |
||
415 | mov [mask_register],al |
||
416 | or [vex_required],20h |
||
417 | lods byte [esi] |
||
418 | cmp al,'}' |
||
419 | jne invalid_operand |
||
420 | cmp byte [esi],'{' |
||
421 | jne avx512_masking_ok |
||
422 | test [operand_flags],20h |
||
423 | jnz invalid_operand |
||
424 | inc esi |
||
425 | lods byte [esi] |
||
426 | cmp al,1Fh |
||
427 | jne invalid_operand |
||
428 | lods byte [esi] |
||
429 | or al,al |
||
430 | jnz invalid_operand |
||
431 | or [mask_register],80h |
||
432 | lods byte [esi] |
||
433 | cmp al,'}' |
||
434 | jne invalid_operand |
||
435 | avx512_masking_ok: |
||
436 | retn |
||
437 | take_avx512_rounding: |
||
438 | test [operand_flags],4+8 |
||
439 | jz avx512_rounding_done |
||
440 | test [operand_flags],8 |
||
441 | jz avx512_rounding_allowed |
||
442 | cmp [mmx_size],0 |
||
443 | jne avx512_rounding_allowed |
||
444 | cmp [operand_size],64 |
||
445 | jne avx512_rounding_done |
||
446 | avx512_rounding_allowed: |
||
447 | cmp byte [esi],',' |
||
448 | jne avx512_rounding_done |
||
449 | cmp byte [esi+1],'{' |
||
450 | jne avx512_rounding_done |
||
451 | add esi,2 |
||
452 | mov [rounding_mode],0 |
||
453 | or [vex_required],40h |
||
454 | test [operand_flags],8 |
||
455 | jz take_sae |
||
456 | or [vex_required],80h |
||
457 | lods byte [esi] |
||
458 | cmp al,1Fh |
||
459 | jne invalid_operand |
||
460 | lods byte [esi] |
||
461 | mov ah,al |
||
462 | shr ah,4 |
||
463 | cmp ah,2 |
||
464 | jne invalid_operand |
||
465 | and al,11b |
||
466 | mov [rounding_mode],al |
||
467 | lods byte [esi] |
||
468 | cmp al,'-' |
||
469 | jne invalid_operand |
||
470 | take_sae: |
||
471 | lods byte [esi] |
||
472 | cmp al,1Fh |
||
473 | jne invalid_operand |
||
474 | lods byte [esi] |
||
475 | cmp al,30h |
||
476 | jne invalid_operand |
||
477 | lods byte [esi] |
||
478 | cmp al,'}' |
||
479 | jne invalid_operand |
||
480 | avx512_rounding_done: |
||
481 | retn |
||
482 | |||
483 | |||
484 | mov ah,0F3h |
||
485 | jmp avx_movdq_instruction |
||
486 | avx_movdqa_instruction: |
||
487 | mov ah,66h |
||
488 | avx_movdq_instruction: |
||
489 | mov [opcode_prefix],ah |
||
490 | or [vex_required],2 |
||
491 | jmp avx_movps_instruction |
||
492 | avx512_movdqu16_instruction: |
||
493 | or [rex_prefix],8 |
||
494 | avx512_movdqu8_instruction: |
||
495 | mov ah,0F2h |
||
496 | jmp avx_movdq_instruction_evex |
||
497 | avx512_movdqu64_instruction: |
||
498 | or [rex_prefix],8 |
||
499 | avx512_movdqu32_instruction: |
||
500 | mov ah,0F3h |
||
501 | jmp avx_movdq_instruction_evex |
||
502 | avx512_movdqa64_instruction: |
||
503 | or [rex_prefix],8 |
||
504 | avx512_movdqa32_instruction: |
||
505 | mov ah,66h |
||
506 | avx_movdq_instruction_evex: |
||
507 | mov [opcode_prefix],ah |
||
508 | or [vex_required],8 |
||
509 | jmp avx_movps_instruction |
||
510 | avx_movpd_instruction: |
||
511 | mov [opcode_prefix],66h |
||
512 | or [rex_prefix],80h |
||
513 | avx_movps_instruction: |
||
514 | or [operand_flags],2 |
||
515 | mov [base_code],0Fh |
||
516 | mov [extended_code],al |
||
517 | or [vex_required],1 |
||
518 | xor al,al |
||
519 | mov [mmx_size],al |
||
520 | mov [broadcast_size],al |
||
521 | lods byte [esi] |
||
522 | call get_size_operator |
||
523 | cmp al,10h |
||
524 | je avx_reg |
||
525 | inc [extended_code] |
||
526 | test [extended_code],1 |
||
527 | jnz avx_mem |
||
528 | add [extended_code],-1+10h |
||
529 | avx_mem: |
||
530 | cmp al,'[' |
||
531 | jne invalid_operand |
||
532 | call get_address |
||
533 | or [operand_flags],20h |
||
534 | call take_avx512_mask |
||
535 | lods byte [esi] |
||
536 | cmp al,',' |
||
537 | jne invalid_operand |
||
538 | call take_avx_register |
||
539 | mov [postbyte_register],al |
||
540 | jmp instruction_ready |
||
541 | avx_movntpd_instruction: |
||
542 | or [rex_prefix],80h |
||
543 | avx_movntdq_instruction: |
||
544 | mov [opcode_prefix],66h |
||
545 | avx_movntps_instruction: |
||
546 | mov [base_code],0Fh |
||
547 | mov [extended_code],al |
||
548 | or [vex_required],1 |
||
549 | or [operand_flags],10h |
||
550 | mov [mmx_size],0 |
||
551 | lods byte [esi] |
||
552 | call get_size_operator |
||
553 | jmp avx_mem |
||
554 | avx_compress_q_instruction: |
||
555 | or [rex_prefix],8 |
||
556 | avx_compress_d_instruction: |
||
557 | or [vex_required],8 |
||
558 | mov [mmx_size],0 |
||
559 | call setup_66_0f_38 |
||
560 | lods byte [esi] |
||
561 | call get_size_operator |
||
562 | cmp al,10h |
||
563 | jne avx_mem |
||
564 | lods byte [esi] |
||
565 | call convert_avx_register |
||
566 | mov bl,al |
||
567 | call take_avx512_mask |
||
568 | lods byte [esi] |
||
569 | cmp al,',' |
||
570 | jne invalid_operand |
||
571 | call take_avx_register |
||
572 | mov [postbyte_register],al |
||
573 | jmp nomem_instruction_ready |
||
574 | avx_lddqu_instruction: |
||
575 | mov ah,0F2h |
||
576 | or [vex_required],2 |
||
577 | avx_load_instruction: |
||
578 | mov [opcode_prefix],ah |
||
579 | mov [base_code],0Fh |
||
580 | mov [extended_code],al |
||
581 | mov [mmx_size],0 |
||
582 | or [vex_required],1 |
||
583 | call take_avx_register |
||
584 | mov [postbyte_register],al |
||
585 | lods byte [esi] |
||
586 | cmp al,',' |
||
587 | jne invalid_operand |
||
588 | lods byte [esi] |
||
589 | call get_size_operator |
||
590 | cmp al,'[' |
||
591 | jne invalid_operand |
||
592 | call get_address |
||
593 | jmp instruction_ready |
||
594 | avx_movntdqa_instruction: |
||
595 | mov [supplemental_code],al |
||
596 | mov al,38h |
||
597 | mov ah,66h |
||
598 | jmp avx_load_instruction |
||
599 | avx_movq_instruction: |
||
600 | or [rex_prefix],8 |
||
601 | mov [mmx_size],8 |
||
602 | jmp avx_mov_instruction |
||
603 | avx_movd_instruction: |
||
604 | mov [mmx_size],4 |
||
605 | avx_mov_instruction: |
||
606 | or [vex_required],1 |
||
607 | mov [opcode_prefix],66h |
||
608 | mov [base_code],0Fh |
||
609 | mov [extended_code],7Eh |
||
610 | lods byte [esi] |
||
611 | call get_size_operator |
||
612 | cmp al,10h |
||
613 | je avx_movd_reg |
||
614 | cmp al,'[' |
||
615 | jne invalid_operand |
||
616 | call get_address |
||
617 | mov al,[mmx_size] |
||
618 | not al |
||
619 | and [operand_size],al |
||
620 | jnz invalid_operand_size |
||
621 | lods byte [esi] |
||
622 | cmp al,',' |
||
623 | jne invalid_operand |
||
624 | lods byte [esi] |
||
625 | call get_size_operator |
||
626 | cmp al,10h |
||
627 | jne invalid_operand |
||
628 | lods byte [esi] |
||
629 | call convert_avx_register |
||
630 | cmp ah,16 |
||
631 | jne invalid_operand_size |
||
632 | mov [postbyte_register],al |
||
633 | cmp [mmx_size],8 |
||
634 | jne instruction_ready |
||
635 | and [rex_prefix],not 8 |
||
636 | or [rex_prefix],80h |
||
637 | mov [extended_code],0D6h |
||
638 | jmp instruction_ready |
||
639 | avx_movd_reg: |
||
640 | lods byte [esi] |
||
641 | cmp al,0C0h |
||
642 | jae avx_movd_xmmreg |
||
643 | call convert_register |
||
644 | cmp ah,[mmx_size] |
||
645 | jne invalid_operand_size |
||
646 | mov [operand_size],0 |
||
647 | mov bl,al |
||
648 | lods byte [esi] |
||
649 | cmp al,',' |
||
650 | jne invalid_operand |
||
651 | lods byte [esi] |
||
652 | call get_size_operator |
||
653 | cmp al,10h |
||
654 | jne invalid_operand |
||
655 | lods byte [esi] |
||
656 | call convert_avx_register |
||
657 | cmp ah,16 |
||
658 | jne invalid_operand_size |
||
659 | mov [postbyte_register],al |
||
660 | avx_movd_reg_ready: |
||
661 | test [rex_prefix],8 |
||
662 | jz nomem_instruction_ready |
||
663 | cmp [code_type],64 |
||
664 | jne illegal_instruction |
||
665 | jmp nomem_instruction_ready |
||
666 | avx_movd_xmmreg: |
||
667 | sub [extended_code],10h |
||
668 | call convert_avx_register |
||
669 | cmp ah,16 |
||
670 | jne invalid_operand_size |
||
671 | mov [postbyte_register],al |
||
672 | mov [operand_size],0 |
||
673 | lods byte [esi] |
||
674 | cmp al,',' |
||
675 | jne invalid_operand |
||
676 | lods byte [esi] |
||
677 | call get_size_operator |
||
678 | cmp al,10h |
||
679 | je avx_movd_xmmreg_reg |
||
680 | cmp al,'[' |
||
681 | jne invalid_operand |
||
682 | call get_address |
||
683 | mov al,[mmx_size] |
||
684 | cmp al,8 |
||
685 | jne avx_movd_xmmreg_mem_ready |
||
686 | call avx_movq_xmmreg_xmmreg_opcode |
||
687 | avx_movd_xmmreg_mem_ready: |
||
688 | not al |
||
689 | test [operand_size],al |
||
690 | jnz invalid_operand_size |
||
691 | jmp instruction_ready |
||
692 | avx_movd_xmmreg_reg: |
||
693 | lods byte [esi] |
||
694 | cmp al,0C0h |
||
695 | jae avx_movq_xmmreg_xmmreg |
||
696 | call convert_register |
||
697 | cmp ah,[mmx_size] |
||
698 | jne invalid_operand_size |
||
699 | mov bl,al |
||
700 | jmp avx_movd_reg_ready |
||
701 | avx_movq_xmmreg_xmmreg: |
||
702 | cmp [mmx_size],8 |
||
703 | jne invalid_operand |
||
704 | call avx_movq_xmmreg_xmmreg_opcode |
||
705 | call convert_avx_register |
||
706 | cmp ah,16 |
||
707 | jne invalid_operand_size |
||
708 | mov bl,al |
||
709 | jmp nomem_instruction_ready |
||
710 | avx_movq_xmmreg_xmmreg_opcode: |
||
711 | and [rex_prefix],not 8 |
||
712 | or [rex_prefix],80h |
||
713 | add [extended_code],10h |
||
714 | mov [opcode_prefix],0F3h |
||
715 | ret |
||
716 | avx_movddup_instruction: |
||
717 | or [vex_required],1 |
||
718 | mov [opcode_prefix],0F2h |
||
719 | mov [base_code],0Fh |
||
720 | mov [extended_code],al |
||
721 | or [rex_prefix],80h |
||
722 | xor al,al |
||
723 | mov [mmx_size],al |
||
724 | mov [broadcast_size],al |
||
725 | lods byte [esi] |
||
726 | call get_size_operator |
||
727 | cmp al,10h |
||
728 | jne invalid_operand |
||
729 | lods byte [esi] |
||
730 | call convert_avx_register |
||
731 | mov [postbyte_register],al |
||
732 | cmp ah,16 |
||
733 | ja avx_movddup_size_ok |
||
734 | mov [mmx_size],8 |
||
735 | avx_movddup_size_ok: |
||
736 | call take_avx512_mask |
||
737 | jmp avx_vex_reg_ok |
||
738 | avx_movlpd_instruction: |
||
739 | mov [opcode_prefix],66h |
||
740 | or [rex_prefix],80h |
||
741 | avx_movlps_instruction: |
||
742 | mov [base_code],0Fh |
||
743 | mov [extended_code],al |
||
744 | mov [mmx_size],8 |
||
745 | mov [broadcast_size],0 |
||
746 | or [vex_required],1 |
||
747 | lods byte [esi] |
||
748 | call get_size_operator |
||
749 | cmp al,10h |
||
750 | jne avx_movlps_mem |
||
751 | lods byte [esi] |
||
752 | call convert_avx_register |
||
753 | mov [postbyte_register],al |
||
754 | lods byte [esi] |
||
755 | cmp al,',' |
||
756 | jne invalid_operand |
||
757 | call take_avx_register |
||
758 | mov [vex_register],al |
||
759 | cmp [operand_size],16 |
||
760 | jne invalid_operand |
||
761 | mov [operand_size],0 |
||
762 | lods byte [esi] |
||
763 | cmp al,',' |
||
764 | jne invalid_operand |
||
765 | call take_avx_rm |
||
766 | jc invalid_operand |
||
767 | jmp instruction_ready |
||
768 | avx_movlps_mem: |
||
769 | cmp al,'[' |
||
770 | jne invalid_operand |
||
771 | call get_address |
||
772 | avx_movlps_mem_: |
||
773 | mov al,[operand_size] |
||
774 | or al,al |
||
775 | jz avx_movlps_mem_size_ok |
||
776 | cmp al,[mmx_size] |
||
777 | jne invalid_operand_size |
||
778 | mov [operand_size],0 |
||
779 | avx_movlps_mem_size_ok: |
||
780 | lods byte [esi] |
||
781 | cmp al,',' |
||
782 | jne invalid_operand |
||
783 | call take_avx_register |
||
784 | cmp ah,16 |
||
785 | jne invalid_operand |
||
786 | mov [postbyte_register],al |
||
787 | inc [extended_code] |
||
788 | jmp instruction_ready |
||
789 | avx_movhlps_instruction: |
||
790 | mov [base_code],0Fh |
||
791 | mov [extended_code],al |
||
792 | or [vex_required],1 |
||
793 | call take_avx_register |
||
794 | cmp ah,16 |
||
795 | jne invalid_operand |
||
796 | mov [postbyte_register],al |
||
797 | lods byte [esi] |
||
798 | cmp al,',' |
||
799 | jne invalid_operand |
||
800 | call take_avx_register |
||
801 | mov [vex_register],al |
||
802 | lods byte [esi] |
||
803 | cmp al,',' |
||
804 | jne invalid_operand |
||
805 | call take_avx_register |
||
806 | mov bl,al |
||
807 | jmp nomem_instruction_ready |
||
808 | avx_movsd_instruction: |
||
809 | mov al,0F2h |
||
810 | mov cl,8 |
||
811 | or [rex_prefix],80h |
||
812 | jmp avx_movs_instruction |
||
813 | avx_movss_instruction: |
||
814 | mov al,0F3h |
||
815 | mov cl,4 |
||
816 | avx_movs_instruction: |
||
817 | mov [opcode_prefix],al |
||
818 | mov [mmx_size],cl |
||
819 | or [vex_required],1 |
||
820 | mov [base_code],0Fh |
||
821 | mov [extended_code],10h |
||
822 | lods byte [esi] |
||
823 | call get_size_operator |
||
824 | cmp al,10h |
||
825 | jne avx_movs_mem |
||
826 | lods byte [esi] |
||
827 | call convert_avx_register |
||
828 | cmp ah,16 |
||
829 | jne invalid_operand |
||
830 | mov [postbyte_register],al |
||
831 | call take_avx512_mask |
||
832 | xor cl,cl |
||
833 | xchg cl,[operand_size] |
||
834 | lods byte [esi] |
||
835 | cmp al,',' |
||
836 | jne invalid_operand |
||
837 | lods byte [esi] |
||
838 | call get_size_operator |
||
839 | cmp al,10h |
||
840 | jne avx_movs_reg_mem |
||
841 | mov [operand_size],cl |
||
842 | lods byte [esi] |
||
843 | call convert_avx_register |
||
844 | mov [vex_register],al |
||
845 | lods byte [esi] |
||
846 | cmp al,',' |
||
847 | jne invalid_operand |
||
848 | call take_avx_register |
||
849 | mov bl,al |
||
850 | cmp bl,8 |
||
851 | jb nomem_instruction_ready |
||
852 | inc [extended_code] |
||
853 | xchg bl,[postbyte_register] |
||
854 | jmp nomem_instruction_ready |
||
855 | avx_movs_reg_mem: |
||
856 | cmp al,'[' |
||
857 | jne invalid_operand |
||
858 | call get_address |
||
859 | mov al,[operand_size] |
||
860 | or al,al |
||
861 | jz avx_movs_reg_mem_ok |
||
862 | cmp al,[mmx_size] |
||
863 | jne invalid_operand_size |
||
864 | avx_movs_reg_mem_ok: |
||
865 | jmp instruction_ready |
||
866 | avx_movs_mem: |
||
867 | cmp al,'[' |
||
868 | jne invalid_operand |
||
869 | call get_address |
||
870 | or [operand_flags],20h |
||
871 | call take_avx512_mask |
||
872 | jmp avx_movlps_mem_ |
||
873 | |||
874 | |||
875 | or [operand_flags],2+4+10h |
||
876 | mov cl,4 |
||
877 | jmp avx_instruction |
||
878 | avx_comisd_instruction: |
||
879 | or [operand_flags],2+4+10h |
||
880 | mov [opcode_prefix],66h |
||
881 | or [rex_prefix],80h |
||
882 | mov cl,8 |
||
883 | jmp avx_instruction |
||
884 | avx_movshdup_instruction: |
||
885 | or [operand_flags],2 |
||
886 | mov [opcode_prefix],0F3h |
||
887 | xor cl,cl |
||
888 | jmp avx_instruction |
||
889 | avx_cvtqq2pd_instruction: |
||
890 | mov [opcode_prefix],0F3h |
||
891 | or [vex_required],8 |
||
892 | or [operand_flags],2+4+8 |
||
893 | or [rex_prefix],8 |
||
894 | mov cx,0800h |
||
895 | jmp avx_instruction_with_broadcast |
||
896 | avx_pshuf_w_instruction: |
||
897 | mov [opcode_prefix],al |
||
898 | or [operand_flags],2 |
||
899 | mov [immediate_size],1 |
||
900 | mov al,70h |
||
901 | xor cl,cl |
||
902 | jmp avx_instruction |
||
903 | avx_single_source_128bit_instruction_38_noevex: |
||
904 | or [operand_flags],2 |
||
905 | avx_128bit_instruction_38_noevex: |
||
906 | mov cl,16 |
||
907 | jmp avx_instruction_38_noevex |
||
908 | avx_single_source_instruction_38_noevex: |
||
909 | or [operand_flags],2 |
||
910 | jmp avx_pi_instruction_38_noevex |
||
911 | avx_pi_instruction_38_noevex: |
||
912 | xor cl,cl |
||
913 | avx_instruction_38_noevex: |
||
914 | or [vex_required],2 |
||
915 | avx_instruction_38: |
||
916 | mov [opcode_prefix],66h |
||
917 | mov [supplemental_code],al |
||
918 | mov al,38h |
||
919 | jmp avx_instruction |
||
920 | avx_ss_instruction_3a_imm8_noevex: |
||
921 | mov cl,4 |
||
922 | jmp avx_instruction_3a_imm8_noevex |
||
923 | avx_sd_instruction_3a_imm8_noevex: |
||
924 | mov cl,8 |
||
925 | jmp avx_instruction_3a_imm8_noevex |
||
926 | avx_single_source_128bit_instruction_3a_imm8_noevex: |
||
927 | or [operand_flags],2 |
||
928 | avx_128bit_instruction_3a_imm8_noevex: |
||
929 | mov cl,16 |
||
930 | jmp avx_instruction_3a_imm8_noevex |
||
931 | avx_triple_source_instruction_3a_noevex: |
||
932 | xor cl,cl |
||
933 | mov [immediate_size],-1 |
||
934 | mov byte [value],0 |
||
935 | jmp avx_instruction_3a_noevex |
||
936 | avx_single_source_instruction_3a_imm8_noevex: |
||
937 | or [operand_flags],2 |
||
938 | avx_pi_instruction_3a_imm8_noevex: |
||
939 | xor cl,cl |
||
940 | avx_instruction_3a_imm8_noevex: |
||
941 | mov [immediate_size],1 |
||
942 | avx_instruction_3a_noevex: |
||
943 | or [vex_required],2 |
||
944 | avx_instruction_3a: |
||
945 | mov [opcode_prefix],66h |
||
946 | mov [supplemental_code],al |
||
947 | mov al,3Ah |
||
948 | jmp avx_instruction |
||
949 | avx_pi_instruction_3a_imm8: |
||
950 | xor cl,cl |
||
951 | mov [immediate_size],1 |
||
952 | jmp avx_instruction_3a |
||
953 | avx_pclmulqdq_instruction: |
||
954 | mov byte [value],al |
||
955 | mov [immediate_size],-4 |
||
956 | xor cl,cl |
||
957 | mov al,44h |
||
958 | or [operand_flags],10h |
||
959 | jmp avx_instruction_3a |
||
960 | avx_instruction_38_nomask: |
||
961 | or [operand_flags],10h |
||
962 | xor cl,cl |
||
963 | jmp avx_instruction_38 |
||
964 | |||
965 | |||
966 | or [operand_flags],2 |
||
967 | avx512_pd_instruction_sae_imm8: |
||
968 | or [rex_prefix],8 |
||
969 | mov cx,0800h |
||
970 | jmp avx512_instruction_sae_imm8 |
||
971 | avx512_single_source_ps_instruction_sae_imm8: |
||
972 | or [operand_flags],2 |
||
973 | avx512_ps_instruction_sae_imm8: |
||
974 | mov cx,0400h |
||
975 | jmp avx512_instruction_sae_imm8 |
||
976 | avx512_sd_instruction_sae_imm8: |
||
977 | or [rex_prefix],8 |
||
978 | mov cx,0008h |
||
979 | jmp avx512_instruction_sae_imm8 |
||
980 | avx512_ss_instruction_sae_imm8: |
||
981 | mov cx,0004h |
||
982 | avx512_instruction_sae_imm8: |
||
983 | or [operand_flags],4 |
||
984 | avx512_instruction_imm8: |
||
985 | or [vex_required],8 |
||
986 | mov [opcode_prefix],66h |
||
987 | mov [immediate_size],1 |
||
988 | mov [supplemental_code],al |
||
989 | mov al,3Ah |
||
990 | jmp avx_instruction_with_broadcast |
||
991 | avx512_pd_instruction_er: |
||
992 | or [operand_flags],4+8 |
||
993 | jmp avx512_pd_instruction |
||
994 | avx512_single_source_pd_instruction_sae: |
||
995 | or [operand_flags],4 |
||
996 | avx512_single_source_pd_instruction: |
||
997 | or [operand_flags],2 |
||
998 | avx512_pd_instruction: |
||
999 | or [rex_prefix],8 |
||
1000 | mov cx,0800h |
||
1001 | jmp avx512_instruction |
||
1002 | avx512_ps_instruction_er: |
||
1003 | or [operand_flags],4+8 |
||
1004 | jmp avx512_ps_instruction |
||
1005 | avx512_single_source_ps_instruction_sae: |
||
1006 | or [operand_flags],4 |
||
1007 | avx512_single_source_ps_instruction: |
||
1008 | or [operand_flags],2 |
||
1009 | avx512_ps_instruction: |
||
1010 | mov cx,0400h |
||
1011 | jmp avx512_instruction |
||
1012 | avx512_sd_instruction_er: |
||
1013 | or [operand_flags],8 |
||
1014 | avx512_sd_instruction_sae: |
||
1015 | or [operand_flags],4 |
||
1016 | avx512_sd_instruction: |
||
1017 | or [rex_prefix],8 |
||
1018 | mov cx,0008h |
||
1019 | jmp avx512_instruction |
||
1020 | avx512_ss_instruction_er: |
||
1021 | or [operand_flags],8 |
||
1022 | avx512_ss_instruction_sae: |
||
1023 | or [operand_flags],4 |
||
1024 | avx512_ss_instruction: |
||
1025 | mov cx,0004h |
||
1026 | avx512_instruction: |
||
1027 | or [vex_required],8 |
||
1028 | mov [opcode_prefix],66h |
||
1029 | mov [supplemental_code],al |
||
1030 | mov al,38h |
||
1031 | jmp avx_instruction_with_broadcast |
||
1032 | avx512_exp2pd_instruction: |
||
1033 | or [rex_prefix],8 |
||
1034 | or [operand_flags],2+4 |
||
1035 | mov cx,0840h |
||
1036 | jmp avx512_instruction |
||
1037 | avx512_exp2ps_instruction: |
||
1038 | or [operand_flags],2+4 |
||
1039 | mov cx,0440h |
||
1040 | jmp avx512_instruction |
||
1041 | |||
1042 | |||
1043 | or [rex_prefix],8 |
||
1044 | mov cx,0800h |
||
1045 | jmp fma_instruction |
||
1046 | fma_instruction_ps: |
||
1047 | mov cx,0400h |
||
1048 | jmp fma_instruction |
||
1049 | fma_instruction_sd: |
||
1050 | or [rex_prefix],8 |
||
1051 | mov cx,0008h |
||
1052 | jmp fma_instruction |
||
1053 | fma_instruction_ss: |
||
1054 | mov cx,0004h |
||
1055 | fma_instruction: |
||
1056 | or [operand_flags],4+8 |
||
1057 | mov [opcode_prefix],66h |
||
1058 | mov [supplemental_code],al |
||
1059 | mov al,38h |
||
1060 | jmp avx_instruction_with_broadcast |
||
1061 | |||
1062 | |||
1063 | xor cl,cl |
||
1064 | jmp fma4_instruction |
||
1065 | fma4_instruction_sd: |
||
1066 | mov cl,8 |
||
1067 | jmp fma4_instruction |
||
1068 | fma4_instruction_ss: |
||
1069 | mov cl,4 |
||
1070 | fma4_instruction: |
||
1071 | mov [immediate_size],-2 |
||
1072 | mov byte [value],0 |
||
1073 | jmp avx_instruction_3a_noevex |
||
1074 | |||
1075 | |||
1076 | mov [opcode_prefix],66h |
||
1077 | or [rex_prefix],80h |
||
1078 | mov cx,0800h |
||
1079 | jmp avx_cmp_instruction |
||
1080 | avx_cmp_ps_instruction: |
||
1081 | mov cx,0400h |
||
1082 | jmp avx_cmp_instruction |
||
1083 | avx_cmp_sd_instruction: |
||
1084 | mov [opcode_prefix],0F2h |
||
1085 | or [rex_prefix],80h |
||
1086 | mov cx,0008h |
||
1087 | jmp avx_cmp_instruction |
||
1088 | avx_cmp_ss_instruction: |
||
1089 | mov [opcode_prefix],0F3h |
||
1090 | mov cx,0004h |
||
1091 | avx_cmp_instruction: |
||
1092 | mov byte [value],al |
||
1093 | mov [immediate_size],-4 |
||
1094 | or [operand_flags],4+20h |
||
1095 | mov al,0C2h |
||
1096 | jmp avx_cmp_common |
||
1097 | avx_cmpeqq_instruction: |
||
1098 | or [rex_prefix],80h |
||
1099 | mov ch,8 |
||
1100 | mov [supplemental_code],al |
||
1101 | mov al,38h |
||
1102 | jmp avx_cmp_pi_instruction |
||
1103 | avx_cmpeqd_instruction: |
||
1104 | mov ch,4 |
||
1105 | jmp avx_cmp_pi_instruction |
||
1106 | avx_cmpeqb_instruction: |
||
1107 | xor ch,ch |
||
1108 | jmp avx_cmp_pi_instruction |
||
1109 | avx512_cmp_uq_instruction: |
||
1110 | or [rex_prefix],8 |
||
1111 | mov ch,8 |
||
1112 | mov ah,1Eh |
||
1113 | jmp avx_cmp_pi_instruction_evex |
||
1114 | avx512_cmp_ud_instruction: |
||
1115 | mov ch,4 |
||
1116 | mov ah,1Eh |
||
1117 | jmp avx_cmp_pi_instruction_evex |
||
1118 | avx512_cmp_q_instruction: |
||
1119 | or [rex_prefix],8 |
||
1120 | mov ch,8 |
||
1121 | mov ah,1Fh |
||
1122 | jmp avx_cmp_pi_instruction_evex |
||
1123 | avx512_cmp_d_instruction: |
||
1124 | mov ch,4 |
||
1125 | mov ah,1Fh |
||
1126 | jmp avx_cmp_pi_instruction_evex |
||
1127 | avx512_cmp_uw_instruction: |
||
1128 | or [rex_prefix],8 |
||
1129 | avx512_cmp_ub_instruction: |
||
1130 | xor ch,ch |
||
1131 | mov ah,3Eh |
||
1132 | jmp avx_cmp_pi_instruction_evex |
||
1133 | avx512_cmp_w_instruction: |
||
1134 | or [rex_prefix],8 |
||
1135 | avx512_cmp_b_instruction: |
||
1136 | xor ch,ch |
||
1137 | mov ah,3Fh |
||
1138 | avx_cmp_pi_instruction_evex: |
||
1139 | mov byte [value],al |
||
1140 | mov [immediate_size],-4 |
||
1141 | mov [supplemental_code],ah |
||
1142 | mov al,3Ah |
||
1143 | or [vex_required],8 |
||
1144 | avx_cmp_pi_instruction: |
||
1145 | xor cl,cl |
||
1146 | or [operand_flags],20h |
||
1147 | mov [opcode_prefix],66h |
||
1148 | avx_cmp_common: |
||
1149 | mov [mmx_size],cl |
||
1150 | mov [broadcast_size],ch |
||
1151 | mov [extended_code],al |
||
1152 | mov [base_code],0Fh |
||
1153 | lods byte [esi] |
||
1154 | call get_size_operator |
||
1155 | cmp al,14h |
||
1156 | je avx_maskreg |
||
1157 | cmp al,10h |
||
1158 | jne invalid_operand |
||
1159 | or [vex_required],2 |
||
1160 | jmp avx_reg |
||
1161 | avx_maskreg: |
||
1162 | cmp [operand_size],0 |
||
1163 | jne invalid_operand_size |
||
1164 | or [vex_required],8 |
||
1165 | lods byte [esi] |
||
1166 | call convert_mask_register |
||
1167 | mov [postbyte_register],al |
||
1168 | call take_avx512_mask |
||
1169 | jmp avx_vex_reg |
||
1170 | avx512_fpclasspd_instruction: |
||
1171 | or [rex_prefix],8 |
||
1172 | mov cx,0800h |
||
1173 | jmp avx_fpclass_instruction |
||
1174 | avx512_fpclassps_instruction: |
||
1175 | mov cx,0400h |
||
1176 | jmp avx_fpclass_instruction |
||
1177 | avx512_fpclasssd_instruction: |
||
1178 | or [rex_prefix],8 |
||
1179 | mov cx,0008h |
||
1180 | jmp avx_fpclass_instruction |
||
1181 | avx512_fpclassss_instruction: |
||
1182 | mov cx,0004h |
||
1183 | avx_fpclass_instruction: |
||
1184 | mov [broadcast_size],ch |
||
1185 | mov [mmx_size],cl |
||
1186 | or [operand_flags],2 |
||
1187 | call setup_66_0f_3a |
||
1188 | mov [immediate_size],1 |
||
1189 | lods byte [esi] |
||
1190 | cmp al,14h |
||
1191 | je avx_maskreg |
||
1192 | jmp invalid_operand |
||
1193 | avx512_ptestnmd_instruction: |
||
1194 | mov ch,4 |
||
1195 | jmp avx512_ptestnm_instruction |
||
1196 | avx512_ptestnmq_instruction: |
||
1197 | or [rex_prefix],8 |
||
1198 | mov ch,8 |
||
1199 | jmp avx512_ptestnm_instruction |
||
1200 | avx512_ptestnmw_instruction: |
||
1201 | or [rex_prefix],8 |
||
1202 | avx512_ptestnmb_instruction: |
||
1203 | xor ch,ch |
||
1204 | avx512_ptestnm_instruction: |
||
1205 | mov ah,0F3h |
||
1206 | jmp avx512_ptest_instruction |
||
1207 | avx512_ptestmd_instruction: |
||
1208 | mov ch,4 |
||
1209 | jmp avx512_ptestm_instruction |
||
1210 | avx512_ptestmq_instruction: |
||
1211 | or [rex_prefix],8 |
||
1212 | mov ch,8 |
||
1213 | jmp avx512_ptestm_instruction |
||
1214 | avx512_ptestmw_instruction: |
||
1215 | or [rex_prefix],8 |
||
1216 | avx512_ptestmb_instruction: |
||
1217 | xor ch,ch |
||
1218 | avx512_ptestm_instruction: |
||
1219 | mov ah,66h |
||
1220 | avx512_ptest_instruction: |
||
1221 | xor cl,cl |
||
1222 | mov [opcode_prefix],ah |
||
1223 | mov [supplemental_code],al |
||
1224 | mov al,38h |
||
1225 | or [vex_required],8 |
||
1226 | jmp avx_cmp_common |
||
1227 | |||
1228 | |||
1229 | or [rex_prefix],8 |
||
1230 | mask_shift_instruction_d: |
||
1231 | or [operand_flags],2 |
||
1232 | or [immediate_size],1 |
||
1233 | mov [opcode_prefix],66h |
||
1234 | mov [supplemental_code],al |
||
1235 | mov al,3Ah |
||
1236 | jmp mask_instruction |
||
1237 | mask_instruction_single_source_b: |
||
1238 | mov [opcode_prefix],66h |
||
1239 | jmp mask_instruction_single_source_w |
||
1240 | mask_instruction_single_source_d: |
||
1241 | mov [opcode_prefix],66h |
||
1242 | mask_instruction_single_source_q: |
||
1243 | or [rex_prefix],8 |
||
1244 | mask_instruction_single_source_w: |
||
1245 | or [operand_flags],2 |
||
1246 | jmp mask_instruction |
||
1247 | mask_instruction_b: |
||
1248 | mov [opcode_prefix],66h |
||
1249 | jmp mask_instruction_w |
||
1250 | mask_instruction_d: |
||
1251 | mov [opcode_prefix],66h |
||
1252 | mask_instruction_q: |
||
1253 | or [rex_prefix],8 |
||
1254 | mask_instruction_w: |
||
1255 | mov [operand_size],32 |
||
1256 | mask_instruction: |
||
1257 | or [vex_required],1 |
||
1258 | mov [base_code],0Fh |
||
1259 | mov [extended_code],al |
||
1260 | call take_mask_register |
||
1261 | mov [postbyte_register],al |
||
1262 | test [operand_flags],2 |
||
1263 | jnz mask_instruction_nds_ok |
||
1264 | lods byte [esi] |
||
1265 | cmp al,',' |
||
1266 | jne invalid_operand |
||
1267 | call take_mask_register |
||
1268 | mov [vex_register],al |
||
1269 | mask_instruction_nds_ok: |
||
1270 | lods byte [esi] |
||
1271 | cmp al,',' |
||
1272 | jne invalid_operand |
||
1273 | call take_mask_register |
||
1274 | mov bl,al |
||
1275 | cmp [immediate_size],0 |
||
1276 | jne mmx_nomem_imm8 |
||
1277 | jmp nomem_instruction_ready |
||
1278 | take_mask_register: |
||
1279 | lods byte [esi] |
||
1280 | cmp al,14h |
||
1281 | jne invalid_operand |
||
1282 | lods byte [esi] |
||
1283 | convert_mask_register: |
||
1284 | mov ah,al |
||
1285 | shr ah,4 |
||
1286 | cmp ah,5 |
||
1287 | jne invalid_operand |
||
1288 | and al,1111b |
||
1289 | ret |
||
1290 | kmov_instruction: |
||
1291 | mov [mmx_size],al |
||
1292 | or [vex_required],1 |
||
1293 | mov [base_code],0Fh |
||
1294 | mov [extended_code],90h |
||
1295 | lods byte [esi] |
||
1296 | cmp al,14h |
||
1297 | je kmov_maskreg |
||
1298 | cmp al,10h |
||
1299 | je kmov_reg |
||
1300 | call get_size_operator |
||
1301 | inc [extended_code] |
||
1302 | cmp al,'[' |
||
1303 | jne invalid_argument |
||
1304 | call get_address |
||
1305 | lods byte [esi] |
||
1306 | cmp al,',' |
||
1307 | jne invalid_operand |
||
1308 | call take_mask_register |
||
1309 | mov [postbyte_register],al |
||
1310 | kmov_with_mem: |
||
1311 | mov ah,[mmx_size] |
||
1312 | mov al,[operand_size] |
||
1313 | or al,al |
||
1314 | jz kmov_mem_size_ok |
||
1315 | cmp al,ah |
||
1316 | jne invalid_operand_size |
||
1317 | kmov_mem_size_ok: |
||
1318 | call setup_kmov_prefix |
||
1319 | jmp instruction_ready |
||
1320 | setup_kmov_prefix: |
||
1321 | cmp ah,4 |
||
1322 | jb kmov_w_ok |
||
1323 | or [rex_prefix],8 |
||
1324 | kmov_w_ok: |
||
1325 | test ah,1 or 4 |
||
1326 | jz kmov_prefix_ok |
||
1327 | mov [opcode_prefix],66h |
||
1328 | kmov_prefix_ok: |
||
1329 | ret |
||
1330 | kmov_maskreg: |
||
1331 | lods byte [esi] |
||
1332 | call convert_mask_register |
||
1333 | mov [postbyte_register],al |
||
1334 | lods byte [esi] |
||
1335 | cmp al,',' |
||
1336 | jne invalid_operand |
||
1337 | lods byte [esi] |
||
1338 | cmp al,14h |
||
1339 | je kmov_maskreg_maskreg |
||
1340 | cmp al,10h |
||
1341 | je kmov_maskreg_reg |
||
1342 | call get_size_operator |
||
1343 | cmp al,'[' |
||
1344 | jne invalid_argument |
||
1345 | call get_address |
||
1346 | jmp kmov_with_mem |
||
1347 | kmov_maskreg_maskreg: |
||
1348 | lods byte [esi] |
||
1349 | call convert_mask_register |
||
1350 | mov bl,al |
||
1351 | mov ah,[mmx_size] |
||
1352 | call setup_kmov_prefix |
||
1353 | jmp nomem_instruction_ready |
||
1354 | kmov_maskreg_reg: |
||
1355 | add [extended_code],2 |
||
1356 | lods byte [esi] |
||
1357 | call convert_register |
||
1358 | kmov_with_reg: |
||
1359 | mov bl,al |
||
1360 | mov al,[mmx_size] |
||
1361 | mov ah,4 |
||
1362 | cmp al,ah |
||
1363 | jbe kmov_reg_size_check |
||
1364 | mov ah,al |
||
1365 | kmov_reg_size_check: |
||
1366 | cmp ah,[operand_size] |
||
1367 | jne invalid_operand_size |
||
1368 | cmp al,8 |
||
1369 | je kmov_f2_w1 |
||
1370 | cmp al,2 |
||
1371 | ja kmov_f2 |
||
1372 | je nomem_instruction_ready |
||
1373 | mov [opcode_prefix],66h |
||
1374 | jmp nomem_instruction_ready |
||
1375 | kmov_f2_w1: |
||
1376 | or [rex_prefix],8 |
||
1377 | cmp [code_type],64 |
||
1378 | jne illegal_instruction |
||
1379 | kmov_f2: |
||
1380 | mov [opcode_prefix],0F2h |
||
1381 | jmp nomem_instruction_ready |
||
1382 | kmov_reg: |
||
1383 | add [extended_code],3 |
||
1384 | lods byte [esi] |
||
1385 | call convert_register |
||
1386 | mov [postbyte_register],al |
||
1387 | lods byte [esi] |
||
1388 | cmp al,',' |
||
1389 | jne invalid_operand |
||
1390 | call take_mask_register |
||
1391 | jmp kmov_with_reg |
||
1392 | avx512_pmov_m2_instruction_w1: |
||
1393 | or [rex_prefix],8 |
||
1394 | avx512_pmov_m2_instruction: |
||
1395 | or [vex_required],8 |
||
1396 | call setup_f3_0f_38 |
||
1397 | call take_avx_register |
||
1398 | mov [postbyte_register],al |
||
1399 | lods byte [esi] |
||
1400 | cmp al,',' |
||
1401 | jne invalid_operand |
||
1402 | call take_mask_register |
||
1403 | mov bl,al |
||
1404 | jmp nomem_instruction_ready |
||
1405 | avx512_pmov_2m_instruction_w1: |
||
1406 | or [rex_prefix],8 |
||
1407 | avx512_pmov_2m_instruction: |
||
1408 | or [vex_required],8 |
||
1409 | call setup_f3_0f_38 |
||
1410 | call take_mask_register |
||
1411 | mov [postbyte_register],al |
||
1412 | lods byte [esi] |
||
1413 | cmp al,',' |
||
1414 | jne invalid_operand |
||
1415 | call take_avx_register |
||
1416 | mov bl,al |
||
1417 | jmp nomem_instruction_ready |
||
1418 | setup_f3_0f_38: |
||
1419 | mov [extended_code],38h |
||
1420 | mov [supplemental_code],al |
||
1421 | mov [base_code],0Fh |
||
1422 | mov [opcode_prefix],0F3h |
||
1423 | ret |
||
1424 | |||
1425 | |||
1426 | mov [operand_size],32 |
||
1427 | vzeroupper_instruction: |
||
1428 | mov [base_code],0Fh |
||
1429 | mov [extended_code],al |
||
1430 | and [displacement_compression],0 |
||
1431 | call store_vex_instruction_code |
||
1432 | jmp instruction_assembled |
||
1433 | vstmxcsr_instruction: |
||
9459 | leency | 1434 | or [vex_required],2 |
7836 | leency | 1435 | jmp stmxcsr_instruction |
9459 | leency | 1436 | |
7836 | leency | 1437 | |
1438 | or [vex_required],2 |
||
1439 | xor ch,ch |
||
1440 | avx_instruction_imm8_without_128bit: |
||
1441 | mov [immediate_size],1 |
||
1442 | mov ah,3Ah |
||
1443 | jmp avx_instruction_without_128bit |
||
1444 | avx512_shuf_q_instruction: |
||
1445 | or [rex_prefix],8 |
||
1446 | or [vex_required],8 |
||
1447 | mov ch,8 |
||
1448 | jmp avx_instruction_imm8_without_128bit |
||
1449 | avx512_shuf_d_instruction: |
||
1450 | or [vex_required],8 |
||
1451 | mov ch,4 |
||
1452 | jmp avx_instruction_imm8_without_128bit |
||
1453 | avx_permd_instruction: |
||
1454 | mov ah,38h |
||
1455 | mov ch,4 |
||
1456 | avx_instruction_without_128bit: |
||
1457 | xor cl,cl |
||
1458 | call setup_avx_66_supplemental |
||
1459 | call take_avx_register |
||
1460 | cmp ah,32 |
||
1461 | jb invalid_operand_size |
||
1462 | mov [postbyte_register],al |
||
1463 | call take_avx512_mask |
||
1464 | jmp avx_vex_reg |
||
1465 | setup_avx_66_supplemental: |
||
1466 | mov [opcode_prefix],66h |
||
1467 | mov [broadcast_size],ch |
||
1468 | mov [mmx_size],cl |
||
1469 | mov [base_code],0Fh |
||
1470 | mov [extended_code],ah |
||
1471 | mov [supplemental_code],al |
||
1472 | or [vex_required],1 |
||
1473 | ret |
||
1474 | avx_permq_instruction: |
||
1475 | or [rex_prefix],8 |
||
1476 | mov ch,8 |
||
1477 | jmp avx_permil_instruction |
||
1478 | avx_permilpd_instruction: |
||
1479 | or [rex_prefix],80h |
||
1480 | mov ch,8 |
||
1481 | jmp avx_permil_instruction |
||
1482 | avx_permilps_instruction: |
||
1483 | mov ch,4 |
||
1484 | avx_permil_instruction: |
||
1485 | or [operand_flags],2 |
||
1486 | xor cl,cl |
||
1487 | mov ah,3Ah |
||
1488 | call setup_avx_66_supplemental |
||
1489 | call take_avx_register |
||
1490 | cmp [supplemental_code],4 |
||
1491 | jae avx_permil_size_ok |
||
1492 | cmp ah,32 |
||
1493 | jb invalid_operand_size |
||
1494 | avx_permil_size_ok: |
||
1495 | mov [postbyte_register],al |
||
1496 | call take_avx512_mask |
||
1497 | lods byte [esi] |
||
1498 | cmp al,',' |
||
1499 | jne invalid_operand |
||
1500 | call take_avx_rm |
||
1501 | jnc mmx_imm8 |
||
1502 | mov bl,al |
||
1503 | cmp byte [esi],',' |
||
1504 | jne invalid_operand |
||
1505 | mov al,[esi+1] |
||
1506 | cmp al,11h |
||
1507 | jne avx_permil_rm_or_imm8 |
||
1508 | mov al,[esi+3] |
||
1509 | avx_permil_rm_or_imm8: |
||
1510 | cmp al,'(' |
||
1511 | je mmx_nomem_imm8 |
||
1512 | mov [vex_register],bl |
||
1513 | inc esi |
||
1514 | mov [extended_code],38h |
||
1515 | mov al,[supplemental_code] |
||
1516 | cmp al,4 |
||
1517 | jb avx_permq_rm |
||
1518 | add [supplemental_code],8 |
||
1519 | jmp avx_regs_rm |
||
1520 | avx_permq_rm: |
||
1521 | or [vex_required],8 |
||
1522 | shl al,5 |
||
1523 | neg al |
||
1524 | add al,36h |
||
1525 | mov [supplemental_code],al |
||
1526 | jmp avx_regs_rm |
||
1527 | vpermil_2pd_instruction: |
||
1528 | mov [immediate_size],-2 |
||
1529 | mov byte [value],al |
||
1530 | mov al,49h |
||
1531 | jmp vpermil2_instruction_setup |
||
1532 | vpermil_2ps_instruction: |
||
1533 | mov [immediate_size],-2 |
||
1534 | mov byte [value],al |
||
1535 | mov al,48h |
||
1536 | jmp vpermil2_instruction_setup |
||
1537 | vpermil2_instruction: |
||
1538 | mov [immediate_size],-3 |
||
1539 | mov byte [value],0 |
||
1540 | vpermil2_instruction_setup: |
||
1541 | or [vex_required],2 |
||
1542 | mov [base_code],0Fh |
||
1543 | mov [supplemental_code],al |
||
1544 | mov al,3Ah |
||
1545 | xor cl,cl |
||
1546 | jmp avx_instruction |
||
1547 | |||
1548 | |||
1549 | or [vex_required],8 |
||
1550 | avx_shift_q_instruction: |
||
1551 | or [rex_prefix],80h |
||
1552 | mov cl,8 |
||
1553 | jmp avx_shift_instruction |
||
1554 | avx_shift_d_instruction: |
||
1555 | mov cl,4 |
||
1556 | jmp avx_shift_instruction |
||
1557 | avx_shift_bw_instruction: |
||
1558 | xor cl,cl |
||
1559 | avx_shift_instruction: |
||
1560 | mov [broadcast_size],cl |
||
1561 | mov [mmx_size],0 |
||
1562 | mov [opcode_prefix],66h |
||
1563 | mov [base_code],0Fh |
||
1564 | mov [extended_code],al |
||
1565 | or [vex_required],1 |
||
1566 | call take_avx_register |
||
1567 | mov [postbyte_register],al |
||
1568 | call take_avx512_mask |
||
1569 | lods byte [esi] |
||
1570 | cmp al,',' |
||
1571 | jne invalid_operand |
||
1572 | xor cl,cl |
||
1573 | xchg cl,[operand_size] |
||
1574 | lods byte [esi] |
||
1575 | call get_size_operator |
||
1576 | cmp al,'[' |
||
1577 | je avx_shift_reg_mem |
||
1578 | mov [operand_size],cl |
||
1579 | cmp al,10h |
||
1580 | jne invalid_operand |
||
1581 | lods byte [esi] |
||
1582 | call convert_avx_register |
||
1583 | mov [vex_register],al |
||
1584 | lods byte [esi] |
||
1585 | cmp al,',' |
||
1586 | jne invalid_operand |
||
1587 | push esi |
||
1588 | xor cl,cl |
||
1589 | xchg cl,[operand_size] |
||
1590 | lods byte [esi] |
||
1591 | call get_size_operator |
||
1592 | cmp al,10h |
||
1593 | je avx_shift_reg_reg_reg |
||
1594 | pop esi |
||
1595 | cmp al,'[' |
||
1596 | je avx_shift_reg_reg_mem |
||
1597 | xchg cl,[operand_size] |
||
1598 | test cl,not 1 |
||
1599 | jnz invalid_operand_size |
||
1600 | dec esi |
||
1601 | call convert_avx_shift_opcode |
||
1602 | mov bl,al |
||
1603 | jmp mmx_nomem_imm8 |
||
1604 | convert_avx_shift_opcode: |
||
1605 | mov al,[extended_code] |
||
1606 | mov ah,al |
||
1607 | and ah,1111b |
||
1608 | add ah,70h |
||
1609 | mov [extended_code],ah |
||
1610 | shr al,4 |
||
1611 | sub al,0Ch |
||
1612 | shl al,1 |
||
1613 | xchg al,[postbyte_register] |
||
1614 | xchg al,[vex_register] |
||
1615 | ret |
||
1616 | avx_shift_reg_reg_reg: |
||
1617 | pop eax |
||
1618 | lods byte [esi] |
||
1619 | call convert_xmm_register |
||
1620 | xchg cl,[operand_size] |
||
1621 | mov bl,al |
||
1622 | jmp nomem_instruction_ready |
||
1623 | avx_shift_reg_reg_mem: |
||
1624 | mov [mmx_size],16 |
||
1625 | push ecx |
||
1626 | lods byte [esi] |
||
1627 | call get_size_operator |
||
1628 | call get_address |
||
1629 | pop eax |
||
1630 | xchg al,[operand_size] |
||
1631 | test al,al |
||
1632 | jz instruction_ready |
||
1633 | cmp al,16 |
||
1634 | jne invalid_operand_size |
||
1635 | jmp instruction_ready |
||
1636 | avx_shift_reg_mem: |
||
1637 | or [vex_required],8 |
||
1638 | call take_avx_mem |
||
1639 | call convert_avx_shift_opcode |
||
1640 | jmp mmx_imm8 |
||
1641 | avx_shift_dq_instruction: |
||
1642 | mov [postbyte_register],al |
||
1643 | mov [opcode_prefix],66h |
||
1644 | mov [base_code],0Fh |
||
1645 | mov [extended_code],73h |
||
1646 | or [vex_required],1 |
||
1647 | mov [mmx_size],0 |
||
1648 | call take_avx_register |
||
1649 | mov [vex_register],al |
||
1650 | lods byte [esi] |
||
1651 | cmp al,',' |
||
1652 | jne invalid_operand |
||
1653 | lods byte [esi] |
||
1654 | call get_size_operator |
||
1655 | cmp al,'[' |
||
1656 | je avx_shift_dq_reg_mem |
||
1657 | cmp al,10h |
||
1658 | jne invalid_operand |
||
1659 | lods byte [esi] |
||
1660 | call convert_avx_register |
||
1661 | mov bl,al |
||
1662 | jmp mmx_nomem_imm8 |
||
1663 | avx_shift_dq_reg_mem: |
||
1664 | or [vex_required],8 |
||
1665 | call get_address |
||
1666 | jmp mmx_imm8 |
||
1667 | avx512_rotate_q_instruction: |
||
1668 | mov cl,8 |
||
1669 | or [rex_prefix],cl |
||
1670 | jmp avx512_rotate_instruction |
||
1671 | avx512_rotate_d_instruction: |
||
1672 | mov cl,4 |
||
1673 | avx512_rotate_instruction: |
||
1674 | mov [broadcast_size],cl |
||
1675 | mov [postbyte_register],al |
||
1676 | mov [opcode_prefix],66h |
||
1677 | mov [base_code],0Fh |
||
1678 | mov [extended_code],72h |
||
1679 | or [vex_required],8 |
||
1680 | mov [mmx_size],0 |
||
1681 | mov [immediate_size],1 |
||
1682 | call take_avx_register |
||
1683 | mov [vex_register],al |
||
1684 | call take_avx512_mask |
||
1685 | jmp avx_vex_reg_ok |
||
1686 | |||
1687 | |||
1688 | mov cl,2 |
||
1689 | jmp avx_pmovsx_instruction |
||
1690 | avx_pmovsxbd_instruction: |
||
1691 | mov cl,4 |
||
1692 | jmp avx_pmovsx_instruction |
||
1693 | avx_pmovsxbw_instruction: |
||
1694 | mov cl,8 |
||
1695 | avx_pmovsx_instruction: |
||
1696 | mov [mmx_size],cl |
||
1697 | or [vex_required],1 |
||
1698 | call setup_66_0f_38 |
||
1699 | call take_avx_register |
||
1700 | mov [postbyte_register],al |
||
1701 | call take_avx512_mask |
||
1702 | lods byte [esi] |
||
1703 | cmp al,',' |
||
1704 | jne invalid_operand |
||
1705 | xor al,al |
||
1706 | xchg al,[operand_size] |
||
1707 | bsf ecx,eax |
||
1708 | sub cl,4 |
||
1709 | shl [mmx_size],cl |
||
1710 | push eax |
||
1711 | lods byte [esi] |
||
1712 | call get_size_operator |
||
1713 | cmp al,10h |
||
1714 | je avx_pmovsx_reg_reg |
||
1715 | cmp al,'[' |
||
1716 | jne invalid_operand |
||
1717 | call get_address |
||
1718 | pop eax |
||
1719 | xchg al,[operand_size] |
||
1720 | or al,al |
||
1721 | jz instruction_ready |
||
1722 | cmp al,[mmx_size] |
||
1723 | jne invalid_operand_size |
||
1724 | jmp instruction_ready |
||
1725 | avx_pmovsx_reg_reg: |
||
1726 | lods byte [esi] |
||
1727 | call convert_avx_register |
||
1728 | mov bl,al |
||
1729 | cmp ah,[mmx_size] |
||
1730 | je avx_pmovsx_xmmreg_reg_size_ok |
||
1731 | jb invalid_operand_size |
||
1732 | cmp ah,16 |
||
1733 | jne invalid_operand_size |
||
1734 | avx_pmovsx_xmmreg_reg_size_ok: |
||
1735 | pop eax |
||
1736 | mov [operand_size],al |
||
1737 | jmp nomem_instruction_ready |
||
1738 | avx512_pmovqb_instruction: |
||
1739 | mov cl,2 |
||
1740 | jmp avx512_pmov_instruction |
||
1741 | avx512_pmovdb_instruction: |
||
1742 | mov cl,4 |
||
1743 | jmp avx512_pmov_instruction |
||
1744 | avx512_pmovwb_instruction: |
||
1745 | mov cl,8 |
||
1746 | avx512_pmov_instruction: |
||
1747 | mov [mmx_size],cl |
||
1748 | or [vex_required],8 |
||
1749 | mov [extended_code],38h |
||
1750 | mov [supplemental_code],al |
||
1751 | mov [base_code],0Fh |
||
1752 | mov [opcode_prefix],0F3h |
||
1753 | lods byte [esi] |
||
1754 | call get_size_operator |
||
1755 | cmp al,10h |
||
1756 | je avx512_pmov_reg |
||
1757 | cmp al,'[' |
||
1758 | jne invalid_operand |
||
1759 | call get_address |
||
1760 | or [operand_flags],20h |
||
1761 | call avx512_pmov_common |
||
1762 | or al,al |
||
1763 | jz instruction_ready |
||
1764 | cmp al,[mmx_size] |
||
1765 | jne invalid_operand_size |
||
1766 | jmp instruction_ready |
||
1767 | avx512_pmov_common: |
||
1768 | call take_avx512_mask |
||
1769 | xor al,al |
||
1770 | xchg al,[operand_size] |
||
1771 | push eax |
||
1772 | lods byte [esi] |
||
1773 | cmp al,',' |
||
1774 | jne invalid_operand |
||
1775 | call take_avx_register |
||
1776 | mov [postbyte_register],al |
||
1777 | mov al,ah |
||
1778 | mov ah,cl |
||
1779 | bsf ecx,eax |
||
1780 | sub cl,4 |
||
1781 | shl [mmx_size],cl |
||
1782 | mov cl,ah |
||
1783 | pop eax |
||
1784 | ret |
||
1785 | avx512_pmov_reg: |
||
1786 | lods byte [esi] |
||
1787 | call convert_avx_register |
||
1788 | mov bl,al |
||
1789 | call avx512_pmov_common |
||
1790 | cmp al,[mmx_size] |
||
1791 | je nomem_instruction_ready |
||
1792 | jb invalid_operand_size |
||
1793 | cmp al,16 |
||
1794 | jne invalid_operand_size |
||
1795 | jmp nomem_instruction_ready |
||
1796 | |||
1797 | |||
1798 | or [vex_required],2 |
||
1799 | mov cl,10h |
||
1800 | jmp avx_broadcast_instruction |
||
1801 | avx512_broadcast_32x2_instruction: |
||
1802 | mov cl,08h |
||
1803 | jmp avx_broadcast_instruction_evex |
||
1804 | avx512_broadcast_32x4_instruction: |
||
1805 | mov cl,10h |
||
1806 | jmp avx_broadcast_instruction_evex |
||
1807 | avx512_broadcast_32x8_instruction: |
||
1808 | mov cl,20h |
||
1809 | jmp avx_broadcast_instruction_evex |
||
1810 | avx512_broadcast_64x2_instruction: |
||
1811 | mov cl,10h |
||
1812 | jmp avx_broadcast_instruction_w1_evex |
||
1813 | avx512_broadcast_64x4_instruction: |
||
1814 | mov cl,20h |
||
1815 | avx_broadcast_instruction_w1_evex: |
||
1816 | or [rex_prefix],8 |
||
1817 | avx_broadcast_instruction_evex: |
||
1818 | or [vex_required],8 |
||
1819 | jmp avx_broadcast_instruction |
||
1820 | avx_broadcastss_instruction: |
||
1821 | mov cl,4 |
||
1822 | jmp avx_broadcast_instruction |
||
1823 | avx_broadcastsd_instruction: |
||
1824 | or [rex_prefix],80h |
||
1825 | mov cl,8 |
||
1826 | jmp avx_broadcast_instruction |
||
1827 | avx_pbroadcastb_instruction: |
||
1828 | mov cl,1 |
||
1829 | jmp avx_broadcast_pi_instruction |
||
1830 | avx_pbroadcastw_instruction: |
||
1831 | mov cl,2 |
||
1832 | jmp avx_broadcast_pi_instruction |
||
1833 | avx_pbroadcastd_instruction: |
||
1834 | mov cl,4 |
||
1835 | jmp avx_broadcast_pi_instruction |
||
1836 | avx_pbroadcastq_instruction: |
||
1837 | mov cl,8 |
||
1838 | or [rex_prefix],80h |
||
1839 | avx_broadcast_pi_instruction: |
||
1840 | or [operand_flags],40h |
||
1841 | avx_broadcast_instruction: |
||
1842 | mov [opcode_prefix],66h |
||
1843 | mov [supplemental_code],al |
||
1844 | mov al,38h |
||
1845 | mov [mmx_size],cl |
||
1846 | mov [base_code],0Fh |
||
1847 | mov [extended_code],al |
||
1848 | or [vex_required],1 |
||
1849 | call take_avx_register |
||
1850 | cmp ah,[mmx_size] |
||
1851 | je invalid_operand_size |
||
1852 | test [operand_flags],40h |
||
1853 | jnz avx_broadcast_destination_size_ok |
||
1854 | cmp [mmx_size],4 |
||
1855 | je avx_broadcast_destination_size_ok |
||
1856 | cmp [supplemental_code],59h |
||
1857 | je avx_broadcast_destination_size_ok |
||
1858 | cmp ah,16 |
||
1859 | je invalid_operand_size |
||
1860 | avx_broadcast_destination_size_ok: |
||
1861 | xor ah,ah |
||
1862 | xchg ah,[operand_size] |
||
1863 | push eax |
||
1864 | call take_avx512_mask |
||
1865 | lods byte [esi] |
||
1866 | cmp al,',' |
||
1867 | jne invalid_operand |
||
1868 | lods byte [esi] |
||
1869 | call get_size_operator |
||
1870 | cmp al,10h |
||
1871 | je avx_broadcast_reg_reg |
||
1872 | cmp al,'[' |
||
1873 | jne invalid_operand |
||
1874 | call get_address |
||
1875 | pop eax |
||
1876 | xchg ah,[operand_size] |
||
1877 | mov [postbyte_register],al |
||
1878 | mov al,[broadcast_size] |
||
1879 | mov al,[mmx_size] |
||
1880 | cmp al,ah |
||
1881 | je instruction_ready |
||
1882 | or al,al |
||
1883 | jz instruction_ready |
||
1884 | or ah,ah |
||
1885 | jz instruction_ready |
||
1886 | jmp invalid_operand_size |
||
1887 | avx_broadcast_reg_reg: |
||
1888 | lods byte [esi] |
||
1889 | test [operand_flags],40h |
||
1890 | jz avx_broadcast_reg_avx_reg |
||
1891 | cmp al,60h |
||
1892 | jb avx_broadcast_reg_general_reg |
||
1893 | cmp al,80h |
||
1894 | jb avx_broadcast_reg_avx_reg |
||
1895 | cmp al,0C0h |
||
1896 | jb avx_broadcast_reg_general_reg |
||
1897 | avx_broadcast_reg_avx_reg: |
||
1898 | call convert_avx_register |
||
1899 | mov bl,al |
||
1900 | mov al,[mmx_size] |
||
1901 | or al,al |
||
1902 | jz avx_broadcast_reg_avx_reg_size_ok |
||
1903 | cmp ah,16 |
||
1904 | jne invalid_operand_size |
||
1905 | cmp al,ah |
||
1906 | jae invalid_operand |
||
1907 | avx_broadcast_reg_avx_reg_size_ok: |
||
1908 | pop eax |
||
1909 | xchg ah,[operand_size] |
||
1910 | mov [postbyte_register],al |
||
1911 | test [vex_required],2 |
||
1912 | jnz invalid_operand |
||
1913 | jmp nomem_instruction_ready |
||
1914 | avx_broadcast_reg_general_reg: |
||
1915 | call convert_register |
||
1916 | mov bl,al |
||
1917 | mov al,[mmx_size] |
||
1918 | or al,al |
||
1919 | jz avx_broadcast_reg_general_reg_size_ok |
||
1920 | cmp al,ah |
||
1921 | je avx_broadcast_reg_general_reg_size_ok |
||
1922 | ja invalid_operand_size |
||
1923 | cmp ah,4 |
||
1924 | jne invalid_operand_size |
||
1925 | avx_broadcast_reg_general_reg_size_ok: |
||
1926 | cmp al,4 |
||
1927 | jb avx_broadcast_reg_general_reg_ready |
||
1928 | cmp al,8 |
||
1929 | mov al,3 |
||
1930 | jne avx_broadcast_reg_general_reg_ready |
||
1931 | or [rex_prefix],8 |
||
1932 | avx_broadcast_reg_general_reg_ready: |
||
1933 | add al,7Ah-1 |
||
1934 | mov [supplemental_code],al |
||
1935 | or [vex_required],8 |
||
1936 | pop eax |
||
1937 | xchg ah,[operand_size] |
||
1938 | mov [postbyte_register],al |
||
1939 | jmp nomem_instruction_ready |
||
1940 | |||
1941 | |||
1942 | or [rex_prefix],8 |
||
1943 | avx512_extract_32x8_instruction: |
||
1944 | or [vex_required],8 |
||
1945 | mov cl,32 |
||
1946 | jmp avx_extractf_instruction |
||
1947 | avx512_extract_64x2_instruction: |
||
1948 | or [rex_prefix],8 |
||
1949 | avx512_extract_32x4_instruction: |
||
1950 | or [vex_required],8 |
||
1951 | mov cl,16 |
||
1952 | jmp avx_extractf_instruction |
||
1953 | avx_extractf128_instruction: |
||
1954 | or [vex_required],2 |
||
1955 | mov cl,16 |
||
1956 | avx_extractf_instruction: |
||
1957 | mov [mmx_size],cl |
||
1958 | call setup_66_0f_3a |
||
1959 | lods byte [esi] |
||
1960 | call get_size_operator |
||
1961 | cmp al,10h |
||
1962 | je avx_extractf_reg |
||
1963 | cmp al,'[' |
||
1964 | jne invalid_operand |
||
1965 | call get_address |
||
1966 | xor al,al |
||
1967 | xchg al,[operand_size] |
||
1968 | or al,al |
||
1969 | jz avx_extractf_mem_size_ok |
||
1970 | cmp al,[mmx_size] |
||
1971 | jne invalid_operand_size |
||
1972 | avx_extractf_mem_size_ok: |
||
1973 | call take_avx512_mask |
||
1974 | lods byte [esi] |
||
1975 | cmp al,',' |
||
1976 | jne invalid_operand |
||
1977 | call take_avx_register |
||
1978 | cmp ah,[mmx_size] |
||
1979 | jbe invalid_operand_size |
||
1980 | mov [postbyte_register],al |
||
1981 | jmp mmx_imm8 |
||
1982 | avx_extractf_reg: |
||
1983 | lods byte [esi] |
||
1984 | call convert_avx_register |
||
1985 | cmp ah,[mmx_size] |
||
1986 | jne invalid_operand_size |
||
1987 | push eax |
||
1988 | call take_avx512_mask |
||
1989 | mov [operand_size],0 |
||
1990 | lods byte [esi] |
||
1991 | cmp al,',' |
||
1992 | jne invalid_operand |
||
1993 | call take_avx_register |
||
1994 | cmp ah,[mmx_size] |
||
1995 | jbe invalid_operand_size |
||
1996 | mov [postbyte_register],al |
||
1997 | pop ebx |
||
1998 | jmp mmx_nomem_imm8 |
||
1999 | avx512_insert_64x4_instruction: |
||
2000 | or [rex_prefix],8 |
||
2001 | avx512_insert_32x8_instruction: |
||
2002 | or [vex_required],8 |
||
2003 | mov cl,32 |
||
2004 | jmp avx_insertf_instruction |
||
2005 | avx512_insert_64x2_instruction: |
||
2006 | or [rex_prefix],8 |
||
2007 | avx512_insert_32x4_instruction: |
||
2008 | or [vex_required],8 |
||
2009 | mov cl,16 |
||
2010 | jmp avx_insertf_instruction |
||
2011 | avx_insertf128_instruction: |
||
2012 | or [vex_required],2 |
||
2013 | mov cl,16 |
||
2014 | avx_insertf_instruction: |
||
2015 | mov [mmx_size],cl |
||
2016 | mov [broadcast_size],0 |
||
2017 | call setup_66_0f_3a |
||
2018 | call take_avx_register |
||
2019 | cmp ah,[mmx_size] |
||
2020 | jbe invalid_operand |
||
2021 | mov [postbyte_register],al |
||
2022 | call take_avx512_mask |
||
2023 | lods byte [esi] |
||
2024 | cmp al,',' |
||
2025 | jne invalid_operand |
||
2026 | call take_avx_register |
||
2027 | mov [vex_register],al |
||
2028 | mov al,[mmx_size] |
||
2029 | xchg al,[operand_size] |
||
2030 | push eax |
||
2031 | lods byte [esi] |
||
2032 | cmp al,',' |
||
2033 | jne invalid_operand |
||
2034 | lods byte [esi] |
||
2035 | call get_size_operator |
||
2036 | cmp al,10h |
||
2037 | je avx_insertf_reg_reg_reg |
||
2038 | cmp al,'[' |
||
2039 | jne invalid_operand |
||
2040 | call get_address |
||
2041 | pop eax |
||
2042 | mov [operand_size],al |
||
2043 | jmp mmx_imm8 |
||
2044 | avx_insertf_reg_reg_reg: |
||
2045 | lods byte [esi] |
||
2046 | call convert_avx_register |
||
2047 | mov bl,al |
||
2048 | pop eax |
||
2049 | mov [operand_size],al |
||
2050 | jmp mmx_nomem_imm8 |
||
2051 | avx_extract_b_instruction: |
||
2052 | mov cl,1 |
||
2053 | jmp avx_extract_instruction |
||
2054 | avx_extract_w_instruction: |
||
2055 | mov cl,2 |
||
2056 | jmp avx_extract_instruction |
||
2057 | avx_extract_q_instruction: |
||
2058 | or [rex_prefix],8 |
||
2059 | mov cl,8 |
||
2060 | jmp avx_extract_instruction |
||
2061 | avx_extract_d_instruction: |
||
2062 | mov cl,4 |
||
2063 | avx_extract_instruction: |
||
2064 | mov [mmx_size],cl |
||
2065 | call setup_66_0f_3a |
||
2066 | or [vex_required],1 |
||
2067 | lods byte [esi] |
||
2068 | call get_size_operator |
||
2069 | cmp al,10h |
||
2070 | je avx_extractps_reg |
||
2071 | cmp al,'[' |
||
2072 | jne invalid_operand |
||
2073 | call get_address |
||
2074 | mov al,[mmx_size] |
||
2075 | not al |
||
2076 | and [operand_size],al |
||
2077 | jnz invalid_operand_size |
||
2078 | lods byte [esi] |
||
2079 | cmp al,',' |
||
2080 | jne invalid_operand |
||
2081 | lods byte [esi] |
||
2082 | call get_size_operator |
||
2083 | cmp al,10h |
||
2084 | jne invalid_operand |
||
2085 | lods byte [esi] |
||
2086 | call convert_avx_register |
||
2087 | cmp ah,16 |
||
2088 | jne invalid_operand_size |
||
2089 | mov [postbyte_register],al |
||
2090 | jmp mmx_imm8 |
||
2091 | avx_extractps_reg: |
||
2092 | lods byte [esi] |
||
2093 | call convert_register |
||
2094 | mov bl,al |
||
2095 | mov al,[mmx_size] |
||
2096 | cmp ah,al |
||
2097 | jb invalid_operand_size |
||
2098 | cmp ah,4 |
||
2099 | je avx_extractps_reg_size_ok |
||
2100 | cmp ah,8 |
||
2101 | jne invalid_operand_size |
||
2102 | cmp [code_type],64 |
||
2103 | jne invalid_operand |
||
2104 | cmp al,4 |
||
2105 | jae avx_extractps_reg_size_ok |
||
2106 | or [rex_prefix],8 |
||
2107 | avx_extractps_reg_size_ok: |
||
2108 | mov [operand_size],0 |
||
2109 | lods byte [esi] |
||
2110 | cmp al,',' |
||
2111 | jne invalid_operand |
||
2112 | lods byte [esi] |
||
2113 | call get_size_operator |
||
2114 | cmp al,10h |
||
2115 | jne invalid_operand |
||
2116 | lods byte [esi] |
||
2117 | call convert_avx_register |
||
2118 | cmp ah,16 |
||
2119 | jne invalid_operand_size |
||
2120 | mov [postbyte_register],al |
||
2121 | cmp [supplemental_code],15h |
||
2122 | jne mmx_nomem_imm8 |
||
2123 | mov [extended_code],0C5h |
||
2124 | xchg bl,[postbyte_register] |
||
2125 | jmp mmx_nomem_imm8 |
||
2126 | avx_insertps_instruction: |
||
2127 | mov [immediate_size],1 |
||
2128 | or [operand_flags],10h |
||
2129 | mov [opcode_prefix],66h |
||
2130 | mov [supplemental_code],al |
||
2131 | mov al,3Ah |
||
2132 | mov cl,4 |
||
2133 | jmp avx_instruction |
||
2134 | avx_pinsrb_instruction: |
||
2135 | mov cl,1 |
||
2136 | jmp avx_pinsr_instruction_3a |
||
2137 | avx_pinsrw_instruction: |
||
2138 | mov cl,2 |
||
2139 | jmp avx_pinsr_instruction |
||
2140 | avx_pinsrd_instruction: |
||
2141 | mov cl,4 |
||
2142 | jmp avx_pinsr_instruction_3a |
||
2143 | avx_pinsrq_instruction: |
||
2144 | cmp [code_type],64 |
||
2145 | jne illegal_instruction |
||
2146 | mov cl,8 |
||
2147 | or [rex_prefix],8 |
||
2148 | avx_pinsr_instruction_3a: |
||
2149 | mov [supplemental_code],al |
||
2150 | mov al,3Ah |
||
2151 | avx_pinsr_instruction: |
||
2152 | mov [opcode_prefix],66h |
||
2153 | mov [base_code],0Fh |
||
2154 | mov [extended_code],al |
||
2155 | mov [mmx_size],cl |
||
2156 | or [vex_required],1 |
||
2157 | call take_avx_register |
||
2158 | cmp ah,16 |
||
2159 | jne invalid_operand_size |
||
2160 | mov [postbyte_register],al |
||
2161 | lods byte [esi] |
||
2162 | cmp al,',' |
||
2163 | jne invalid_operand |
||
2164 | call take_avx_register |
||
2165 | mov [vex_register],al |
||
2166 | jmp pinsr_xmmreg |
||
2167 | |||
2168 | |||
2169 | or [vex_required],8 |
||
2170 | avx_cvtdq2pd_instruction: |
||
2171 | mov [opcode_prefix],0F3h |
||
2172 | mov cl,4 |
||
2173 | jmp avx_cvt_d_instruction |
||
2174 | avx_cvtps2qq_instruction: |
||
2175 | or [operand_flags],8 |
||
2176 | avx_cvttps2qq_instruction: |
||
2177 | or [operand_flags],4 |
||
2178 | or [vex_required],8 |
||
2179 | mov [opcode_prefix],66h |
||
2180 | mov cl,4 |
||
2181 | jmp avx_cvt_d_instruction |
||
2182 | avx_cvtps2pd_instruction: |
||
2183 | or [operand_flags],4 |
||
2184 | mov cl,4 |
||
2185 | avx_cvt_d_instruction: |
||
2186 | mov [base_code],0Fh |
||
2187 | mov [extended_code],al |
||
2188 | or [vex_required],1 |
||
2189 | mov [broadcast_size],cl |
||
2190 | call take_avx_register |
||
2191 | mov [postbyte_register],al |
||
2192 | call take_avx512_mask |
||
2193 | lods byte [esi] |
||
2194 | cmp al,',' |
||
2195 | jne invalid_operand |
||
2196 | xor ecx,ecx |
||
2197 | xchg cl,[operand_size] |
||
2198 | mov al,cl |
||
2199 | shr al,1 |
||
2200 | mov [mmx_size],al |
||
2201 | lods byte [esi] |
||
2202 | call get_size_operator |
||
2203 | cmp al,'[' |
||
2204 | je avx_cvt_d_reg_mem |
||
2205 | cmp al,10h |
||
2206 | jne invalid_operand |
||
2207 | mov [operand_size],0 |
||
2208 | lods byte [esi] |
||
2209 | call convert_avx_register |
||
2210 | cmp ah,[mmx_size] |
||
2211 | je avx_cvt_d_reg_reg_size_ok |
||
2212 | jb invalid_operand_size |
||
2213 | cmp ah,16 |
||
2214 | jne invalid_operand_size |
||
2215 | avx_cvt_d_reg_reg_size_ok: |
||
2216 | mov bl,al |
||
2217 | mov [operand_size],cl |
||
2218 | call take_avx512_rounding |
||
2219 | jmp nomem_instruction_ready |
||
2220 | avx_cvt_d_reg_mem: |
||
2221 | call take_avx_mem |
||
2222 | jmp instruction_ready |
||
2223 | avx_cvtpd2dq_instruction: |
||
2224 | or [operand_flags],4+8 |
||
2225 | mov [opcode_prefix],0F2h |
||
2226 | jmp avx_cvt_q_instruction |
||
2227 | avx_cvtuqq2ps_instruction: |
||
2228 | mov [opcode_prefix],0F2h |
||
2229 | avx_cvtpd2udq_instruction: |
||
2230 | or [operand_flags],8 |
||
2231 | avx_cvttpd2udq_instruction: |
||
2232 | or [operand_flags],4 |
||
2233 | or [vex_required],8 |
||
2234 | jmp avx_cvt_q_instruction |
||
2235 | avx_cvtpd2ps_instruction: |
||
2236 | or [operand_flags],8 |
||
2237 | avx_cvttpd2dq_instruction: |
||
2238 | or [operand_flags],4 |
||
2239 | mov [opcode_prefix],66h |
||
2240 | avx_cvt_q_instruction: |
||
2241 | mov [broadcast_size],8 |
||
2242 | mov [base_code],0Fh |
||
2243 | mov [extended_code],al |
||
2244 | or [vex_required],1 |
||
2245 | or [rex_prefix],80h |
||
2246 | call take_avx_register |
||
2247 | mov [postbyte_register],al |
||
2248 | push eax |
||
2249 | call take_avx512_mask |
||
2250 | lods byte [esi] |
||
2251 | cmp al,',' |
||
2252 | jne invalid_operand |
||
2253 | xor al,al |
||
2254 | mov [operand_size],al |
||
2255 | mov [mmx_size],al |
||
2256 | call take_avx_rm |
||
2257 | jnc avx_cvt_q_reg_mem |
||
2258 | mov bl,al |
||
2259 | pop eax |
||
2260 | call avx_cvt_q_check_size |
||
2261 | call take_avx512_rounding |
||
2262 | jmp nomem_instruction_ready |
||
2263 | avx_cvt_q_reg_mem: |
||
2264 | pop eax |
||
2265 | call avx_cvt_q_check_size |
||
2266 | jmp instruction_ready |
||
2267 | avx_cvt_q_check_size: |
||
2268 | mov al,[operand_size] |
||
2269 | or al,al |
||
2270 | jz avx_cvt_q_size_not_specified |
||
2271 | cmp al,64 |
||
2272 | ja invalid_operand_size |
||
2273 | shr al,1 |
||
2274 | cmp al,ah |
||
2275 | je avx_cvt_q_size_ok |
||
2276 | ja invalid_operand_size |
||
2277 | cmp ah,16 |
||
2278 | jne invalid_operand_size |
||
2279 | avx_cvt_q_size_ok: |
||
2280 | ret |
||
2281 | avx_cvt_q_size_not_specified: |
||
2282 | cmp ah,64 shr 1 |
||
2283 | jne recoverable_unknown_size |
||
2284 | mov [operand_size],64 |
||
2285 | ret |
||
2286 | avx_cvttps2udq_instruction: |
||
2287 | or [vex_required],8 |
||
2288 | or [operand_flags],2+4 |
||
2289 | mov cx,0400h |
||
2290 | jmp avx_instruction_with_broadcast |
||
2291 | avx_cvttps2dq_instruction: |
||
2292 | mov [opcode_prefix],0F3h |
||
2293 | or [operand_flags],2+4 |
||
2294 | mov cx,0400h |
||
2295 | jmp avx_instruction_with_broadcast |
||
2296 | avx_cvtph2ps_instruction: |
||
2297 | mov [opcode_prefix],66h |
||
2298 | mov [supplemental_code],al |
||
2299 | or [operand_flags],4 |
||
2300 | mov al,38h |
||
2301 | xor cl,cl |
||
2302 | jmp avx_cvt_d_instruction |
||
2303 | avx_cvtps2ph_instruction: |
||
2304 | call setup_66_0f_3a |
||
2305 | or [vex_required],1 |
||
2306 | or [operand_flags],4 |
||
2307 | lods byte [esi] |
||
2308 | call get_size_operator |
||
2309 | cmp al,10h |
||
2310 | je vcvtps2ph_reg |
||
2311 | cmp al,'[' |
||
2312 | jne invalid_operand |
||
2313 | call get_address |
||
2314 | call take_avx512_mask |
||
2315 | lods byte [esi] |
||
2316 | cmp al,',' |
||
2317 | jne invalid_operand |
||
2318 | shl [operand_size],1 |
||
2319 | call take_avx_register |
||
2320 | mov [postbyte_register],al |
||
2321 | shr ah,1 |
||
2322 | mov [mmx_size],ah |
||
2323 | jmp mmx_imm8 |
||
2324 | vcvtps2ph_reg: |
||
2325 | lods byte [esi] |
||
2326 | call convert_avx_register |
||
2327 | mov bl,al |
||
2328 | call take_avx512_mask |
||
2329 | xor cl,cl |
||
2330 | xchg cl,[operand_size] |
||
2331 | shl cl,1 |
||
2332 | lods byte [esi] |
||
2333 | cmp al,',' |
||
2334 | jne invalid_operand |
||
2335 | call take_avx_register |
||
2336 | mov [postbyte_register],al |
||
2337 | or cl,cl |
||
2338 | jz vcvtps2ph_reg_size_ok |
||
2339 | cmp cl,ah |
||
2340 | je vcvtps2ph_reg_size_ok |
||
2341 | jb invalid_operand_size |
||
2342 | cmp ah,16 |
||
2343 | jne invalid_operand_size |
||
2344 | vcvtps2ph_reg_size_ok: |
||
2345 | call take_avx512_rounding |
||
2346 | jmp mmx_nomem_imm8 |
||
2347 | |||
2348 | |||
2349 | or [operand_flags],8 |
||
2350 | avx_cvttsd2usi_instruction: |
||
2351 | or [vex_required],8 |
||
2352 | jmp avx_cvttsd2si_instruction |
||
2353 | avx_cvtsd2si_instruction: |
||
2354 | or [operand_flags],8 |
||
2355 | avx_cvttsd2si_instruction: |
||
2356 | mov ah,0F2h |
||
2357 | mov cl,8 |
||
2358 | jmp avx_cvt_2si_instruction |
||
2359 | avx_cvtss2usi_instruction: |
||
2360 | or [operand_flags],8 |
||
2361 | avx_cvttss2usi_instruction: |
||
2362 | or [vex_required],8 |
||
2363 | jmp avx_cvttss2si_instruction |
||
2364 | avx_cvtss2si_instruction: |
||
2365 | or [operand_flags],8 |
||
2366 | avx_cvttss2si_instruction: |
||
2367 | mov ah,0F3h |
||
2368 | mov cl,4 |
||
2369 | avx_cvt_2si_instruction: |
||
2370 | or [operand_flags],2+4 |
||
2371 | mov [mmx_size],cl |
||
2372 | mov [broadcast_size],0 |
||
2373 | mov [opcode_prefix],ah |
||
2374 | mov [base_code],0Fh |
||
2375 | mov [extended_code],al |
||
2376 | or [vex_required],1 |
||
2377 | lods byte [esi] |
||
2378 | call get_size_operator |
||
2379 | cmp al,10h |
||
2380 | jne invalid_operand |
||
2381 | lods byte [esi] |
||
2382 | call convert_register |
||
2383 | mov [postbyte_register],al |
||
2384 | mov [operand_size],0 |
||
2385 | cmp ah,4 |
||
2386 | je avx_cvt_2si_reg |
||
2387 | cmp ah,8 |
||
2388 | jne invalid_operand_size |
||
2389 | call operand_64bit |
||
2390 | avx_cvt_2si_reg: |
||
2391 | lods byte [esi] |
||
2392 | cmp al,',' |
||
2393 | jne invalid_operand |
||
2394 | call take_avx_rm |
||
2395 | jnc instruction_ready |
||
2396 | mov bl,al |
||
2397 | call take_avx512_rounding |
||
2398 | jmp nomem_instruction_ready |
||
2399 | avx_cvtusi2sd_instruction: |
||
2400 | or [vex_required],8 |
||
2401 | avx_cvtsi2sd_instruction: |
||
2402 | mov ah,0F2h |
||
2403 | mov cl,8 |
||
2404 | jmp avx_cvtsi_instruction |
||
2405 | avx_cvtusi2ss_instruction: |
||
2406 | or [vex_required],8 |
||
2407 | avx_cvtsi2ss_instruction: |
||
2408 | mov ah,0F3h |
||
2409 | mov cl,4 |
||
2410 | avx_cvtsi_instruction: |
||
2411 | or [operand_flags],2+4+8 |
||
2412 | mov [mmx_size],cl |
||
2413 | mov [opcode_prefix],ah |
||
2414 | mov [base_code],0Fh |
||
2415 | mov [extended_code],al |
||
2416 | or [vex_required],1 |
||
2417 | call take_avx_register |
||
2418 | cmp ah,16 |
||
2419 | jne invalid_operand_size |
||
2420 | mov [postbyte_register],al |
||
2421 | lods byte [esi] |
||
2422 | cmp al,',' |
||
2423 | jne invalid_operand |
||
2424 | call take_avx_register |
||
2425 | mov [vex_register],al |
||
2426 | lods byte [esi] |
||
2427 | cmp al,',' |
||
2428 | jne invalid_operand |
||
2429 | mov [operand_size],0 |
||
2430 | lods byte [esi] |
||
2431 | call get_size_operator |
||
2432 | cmp al,'[' |
||
2433 | je avx_cvtsi_reg_reg_mem |
||
2434 | cmp al,10h |
||
2435 | jne invalid_operand |
||
2436 | lods byte [esi] |
||
2437 | call convert_register |
||
2438 | mov bl,al |
||
2439 | cmp ah,4 |
||
2440 | je avx_cvtsi_reg_reg_reg32 |
||
2441 | cmp ah,8 |
||
2442 | jne invalid_operand_size |
||
2443 | call operand_64bit |
||
2444 | avx_cvtsi_rounding: |
||
2445 | call take_avx512_rounding |
||
2446 | jmp nomem_instruction_ready |
||
2447 | avx_cvtsi_reg_reg_reg32: |
||
2448 | cmp [mmx_size],8 |
||
2449 | jne avx_cvtsi_rounding |
||
2450 | jmp nomem_instruction_ready |
||
2451 | avx_cvtsi_reg_reg_mem: |
||
2452 | call get_address |
||
2453 | mov al,[operand_size] |
||
2454 | mov [mmx_size],al |
||
2455 | or al,al |
||
2456 | jz single_mem_nosize |
||
2457 | cmp al,4 |
||
2458 | je instruction_ready |
||
2459 | cmp al,8 |
||
2460 | jne invalid_operand_size |
||
2461 | call operand_64bit |
||
2462 | jmp instruction_ready |
||
2463 | |||
2464 | |||
2465 | or [rex_prefix],8 |
||
2466 | avx_maskmov_instruction: |
||
2467 | call setup_66_0f_38 |
||
2468 | mov [mmx_size],0 |
||
2469 | or [vex_required],2 |
||
2470 | lods byte [esi] |
||
2471 | call get_size_operator |
||
2472 | cmp al,10h |
||
2473 | jne avx_maskmov_mem |
||
2474 | lods byte [esi] |
||
2475 | call convert_avx_register |
||
2476 | mov [postbyte_register],al |
||
2477 | lods byte [esi] |
||
2478 | cmp al,',' |
||
2479 | jne invalid_operand |
||
2480 | call take_avx_register |
||
2481 | mov [vex_register],al |
||
2482 | lods byte [esi] |
||
2483 | cmp al,',' |
||
2484 | jne invalid_operand |
||
2485 | lods byte [esi] |
||
2486 | call get_size_operator |
||
2487 | cmp al,'[' |
||
2488 | jne invalid_operand |
||
2489 | call get_address |
||
2490 | jmp instruction_ready |
||
2491 | avx_maskmov_mem: |
||
2492 | cmp al,'[' |
||
2493 | jne invalid_operand |
||
2494 | call get_address |
||
2495 | lods byte [esi] |
||
2496 | cmp al,',' |
||
2497 | jne invalid_operand |
||
2498 | call take_avx_register |
||
2499 | mov [vex_register],al |
||
2500 | lods byte [esi] |
||
2501 | cmp al,',' |
||
2502 | jne invalid_operand |
||
2503 | call take_avx_register |
||
2504 | mov [postbyte_register],al |
||
2505 | add [supplemental_code],2 |
||
2506 | jmp instruction_ready |
||
2507 | avx_movmskpd_instruction: |
||
2508 | mov [opcode_prefix],66h |
||
2509 | avx_movmskps_instruction: |
||
2510 | mov [base_code],0Fh |
||
2511 | mov [extended_code],50h |
||
2512 | or [vex_required],2 |
||
2513 | lods byte [esi] |
||
2514 | call get_size_operator |
||
2515 | cmp al,10h |
||
2516 | jne invalid_operand |
||
2517 | lods byte [esi] |
||
2518 | call convert_register |
||
2519 | mov [postbyte_register],al |
||
2520 | cmp ah,4 |
||
2521 | je avx_movmskps_reg_ok |
||
2522 | cmp ah,8 |
||
2523 | jne invalid_operand_size |
||
2524 | cmp [code_type],64 |
||
2525 | jne invalid_operand |
||
2526 | avx_movmskps_reg_ok: |
||
2527 | mov [operand_size],0 |
||
2528 | lods byte [esi] |
||
2529 | cmp al,',' |
||
2530 | jne invalid_operand |
||
2531 | call take_avx_register |
||
2532 | mov bl,al |
||
2533 | jmp nomem_instruction_ready |
||
2534 | avx_maskmovdqu_instruction: |
||
2535 | or [vex_required],2 |
||
2536 | jmp maskmovdqu_instruction |
||
2537 | avx_pmovmskb_instruction: |
||
2538 | or [vex_required],2 |
||
2539 | mov [opcode_prefix],66h |
||
2540 | mov [base_code],0Fh |
||
2541 | mov [extended_code],al |
||
2542 | lods byte [esi] |
||
2543 | call get_size_operator |
||
2544 | cmp al,10h |
||
2545 | jne invalid_operand |
||
2546 | lods byte [esi] |
||
2547 | call convert_register |
||
2548 | cmp ah,4 |
||
2549 | je avx_pmovmskb_reg_size_ok |
||
2550 | cmp [code_type],64 |
||
2551 | jne invalid_operand_size |
||
2552 | cmp ah,8 |
||
2553 | jnz invalid_operand_size |
||
2554 | avx_pmovmskb_reg_size_ok: |
||
2555 | mov [postbyte_register],al |
||
2556 | mov [operand_size],0 |
||
2557 | lods byte [esi] |
||
2558 | cmp al,',' |
||
2559 | jne invalid_operand |
||
2560 | call take_avx_register |
||
2561 | mov bl,al |
||
2562 | jmp nomem_instruction_ready |
||
2563 | |||
2564 | |||
2565 | or [rex_prefix],8 |
||
2566 | gather_ps_instruction: |
||
2567 | call setup_66_0f_38 |
||
2568 | or [vex_required],4 |
||
2569 | or [operand_flags],20h |
||
2570 | call take_avx_register |
||
2571 | mov [postbyte_register],al |
||
2572 | call take_avx512_mask |
||
2573 | lods byte [esi] |
||
2574 | cmp al,',' |
||
2575 | jne invalid_operand |
||
2576 | xor cl,cl |
||
2577 | xchg cl,[operand_size] |
||
2578 | push ecx |
||
2579 | lods byte [esi] |
||
2580 | call get_size_operator |
||
2581 | cmp al,'[' |
||
2582 | jne invalid_argument |
||
2583 | call get_address |
||
2584 | pop eax |
||
2585 | xchg al,[operand_size] |
||
2586 | gather_mem_size_check: |
||
2587 | mov ah,4 |
||
2588 | test [rex_prefix],8 |
||
2589 | jz gather_elements_size_ok |
||
2590 | add ah,ah |
||
2591 | gather_elements_size_ok: |
||
2592 | mov [mmx_size],ah |
||
2593 | test al,al |
||
2594 | jz gather_mem_size_ok |
||
2595 | cmp al,ah |
||
2596 | jne invalid_operand_size |
||
2597 | gather_mem_size_ok: |
||
2598 | cmp byte [esi],',' |
||
2599 | je gather_reg_mem_reg |
||
2600 | test [vex_required],20h |
||
2601 | jz invalid_operand |
||
2602 | mov ah,[operand_size] |
||
2603 | mov al,80h |
||
2604 | jmp gather_arguments_ok |
||
2605 | gather_reg_mem_reg: |
||
2606 | or [vex_required],2 |
||
2607 | inc esi |
||
2608 | call take_avx_register |
||
2609 | gather_arguments_ok: |
||
2610 | mov [vex_register],al |
||
2611 | cmp al,[postbyte_register] |
||
2612 | je disallowed_combination_of_registers |
||
2613 | mov al,bl |
||
2614 | and al,11111b |
||
2615 | cmp al,[postbyte_register] |
||
2616 | je disallowed_combination_of_registers |
||
2617 | cmp al,[vex_register] |
||
2618 | je disallowed_combination_of_registers |
||
2619 | mov al,bl |
||
2620 | shr al,5 |
||
2621 | cmp al,0Ch shr 1 |
||
2622 | je gather_vr128 |
||
2623 | mov ah,32 |
||
2624 | cmp al,6 shr 1 |
||
2625 | jne gather_regular |
||
2626 | add ah,ah |
||
2627 | gather_regular: |
||
2628 | mov al,[rex_prefix] |
||
2629 | shr al,3 |
||
2630 | xor al,[supplemental_code] |
||
2631 | test al,1 |
||
2632 | jz gather_uniform |
||
2633 | test [supplemental_code],1 |
||
2634 | jz gather_double |
||
2635 | mov al,ah |
||
2636 | xchg al,[operand_size] |
||
2637 | add al,al |
||
2638 | cmp al,ah |
||
2639 | jne invalid_operand_size |
||
2640 | jmp instruction_ready |
||
2641 | gather_double: |
||
2642 | add ah,ah |
||
2643 | gather_uniform: |
||
2644 | cmp ah,[operand_size] |
||
2645 | jne invalid_operand_size |
||
2646 | jmp instruction_ready |
||
2647 | gather_vr128: |
||
2648 | cmp ah,16 |
||
2649 | je instruction_ready |
||
2650 | cmp ah,32 |
||
2651 | jne invalid_operand_size |
||
2652 | test [supplemental_code],1 |
||
2653 | jnz invalid_operand_size |
||
2654 | test [rex_prefix],8 |
||
2655 | jz invalid_operand_size |
||
2656 | jmp instruction_ready |
||
2657 | scatter_pd_instruction: |
||
2658 | or [rex_prefix],8 |
||
2659 | scatter_ps_instruction: |
||
2660 | call setup_66_0f_38 |
||
2661 | or [vex_required],4+8 |
||
2662 | or [operand_flags],20h |
||
2663 | lods byte [esi] |
||
2664 | call get_size_operator |
||
2665 | cmp al,'[' |
||
2666 | jne invalid_argument |
||
2667 | call get_address |
||
2668 | call take_avx512_mask |
||
2669 | lods byte [esi] |
||
2670 | cmp al,',' |
||
2671 | jne invalid_operand |
||
2672 | xor al,al |
||
2673 | xchg al,[operand_size] |
||
2674 | push eax |
||
2675 | call take_avx_register |
||
2676 | mov [postbyte_register],al |
||
2677 | pop eax |
||
2678 | jmp gather_mem_size_check |
||
2679 | gatherpf_qpd_instruction: |
||
2680 | mov ah,0C7h |
||
2681 | jmp gatherpf_pd_instruction |
||
2682 | gatherpf_dpd_instruction: |
||
2683 | mov ah,0C6h |
||
2684 | gatherpf_pd_instruction: |
||
2685 | or [rex_prefix],8 |
||
2686 | mov cl,8 |
||
2687 | jmp gatherpf_instruction |
||
2688 | gatherpf_qps_instruction: |
||
2689 | mov ah,0C7h |
||
2690 | jmp gatherpf_ps_instruction |
||
2691 | gatherpf_dps_instruction: |
||
2692 | mov ah,0C6h |
||
2693 | gatherpf_ps_instruction: |
||
2694 | mov cl,4 |
||
2695 | gatherpf_instruction: |
||
2696 | mov [mmx_size],cl |
||
2697 | mov [postbyte_register],al |
||
2698 | mov al,ah |
||
2699 | call setup_66_0f_38 |
||
2700 | or [vex_required],4+8 |
||
2701 | or [operand_flags],20h |
||
2702 | lods byte [esi] |
||
2703 | call get_size_operator |
||
2704 | cmp al,'[' |
||
2705 | jne invalid_argument |
||
2706 | call get_address |
||
2707 | call take_avx512_mask |
||
2708 | mov ah,[mmx_size] |
||
2709 | mov al,[operand_size] |
||
2710 | or al,al |
||
2711 | jz gatherpf_mem_size_ok |
||
2712 | cmp al,ah |
||
2713 | jne invalid_operand_size |
||
2714 | gatherpf_mem_size_ok: |
||
2715 | mov [operand_size],64 |
||
2716 | mov al,6 shr 1 |
||
2717 | cmp ah,4 |
||
2718 | je gatherpf_check_vsib |
||
2719 | cmp [supplemental_code],0C6h |
||
2720 | jne gatherpf_check_vsib |
||
2721 | mov al,0Eh shr 1 |
||
2722 | gatherpf_check_vsib: |
||
2723 | mov ah,bl |
||
2724 | shr ah,5 |
||
2725 | cmp al,ah |
||
2726 | jne invalid_operand |
||
2727 | jmp instruction_ready |
||
2728 | |||
2729 | |||
2730 | mov [base_code],0Fh |
||
2731 | mov [extended_code],38h |
||
2732 | mov [supplemental_code],0F3h |
||
2733 | mov [postbyte_register],al |
||
2734 | bmi_reg: |
||
2735 | or [vex_required],2 |
||
2736 | lods byte [esi] |
||
2737 | call get_size_operator |
||
2738 | cmp al,10h |
||
2739 | jne invalid_operand |
||
2740 | lods byte [esi] |
||
2741 | call convert_register |
||
2742 | mov [vex_register],al |
||
2743 | lods byte [esi] |
||
2744 | cmp al,',' |
||
2745 | jne invalid_operand |
||
2746 | lods byte [esi] |
||
2747 | call get_size_operator |
||
2748 | cmp al,10h |
||
2749 | je bmi_reg_reg |
||
2750 | cmp al,'[' |
||
2751 | jne invalid_argument |
||
2752 | call get_address |
||
2753 | call operand_32or64 |
||
2754 | jmp instruction_ready |
||
2755 | bmi_reg_reg: |
||
2756 | lods byte [esi] |
||
2757 | call convert_register |
||
2758 | mov bl,al |
||
2759 | call operand_32or64 |
||
2760 | jmp nomem_instruction_ready |
||
2761 | operand_32or64: |
||
2762 | mov al,[operand_size] |
||
2763 | cmp al,4 |
||
2764 | je operand_32or64_ok |
||
2765 | cmp al,8 |
||
2766 | jne invalid_operand_size |
||
2767 | cmp [code_type],64 |
||
2768 | jne invalid_operand |
||
2769 | or [rex_prefix],8 |
||
2770 | operand_32or64_ok: |
||
2771 | ret |
||
2772 | pdep_instruction: |
||
2773 | mov [opcode_prefix],0F2h |
||
2774 | jmp andn_instruction |
||
2775 | pext_instruction: |
||
2776 | mov [opcode_prefix],0F3h |
||
2777 | andn_instruction: |
||
2778 | mov [base_code],0Fh |
||
2779 | mov [extended_code],38h |
||
2780 | mov [supplemental_code],al |
||
2781 | or [vex_required],2 |
||
2782 | lods byte [esi] |
||
2783 | call get_size_operator |
||
2784 | cmp al,10h |
||
2785 | jne invalid_operand |
||
2786 | lods byte [esi] |
||
2787 | call convert_register |
||
2788 | mov [postbyte_register],al |
||
2789 | lods byte [esi] |
||
2790 | cmp al,',' |
||
2791 | jne invalid_operand |
||
2792 | jmp bmi_reg |
||
2793 | sarx_instruction: |
||
2794 | mov [opcode_prefix],0F3h |
||
2795 | jmp bzhi_instruction |
||
2796 | shrx_instruction: |
||
2797 | mov [opcode_prefix],0F2h |
||
2798 | jmp bzhi_instruction |
||
2799 | shlx_instruction: |
||
2800 | mov [opcode_prefix],66h |
||
2801 | bzhi_instruction: |
||
2802 | mov [base_code],0Fh |
||
2803 | mov [extended_code],38h |
||
2804 | mov [supplemental_code],al |
||
2805 | or [vex_required],2 |
||
2806 | call get_reg_mem |
||
2807 | jc bzhi_reg_reg |
||
2808 | call get_vex_source_register |
||
2809 | jc invalid_operand |
||
2810 | call operand_32or64 |
||
2811 | jmp instruction_ready |
||
2812 | bzhi_reg_reg: |
||
2813 | call get_vex_source_register |
||
2814 | jc invalid_operand |
||
2815 | call operand_32or64 |
||
2816 | jmp nomem_instruction_ready |
||
2817 | get_vex_source_register: |
||
2818 | lods byte [esi] |
||
2819 | cmp al,',' |
||
2820 | jne invalid_operand |
||
2821 | lods byte [esi] |
||
2822 | call get_size_operator |
||
2823 | cmp al,10h |
||
2824 | jne no_vex_source_register |
||
2825 | lods byte [esi] |
||
2826 | call convert_register |
||
2827 | mov [vex_register],al |
||
2828 | clc |
||
2829 | ret |
||
2830 | no_vex_source_register: |
||
2831 | stc |
||
2832 | ret |
||
2833 | bextr_instruction: |
||
2834 | mov [base_code],0Fh |
||
2835 | mov [extended_code],38h |
||
2836 | mov [supplemental_code],al |
||
2837 | or [vex_required],2 |
||
2838 | call get_reg_mem |
||
2839 | jc bextr_reg_reg |
||
2840 | call get_vex_source_register |
||
2841 | jc bextr_reg_mem_imm32 |
||
2842 | call operand_32or64 |
||
2843 | jmp instruction_ready |
||
2844 | bextr_reg_reg: |
||
2845 | call get_vex_source_register |
||
2846 | jc bextr_reg_reg_imm32 |
||
2847 | call operand_32or64 |
||
2848 | jmp nomem_instruction_ready |
||
2849 | setup_bextr_imm_opcode: |
||
2850 | mov [xop_opcode_map],0Ah |
||
2851 | mov [base_code],10h |
||
2852 | call operand_32or64 |
||
2853 | ret |
||
2854 | bextr_reg_mem_imm32: |
||
2855 | call get_imm32 |
||
2856 | call setup_bextr_imm_opcode |
||
2857 | jmp store_instruction_with_imm32 |
||
2858 | bextr_reg_reg_imm32: |
||
2859 | call get_imm32 |
||
2860 | call setup_bextr_imm_opcode |
||
2861 | store_nomem_instruction_with_imm32: |
||
2862 | call store_nomem_instruction |
||
2863 | mov eax,dword [value] |
||
2864 | call mark_relocation |
||
2865 | stos dword [edi] |
||
2866 | jmp instruction_assembled |
||
2867 | get_imm32: |
||
2868 | cmp al,'(' |
||
2869 | jne invalid_operand |
||
2870 | push edx ebx ecx |
||
2871 | call get_dword_value |
||
2872 | mov dword [value],eax |
||
2873 | pop ecx ebx edx |
||
2874 | ret |
||
2875 | rorx_instruction: |
||
2876 | mov [opcode_prefix],0F2h |
||
2877 | mov [base_code],0Fh |
||
2878 | mov [extended_code],3Ah |
||
2879 | mov [supplemental_code],al |
||
2880 | or [vex_required],2 |
||
2881 | call get_reg_mem |
||
2882 | jc rorx_reg_reg |
||
2883 | call operand_32or64 |
||
2884 | jmp mmx_imm8 |
||
2885 | rorx_reg_reg: |
||
2886 | call operand_32or64 |
||
2887 | jmp mmx_nomem_imm8 |
||
2888 | |||
2889 | |||
2890 | mov [xop_opcode_map],9 |
||
2891 | mov ah,al |
||
2892 | shr ah,4 |
||
2893 | and al,111b |
||
2894 | mov [base_code],ah |
||
2895 | mov [postbyte_register],al |
||
2896 | jmp bmi_reg |
||
2897 | |||
2898 | |||
2899 | or [vex_required],2 |
||
2900 | mov [xop_opcode_map],9 |
||
2901 | mov [base_code],12h |
||
2902 | mov [postbyte_register],al |
||
2903 | lods byte [esi] |
||
2904 | call get_size_operator |
||
2905 | cmp al,10h |
||
2906 | jne invalid_operand |
||
2907 | lods byte [esi] |
||
2908 | call convert_register |
||
2909 | mov bl,al |
||
2910 | call operand_32or64 |
||
2911 | jmp nomem_instruction_ready |
||
2912 | lwpins_instruction: |
||
2913 | or [vex_required],2 |
||
2914 | mov [xop_opcode_map],0Ah |
||
2915 | mov [base_code],12h |
||
2916 | mov [vex_register],al |
||
2917 | lods byte [esi] |
||
2918 | call get_size_operator |
||
2919 | cmp al,10h |
||
2920 | jne invalid_operand |
||
2921 | lods byte [esi] |
||
2922 | call convert_register |
||
2923 | mov [postbyte_register],al |
||
2924 | lods byte [esi] |
||
2925 | cmp al,',' |
||
2926 | jne invalid_operand |
||
2927 | xor cl,cl |
||
2928 | xchg cl,[operand_size] |
||
2929 | lods byte [esi] |
||
2930 | call get_size_operator |
||
2931 | cmp al,10h |
||
2932 | je lwpins_reg_reg |
||
2933 | cmp al,'[' |
||
2934 | jne invalid_argument |
||
2935 | push ecx |
||
2936 | call get_address |
||
2937 | pop eax |
||
2938 | xchg al,[operand_size] |
||
2939 | test al,al |
||
2940 | jz lwpins_reg_mem_size_ok |
||
2941 | cmp al,4 |
||
2942 | jne invalid_operand_size |
||
2943 | lwpins_reg_mem_size_ok: |
||
2944 | call prepare_lwpins |
||
2945 | jmp store_instruction_with_imm32 |
||
2946 | lwpins_reg_reg: |
||
2947 | lods byte [esi] |
||
2948 | call convert_register |
||
2949 | cmp ah,4 |
||
2950 | jne invalid_operand_size |
||
2951 | mov [operand_size],cl |
||
2952 | mov bl,al |
||
2953 | call prepare_lwpins |
||
2954 | jmp store_nomem_instruction_with_imm32 |
||
2955 | prepare_lwpins: |
||
2956 | lods byte [esi] |
||
2957 | cmp al,',' |
||
2958 | jne invalid_operand |
||
2959 | lods byte [esi] |
||
2960 | call get_imm32 |
||
2961 | call operand_32or64 |
||
2962 | mov al,[vex_register] |
||
2963 | xchg al,[postbyte_register] |
||
2964 | mov [vex_register],al |
||
2965 | ret |
||
2966 | |||
2967 | |||
2968 | or [operand_flags],2 |
||
2969 | mov [mmx_size],8 |
||
2970 | jmp xop_instruction_9 |
||
2971 | xop_single_source_ss_instruction: |
||
2972 | or [operand_flags],2 |
||
2973 | mov [mmx_size],4 |
||
2974 | jmp xop_instruction_9 |
||
2975 | xop_single_source_instruction: |
||
2976 | or [operand_flags],2 |
||
2977 | mov [mmx_size],0 |
||
2978 | xop_instruction_9: |
||
2979 | mov [base_code],al |
||
2980 | mov [xop_opcode_map],9 |
||
2981 | jmp avx_xop_common |
||
2982 | xop_single_source_128bit_instruction: |
||
2983 | or [operand_flags],2 |
||
2984 | mov [mmx_size],16 |
||
2985 | jmp xop_instruction_9 |
||
2986 | xop_triple_source_128bit_instruction: |
||
2987 | mov [immediate_size],-1 |
||
2988 | mov byte [value],0 |
||
2989 | mov [mmx_size],16 |
||
2990 | jmp xop_instruction_8 |
||
2991 | xop_128bit_instruction: |
||
2992 | mov [immediate_size],-2 |
||
2993 | mov byte [value],0 |
||
2994 | mov [mmx_size],16 |
||
2995 | xop_instruction_8: |
||
2996 | mov [base_code],al |
||
2997 | mov [xop_opcode_map],8 |
||
2998 | jmp avx_xop_common |
||
2999 | xop_pcom_b_instruction: |
||
3000 | mov ah,0CCh |
||
3001 | jmp xop_pcom_instruction |
||
3002 | xop_pcom_d_instruction: |
||
3003 | mov ah,0CEh |
||
3004 | jmp xop_pcom_instruction |
||
3005 | xop_pcom_q_instruction: |
||
3006 | mov ah,0CFh |
||
3007 | jmp xop_pcom_instruction |
||
3008 | xop_pcom_w_instruction: |
||
3009 | mov ah,0CDh |
||
3010 | jmp xop_pcom_instruction |
||
3011 | xop_pcom_ub_instruction: |
||
3012 | mov ah,0ECh |
||
3013 | jmp xop_pcom_instruction |
||
3014 | xop_pcom_ud_instruction: |
||
3015 | mov ah,0EEh |
||
3016 | jmp xop_pcom_instruction |
||
3017 | xop_pcom_uq_instruction: |
||
3018 | mov ah,0EFh |
||
3019 | jmp xop_pcom_instruction |
||
3020 | xop_pcom_uw_instruction: |
||
3021 | mov ah,0EDh |
||
3022 | xop_pcom_instruction: |
||
3023 | mov byte [value],al |
||
3024 | mov [immediate_size],-4 |
||
3025 | mov [mmx_size],16 |
||
3026 | mov [base_code],ah |
||
3027 | mov [xop_opcode_map],8 |
||
3028 | jmp avx_xop_common |
||
3029 | vpcmov_instruction: |
||
3030 | or [vex_required],2 |
||
3031 | mov [immediate_size],-2 |
||
3032 | mov byte [value],0 |
||
3033 | mov [mmx_size],0 |
||
3034 | mov [base_code],al |
||
3035 | mov [xop_opcode_map],8 |
||
3036 | jmp avx_xop_common |
||
3037 | xop_shift_instruction: |
||
3038 | mov [base_code],al |
||
3039 | or [vex_required],2 |
||
3040 | mov [xop_opcode_map],9 |
||
3041 | call take_avx_register |
||
3042 | cmp ah,16 |
||
3043 | jne invalid_operand |
||
3044 | mov [postbyte_register],al |
||
3045 | lods byte [esi] |
||
3046 | cmp al,',' |
||
3047 | jne invalid_operand |
||
3048 | lods byte [esi] |
||
3049 | call get_size_operator |
||
3050 | cmp al,'[' |
||
3051 | je xop_shift_reg_mem |
||
3052 | cmp al,10h |
||
3053 | jne invalid_operand |
||
3054 | lods byte [esi] |
||
3055 | call convert_xmm_register |
||
3056 | mov [vex_register],al |
||
3057 | lods byte [esi] |
||
3058 | cmp al,',' |
||
3059 | jne invalid_operand |
||
3060 | push esi |
||
3061 | xor cl,cl |
||
3062 | xchg cl,[operand_size] |
||
3063 | lods byte [esi] |
||
3064 | call get_size_operator |
||
3065 | pop esi |
||
3066 | xchg cl,[operand_size] |
||
3067 | cmp al,'[' |
||
3068 | je xop_shift_reg_reg_mem |
||
3069 | cmp al,10h |
||
3070 | jne xop_shift_reg_reg_imm |
||
3071 | call take_avx_register |
||
3072 | mov bl,al |
||
3073 | xchg bl,[vex_register] |
||
3074 | jmp nomem_instruction_ready |
||
3075 | xop_shift_reg_reg_mem: |
||
3076 | or [rex_prefix],8 |
||
3077 | lods byte [esi] |
||
3078 | call get_size_operator |
||
3079 | call get_address |
||
3080 | jmp instruction_ready |
||
3081 | xop_shift_reg_reg_imm: |
||
3082 | xor bl,bl |
||
3083 | xchg bl,[vex_register] |
||
3084 | cmp [base_code],94h |
||
3085 | jae invalid_operand |
||
3086 | add [base_code],30h |
||
3087 | mov [xop_opcode_map],8 |
||
3088 | dec esi |
||
3089 | jmp mmx_nomem_imm8 |
||
3090 | xop_shift_reg_mem: |
||
3091 | call get_address |
||
3092 | lods byte [esi] |
||
3093 | cmp al,',' |
||
3094 | jne invalid_operand |
||
3095 | push esi |
||
3096 | xor cl,cl |
||
3097 | xchg cl,[operand_size] |
||
3098 | lods byte [esi] |
||
3099 | call get_size_operator |
||
3100 | pop esi |
||
3101 | xchg cl,[operand_size] |
||
3102 | cmp al,10h |
||
3103 | jne xop_shift_reg_mem_imm |
||
3104 | call take_avx_register |
||
3105 | mov [vex_register],al |
||
3106 | jmp instruction_ready |
||
3107 | xop_shift_reg_mem_imm: |
||
3108 | cmp [base_code],94h |
||
3109 | jae invalid_operand |
||
3110 | add [base_code],30h |
||
3111 | mov [xop_opcode_map],8 |
||
3112 | dec esi |
||
3113 | jmp mmx_imm8 |
||
3114 | |||
3115 | |||
3116 | mov [opcode_prefix],0F2h |
||
3117 | mov [base_code],0Fh |
||
3118 | mov [extended_code],38h |
||
3119 | mov [supplemental_code],al |
||
3120 | mov [mmx_size],16 |
||
3121 | mov [broadcast_size],0 |
||
3122 | or [vex_required],8 |
||
3123 | call take_avx_register |
||
3124 | mov [postbyte_register],al |
||
3125 | call take_avx512_mask |
||
3126 | lods byte [esi] |
||
3127 | cmp al,',' |
||
3128 | jne invalid_operand |
||
3129 | call take_avx_register |
||
3130 | mov [vex_register],al |
||
3131 | cmp byte [esi],'+' |
||
3132 | jne reg4_ok |
||
3133 | inc esi |
||
3134 | cmp dword [esi],29030128h |
||
3135 | jne invalid_operand |
||
3136 | lods dword [esi] |
||
3137 | reg4_ok: |
||
3138 | cmp [operand_size],64 |
||
3139 | jne invalid_operand_size |
||
3140 | mov [operand_size],0 |
||
3141 | lods byte [esi] |
||
3142 | cmp al,',' |
||
3143 | jne invalid_operand |
||
3144 | call take_avx_rm |
||
3145 | jc invalid_operand |
||
3146 | mov [operand_size],64 |
||
3147 | jmp instruction_ready |
||
3148 | |||
3149 | |||
3150 | mov [evex_mode],al |
||
3151 | jmp instruction_assembled |
||
3152 | |||
3153 | |||
3154 | lods byte [esi] |
||
3155 | call get_size_operator |
||
3156 | cmp al,10h |
||
3157 | jne invalid_operand |
||
3158 | lods byte [esi] |
||
3159 | convert_avx_register: |
||
3160 | mov ah,al |
||
3161 | and al,1Fh |
||
3162 | and ah,0E0h |
||
3163 | sub ah,60h |
||
3164 | jb invalid_operand |
||
3165 | jz avx512_register_size |
||
3166 | sub ah,60h |
||
3167 | jb invalid_operand |
||
3168 | jnz avx_register_size_ok |
||
3169 | mov ah,16 |
||
3170 | jmp avx_register_size_ok |
||
3171 | avx512_register_size: |
||
3172 | mov ah,64 |
||
3173 | avx_register_size_ok: |
||
3174 | cmp al,8 |
||
3175 | jb match_register_size |
||
3176 | cmp [code_type],64 |
||
3177 | jne invalid_operand |
||
3178 | jmp match_register_size |
||
3179 | store_vex_instruction_code: |
||
3180 | test [rex_prefix],10h |
||
3181 | jnz invalid_operand |
||
3182 | test [vex_required],0F8h |
||
3183 | jnz store_evex_instruction_code |
||
3184 | test [vex_register],10000b |
||
3185 | jnz store_evex_instruction_code |
||
3186 | cmp [operand_size],64 |
||
3187 | je store_evex_instruction_code |
||
3188 | mov al,[base_code] |
||
3189 | cmp al,0Fh |
||
3190 | jne store_xop_instruction_code |
||
3191 | test [vex_required],2 |
||
3192 | jnz prepare_vex |
||
3193 | cmp [evex_mode],0 |
||
3194 | je prepare_vex |
||
3195 | cmp [displacement_compression],1 |
||
3196 | jne prepare_vex |
||
3197 | cmp edx,80h |
||
3198 | jb prepare_vex |
||
3199 | cmp edx,-80h |
||
3200 | jae prepare_vex |
||
3201 | mov al,bl |
||
3202 | or al,bh |
||
3203 | shr al,4 |
||
3204 | cmp al,2 |
||
3205 | je prepare_vex |
||
3206 | call compress_displacement |
||
3207 | cmp [displacement_compression],2 |
||
3208 | ja prepare_evex |
||
3209 | jb prepare_vex |
||
3210 | dec [displacement_compression] |
||
3211 | mov edx,[uncompressed_displacement] |
||
3212 | prepare_vex: |
||
3213 | mov ah,[extended_code] |
||
3214 | cmp ah,38h |
||
3215 | je store_vex_0f38_instruction_code |
||
3216 | cmp ah,3Ah |
||
3217 | je store_vex_0f3a_instruction_code |
||
3218 | test [rex_prefix],1011b |
||
3219 | jnz store_vex_0f_instruction_code |
||
3220 | mov [edi+2],ah |
||
3221 | mov byte [edi],0C5h |
||
3222 | mov al,[vex_register] |
||
3223 | not al |
||
3224 | shl al,3 |
||
3225 | mov ah,[rex_prefix] |
||
3226 | shl ah,5 |
||
3227 | and ah,80h |
||
3228 | xor al,ah |
||
3229 | call get_vex_lpp_bits |
||
3230 | mov [edi+1],al |
||
3231 | call check_vex |
||
3232 | add edi,3 |
||
3233 | ret |
||
3234 | get_vex_lpp_bits: |
||
3235 | cmp [operand_size],32 |
||
3236 | jne get_vex_pp_bits |
||
3237 | or al,100b |
||
3238 | get_vex_pp_bits: |
||
3239 | mov ah,[opcode_prefix] |
||
3240 | cmp ah,66h |
||
3241 | je vex_66 |
||
3242 | cmp ah,0F3h |
||
3243 | je vex_f3 |
||
3244 | cmp ah,0F2h |
||
3245 | je vex_f2 |
||
3246 | test ah,ah |
||
3247 | jnz disallowed_combination_of_registers |
||
3248 | ret |
||
3249 | vex_f2: |
||
3250 | or al,11b |
||
3251 | ret |
||
3252 | vex_f3: |
||
3253 | or al,10b |
||
3254 | ret |
||
3255 | vex_66: |
||
3256 | or al,1 |
||
3257 | ret |
||
3258 | store_vex_0f38_instruction_code: |
||
3259 | mov al,11100010b |
||
3260 | mov ah,[supplemental_code] |
||
3261 | jmp make_c4_vex |
||
3262 | store_vex_0f3a_instruction_code: |
||
3263 | mov al,11100011b |
||
3264 | mov ah,[supplemental_code] |
||
3265 | jmp make_c4_vex |
||
3266 | store_vex_0f_instruction_code: |
||
3267 | mov al,11100001b |
||
3268 | make_c4_vex: |
||
3269 | mov [edi+3],ah |
||
3270 | mov byte [edi],0C4h |
||
3271 | mov ah,[rex_prefix] |
||
3272 | shl ah,5 |
||
3273 | xor al,ah |
||
3274 | mov [edi+1],al |
||
3275 | call check_vex |
||
3276 | mov al,[vex_register] |
||
3277 | xor al,1111b |
||
3278 | shl al,3 |
||
3279 | mov ah,[rex_prefix] |
||
3280 | shl ah,4 |
||
3281 | and ah,80h |
||
3282 | or al,ah |
||
3283 | call get_vex_lpp_bits |
||
3284 | mov [edi+2],al |
||
3285 | add edi,4 |
||
3286 | ret |
||
3287 | check_vex: |
||
3288 | cmp [code_type],64 |
||
3289 | je vex_ok |
||
3290 | not al |
||
3291 | test al,11000000b |
||
3292 | jnz invalid_operand |
||
3293 | test [rex_prefix],40h |
||
3294 | jnz invalid_operand |
||
3295 | vex_ok: |
||
3296 | ret |
||
3297 | store_xop_instruction_code: |
||
3298 | mov [edi+3],al |
||
3299 | mov byte [edi],8Fh |
||
3300 | mov al,[xop_opcode_map] |
||
3301 | mov ah,[rex_prefix] |
||
3302 | test ah,40h |
||
3303 | jz xop_ok |
||
3304 | cmp [code_type],64 |
||
3305 | jne invalid_operand |
||
3306 | xop_ok: |
||
3307 | not ah |
||
3308 | shl ah,5 |
||
3309 | xor al,ah |
||
3310 | mov [edi+1],al |
||
3311 | mov al,[vex_register] |
||
3312 | xor al,1111b |
||
3313 | shl al,3 |
||
3314 | mov ah,[rex_prefix] |
||
3315 | shl ah,4 |
||
3316 | and ah,80h |
||
3317 | or al,ah |
||
3318 | call get_vex_lpp_bits |
||
3319 | mov [edi+2],al |
||
3320 | add edi,4 |
||
3321 | ret |
||
3322 | store_evex_instruction_code: |
||
3323 | test [vex_required],2 |
||
3324 | jnz invalid_operand |
||
3325 | cmp [base_code],0Fh |
||
3326 | jne invalid_operand |
||
3327 | cmp [displacement_compression],1 |
||
3328 | jne prepare_evex |
||
3329 | call compress_displacement |
||
3330 | prepare_evex: |
||
3331 | mov ah,[extended_code] |
||
3332 | cmp ah,38h |
||
3333 | je store_evex_0f38_instruction_code |
||
3334 | cmp ah,3Ah |
||
3335 | je store_evex_0f3a_instruction_code |
||
3336 | mov al,11110001b |
||
3337 | make_evex: |
||
3338 | mov [edi+4],ah |
||
3339 | mov byte [edi],62h |
||
3340 | mov ah,[rex_prefix] |
||
3341 | shl ah,5 |
||
3342 | xor al,ah |
||
3343 | mov ah,[vex_required] |
||
3344 | and ah,10h |
||
3345 | xor al,ah |
||
3346 | mov [edi+1],al |
||
3347 | call check_vex |
||
3348 | mov al,[vex_register] |
||
3349 | not al |
||
3350 | and al,1111b |
||
3351 | shl al,3 |
||
3352 | mov ah,[rex_prefix] |
||
3353 | shl ah,4 |
||
3354 | or ah,[rex_prefix] |
||
3355 | and ah,80h |
||
3356 | or al,ah |
||
3357 | or al,100b |
||
3358 | call get_vex_pp_bits |
||
3359 | mov [edi+2],al |
||
3360 | mov al,[vex_register] |
||
3361 | not al |
||
3362 | shr al,1 |
||
3363 | and al,1000b |
||
3364 | test [vex_required],80h |
||
3365 | jne evex_rounding |
||
3366 | mov ah,[operand_size] |
||
3367 | cmp ah,16 |
||
3368 | jbe evex_l_ok |
||
3369 | or al,ah |
||
3370 | jmp evex_l_ok |
||
3371 | evex_rounding: |
||
3372 | mov ah,[rounding_mode] |
||
3373 | shl ah,5 |
||
3374 | or al,ah |
||
3375 | evex_l_ok: |
||
3376 | test [vex_required],20h |
||
3377 | jz evex_zaaa_ok |
||
3378 | or al,[mask_register] |
||
3379 | evex_zaaa_ok: |
||
3380 | test [vex_required],40h |
||
3381 | jz evex_b_ok |
||
3382 | or al,10h |
||
3383 | evex_b_ok: |
||
3384 | mov [edi+3],al |
||
3385 | add edi,5 |
||
3386 | ret |
||
3387 | store_evex_0f38_instruction_code: |
||
3388 | mov al,11110010b |
||
3389 | mov ah,[supplemental_code] |
||
3390 | jmp make_evex |
||
3391 | store_evex_0f3a_instruction_code: |
||
3392 | mov al,11110011b |
||
3393 | mov ah,[supplemental_code] |
||
3394 | jmp make_evex |
||
3395 | compress_displacement: |
||
3396 | mov ebp,ecx |
||
3397 | mov [uncompressed_displacement],edx |
||
3398 | or edx,edx |
||
3399 | jz displacement_compressed |
||
3400 | xor ecx,ecx |
||
3401 | mov cl,[mmx_size] |
||
3402 | test cl,cl |
||
3403 | jnz calculate_displacement_scale |
||
3404 | mov cl,[operand_size] |
||
3405 | calculate_displacement_scale: |
||
3406 | bsf ecx,ecx |
||
3407 | jz displacement_compression_ok |
||
3408 | xor eax,eax |
||
3409 | shrd eax,edx,cl |
||
3410 | jnz displacement_not_compressed |
||
3411 | sar edx,cl |
||
3412 | cmp edx,80h |
||
3413 | jb displacement_compressed |
||
3414 | cmp edx,-80h |
||
3415 | jnb displacement_compressed |
||
3416 | shl edx,cl |
||
3417 | displacement_not_compressed: |
||
3418 | inc [displacement_compression] |
||
3419 | jmp displacement_compression_ok |
||
3420 | displacement_compressed: |
||
3421 | add [displacement_compression],2 |
||
3422 | displacement_compression_ok: |
||
3423 | mov ecx,ebp |
||
3424 | ret |
||
3425 |