-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavx.inc
3425 lines (3399 loc) · 72.6 KB
/
avx.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; flat assembler core
; Copyright (c) 1999-2022, Tomasz Grysztar.
; All rights reserved.
avx_single_source_pd_instruction_er_evex:
or [vex_required],8
avx_single_source_pd_instruction_er:
or [operand_flags],2+4+8
jmp avx_pd_instruction
avx_single_source_pd_instruction_sae_evex:
or [vex_required],8
or [operand_flags],2+4
jmp avx_pd_instruction
avx_pd_instruction_imm8:
mov [immediate_size],1
jmp avx_pd_instruction
avx_pd_instruction_er:
or [operand_flags],8
avx_pd_instruction_sae:
or [operand_flags],4
avx_pd_instruction:
mov [opcode_prefix],66h
or [rex_prefix],80h
mov cx,0800h
jmp avx_instruction_with_broadcast
avx_pd_instruction_38_evex:
or [vex_required],8
mov [supplemental_code],al
mov al,38h
jmp avx_pd_instruction
avx_cvtps2dq_instruction:
mov [opcode_prefix],66h
jmp avx_single_source_ps_instruction_er
avx_cvtudq2ps_instruction:
mov [opcode_prefix],0F2h
avx_single_source_ps_instruction_er_evex:
or [vex_required],8
avx_single_source_ps_instruction_er:
or [operand_flags],2+4+8
jmp avx_ps_instruction
avx_single_source_ps_instruction_noevex:
or [operand_flags],2
or [vex_required],2
jmp avx_ps_instruction
avx_ps_instruction_imm8:
mov [immediate_size],1
jmp avx_ps_instruction
avx_ps_instruction_er:
or [operand_flags],8
avx_ps_instruction_sae:
or [operand_flags],4
avx_ps_instruction:
mov cx,0400h
jmp avx_instruction_with_broadcast
avx_ps_instruction_66_38_evex:
or [vex_required],8
mov [opcode_prefix],66h
mov [supplemental_code],al
mov al,38h
jmp avx_ps_instruction
avx_sd_instruction_er:
or [operand_flags],8
avx_sd_instruction_sae:
or [operand_flags],4
avx_sd_instruction:
mov [opcode_prefix],0F2h
or [rex_prefix],80h
mov cl,8
jmp avx_instruction
avx_ss_instruction_er:
or [operand_flags],8
avx_ss_instruction_sae:
or [operand_flags],4
avx_ss_instruction:
mov [opcode_prefix],0F3h
mov cl,4
jmp avx_instruction
avx_ss_instruction_noevex:
or [vex_required],2
jmp avx_ss_instruction
avx_single_source_q_instruction_38_evex:
or [operand_flags],2
avx_q_instruction_38_evex:
or [vex_required],8
avx_q_instruction_38:
mov [supplemental_code],al
mov al,38h
jmp avx_q_instruction
avx_q_instruction_38_w1_evex:
or [vex_required],8
avx_q_instruction_38_w1:
or [rex_prefix],8
jmp avx_q_instruction_38
avx_q_instruction_3a_imm8_w1:
or [rex_prefix],8
jmp avx_q_instruction_3a_imm8
avx_q_instruction_3a_imm8_evex:
or [vex_required],8
avx_q_instruction_3a_imm8:
mov [immediate_size],1
mov [supplemental_code],al
mov al,3Ah
jmp avx_q_instruction
avx_q_instruction_evex:
or [vex_required],8
avx_q_instruction:
or [rex_prefix],80h
mov ch,8
jmp avx_pi_instruction
avx_single_source_d_instruction_38_evex_w1:
or [rex_prefix],8
avx_single_source_d_instruction_38_evex:
or [vex_required],8
avx_single_source_d_instruction_38:
or [operand_flags],2
jmp avx_d_instruction_38
avx_d_instruction_38_evex:
or [vex_required],8
avx_d_instruction_38:
mov [supplemental_code],al
mov al,38h
jmp avx_d_instruction
avx_d_instruction_3a_imm8_evex:
mov [immediate_size],1
or [vex_required],8
mov [supplemental_code],al
mov al,3Ah
jmp avx_d_instruction
avx_single_source_d_instruction_imm8:
or [operand_flags],2
mov [immediate_size],1
jmp avx_d_instruction
avx_d_instruction_evex:
or [vex_required],8
avx_d_instruction:
mov ch,4
jmp avx_pi_instruction
avx_bw_instruction_3a_imm8_w1_evex:
or [rex_prefix],8
avx_bw_instruction_3a_imm8_evex:
mov [immediate_size],1
or [vex_required],8
mov [supplemental_code],al
mov al,3Ah
jmp avx_bw_instruction
avx_single_source_bw_instruction_38:
or [operand_flags],2
avx_bw_instruction_38:
mov [supplemental_code],al
mov al,38h
avx_bw_instruction:
xor ch,ch
avx_pi_instruction:
mov [opcode_prefix],66h
xor cl,cl
jmp avx_instruction_with_broadcast
avx_bw_instruction_38_w1_evex:
or [rex_prefix],8
avx_bw_instruction_38_evex:
or [vex_required],8
jmp avx_bw_instruction_38
avx_pd_instruction_noevex:
xor cl,cl
or [vex_required],2
mov [opcode_prefix],66h
jmp avx_instruction
avx_ps_instruction_noevex:
or [vex_required],2
mov [opcode_prefix],0F2h
xor cl,cl
jmp avx_instruction
avx_instruction:
xor ch,ch
avx_instruction_with_broadcast:
mov [mmx_size],cl
mov [broadcast_size],ch
mov [base_code],0Fh
mov [extended_code],al
avx_xop_common:
or [vex_required],1
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
avx_reg:
lods byte [esi]
call convert_avx_register
mov [postbyte_register],al
call take_avx512_mask
avx_vex_reg:
test [operand_flags],2
jnz avx_vex_reg_ok
lods byte [esi]
cmp al,','
jne invalid_operand
call take_avx_register
mov [vex_register],al
avx_vex_reg_ok:
mov al,[mmx_size]
or al,al
jz avx_regs_size_ok
mov ah,[operand_size]
or ah,ah
jz avx_regs_size_ok
cmp al,ah
je avx_regs_size_ok
ja invalid_operand_size
cmp ah,16
jne invalid_operand_size
avx_regs_size_ok:
lods byte [esi]
cmp al,','
jne invalid_operand
avx_regs_rm:
call take_avx_rm
jc avx_regs_reg
mov al,[immediate_size]
cmp al,1
je mmx_imm8
jb instruction_ready
cmp al,-4
je sse_cmp_mem_ok
cmp byte [esi],','
jne invalid_operand
inc esi
call take_avx_register
shl al,4
jc invalid_operand
or byte [value],al
test al,80h
jz avx_regs_mem_reg_store
cmp [code_type],64
jne invalid_operand
avx_regs_mem_reg_store:
call take_imm4_if_needed
call store_instruction_with_imm8
jmp instruction_assembled
avx_regs_reg:
mov bl,al
call take_avx512_rounding
mov al,[immediate_size]
cmp al,1
je mmx_nomem_imm8
jb nomem_instruction_ready
cmp al,-4
je sse_cmp_nomem_ok
lods byte [esi]
cmp al,','
jne invalid_operand
mov al,bl
shl al,4
jc invalid_operand
or byte [value],al
test al,80h
jz avx_regs_reg_
cmp [code_type],64
jne invalid_operand
avx_regs_reg_:
call take_avx_rm
jc avx_regs_reg_reg
cmp [immediate_size],-2
jg invalid_operand
or [rex_prefix],8
call take_imm4_if_needed
call store_instruction_with_imm8
jmp instruction_assembled
avx_regs_reg_reg:
shl al,4
jc invalid_operand
and byte [value],1111b
or byte [value],al
call take_imm4_if_needed
call store_nomem_instruction
mov al,byte [value]
stos byte [edi]
jmp instruction_assembled
take_avx_rm:
xor cl,cl
xchg cl,[operand_size]
lods byte [esi]
call get_size_operator
cmp al,'['
je take_avx_mem
cmp al,10h
jne invalid_operand
mov [operand_size],cl
lods byte [esi]
call convert_avx_register
or cl,cl
jnz avx_reg_ok
or cl,[mmx_size]
jz avx_reg_ok
cmp ah,cl
je avx_reg_ok
jb invalid_operand_size
cmp ah,16
jne invalid_operand_size
avx_reg_ok:
stc
ret
take_avx_mem:
push ecx
call get_address
cmp byte [esi],'{'
jne avx_mem_ok
inc esi
lods byte [esi]
cmp al,1Fh
jne invalid_operand
mov al,[esi]
shr al,4
cmp al,1
jne invalid_operand
mov al,[mmx_size]
or al,al
jnz avx_mem_broadcast_check
mov eax,[esp]
or al,al
jnz avx_mem_broadcast_check
mov al,[broadcast_size]
mov [mmx_size],al
mov ah,cl
lods byte [esi]
and al,1111b
mov cl,al
mov al,[broadcast_size]
shl al,cl
mov [esp],al
mov cl,ah
jmp avx_mem_broadcast_ok
avx_mem_broadcast_check:
bsf eax,eax
xchg al,[broadcast_size]
mov [mmx_size],al
bsf eax,eax
jz invalid_operand
mov ah,[broadcast_size]
sub ah,al
lods byte [esi]
and al,1111b
cmp al,ah
jne invalid_operand_size
avx_mem_broadcast_ok:
or [vex_required],40h
lods byte [esi]
cmp al,'}'
jne invalid_operand
avx_mem_ok:
pop eax
or al,al
jz avx_mem_size_deciding
xchg al,[operand_size]
cmp [mmx_size],0
jne avx_mem_size_enforced
or al,al
jz avx_mem_size_ok
cmp al,[operand_size]
jne operand_sizes_do_not_match
avx_mem_size_ok:
clc
ret
avx_mem_size_deciding:
mov al,[operand_size]
cmp [mmx_size],0
jne avx_mem_size_enforced
cmp al,16
je avx_mem_size_ok
cmp al,32
je avx_mem_size_ok
cmp al,64
je avx_mem_size_ok
or al,al
jnz invalid_operand_size
call recoverable_unknown_size
avx_mem_size_enforced:
or al,al
jz avx_mem_size_ok
cmp al,[mmx_size]
je avx_mem_size_ok
jmp invalid_operand_size
take_imm4_if_needed:
cmp [immediate_size],-3
jne imm4_ok
push ebx ecx edx
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
cmp al,'('
jne invalid_operand
call get_byte_value
test al,11110000b
jnz value_out_of_range
or byte [value],al
pop edx ecx ebx
imm4_ok:
ret
take_avx512_mask:
cmp byte [esi],'{'
jne avx512_masking_ok
test [operand_flags],10h
jnz invalid_operand
inc esi
lods byte [esi]
cmp al,14h
jne invalid_operand
lods byte [esi]
mov ah,al
shr ah,4
cmp ah,5
jne invalid_operand
and al,111b
or al,al
jz invalid_operand
mov [mask_register],al
or [vex_required],20h
lods byte [esi]
cmp al,'}'
jne invalid_operand
cmp byte [esi],'{'
jne avx512_masking_ok
test [operand_flags],20h
jnz invalid_operand
inc esi
lods byte [esi]
cmp al,1Fh
jne invalid_operand
lods byte [esi]
or al,al
jnz invalid_operand
or [mask_register],80h
lods byte [esi]
cmp al,'}'
jne invalid_operand
avx512_masking_ok:
retn
take_avx512_rounding:
test [operand_flags],4+8
jz avx512_rounding_done
test [operand_flags],8
jz avx512_rounding_allowed
cmp [mmx_size],0
jne avx512_rounding_allowed
cmp [operand_size],64
jne avx512_rounding_done
avx512_rounding_allowed:
cmp byte [esi],','
jne avx512_rounding_done
cmp byte [esi+1],'{'
jne avx512_rounding_done
add esi,2
mov [rounding_mode],0
or [vex_required],40h
test [operand_flags],8
jz take_sae
or [vex_required],80h
lods byte [esi]
cmp al,1Fh
jne invalid_operand
lods byte [esi]
mov ah,al
shr ah,4
cmp ah,2
jne invalid_operand
and al,11b
mov [rounding_mode],al
lods byte [esi]
cmp al,'-'
jne invalid_operand
take_sae:
lods byte [esi]
cmp al,1Fh
jne invalid_operand
lods byte [esi]
cmp al,30h
jne invalid_operand
lods byte [esi]
cmp al,'}'
jne invalid_operand
avx512_rounding_done:
retn
avx_movdqu_instruction:
mov ah,0F3h
jmp avx_movdq_instruction
avx_movdqa_instruction:
mov ah,66h
avx_movdq_instruction:
mov [opcode_prefix],ah
or [vex_required],2
jmp avx_movps_instruction
avx512_movdqu16_instruction:
or [rex_prefix],8
avx512_movdqu8_instruction:
mov ah,0F2h
jmp avx_movdq_instruction_evex
avx512_movdqu64_instruction:
or [rex_prefix],8
avx512_movdqu32_instruction:
mov ah,0F3h
jmp avx_movdq_instruction_evex
avx512_movdqa64_instruction:
or [rex_prefix],8
avx512_movdqa32_instruction:
mov ah,66h
avx_movdq_instruction_evex:
mov [opcode_prefix],ah
or [vex_required],8
jmp avx_movps_instruction
avx_movpd_instruction:
mov [opcode_prefix],66h
or [rex_prefix],80h
avx_movps_instruction:
or [operand_flags],2
mov [base_code],0Fh
mov [extended_code],al
or [vex_required],1
xor al,al
mov [mmx_size],al
mov [broadcast_size],al
lods byte [esi]
call get_size_operator
cmp al,10h
je avx_reg
inc [extended_code]
test [extended_code],1
jnz avx_mem
add [extended_code],-1+10h
avx_mem:
cmp al,'['
jne invalid_operand
call get_address
or [operand_flags],20h
call take_avx512_mask
lods byte [esi]
cmp al,','
jne invalid_operand
call take_avx_register
mov [postbyte_register],al
jmp instruction_ready
avx_movntpd_instruction:
or [rex_prefix],80h
avx_movntdq_instruction:
mov [opcode_prefix],66h
avx_movntps_instruction:
mov [base_code],0Fh
mov [extended_code],al
or [vex_required],1
or [operand_flags],10h
mov [mmx_size],0
lods byte [esi]
call get_size_operator
jmp avx_mem
avx_compress_q_instruction:
or [rex_prefix],8
avx_compress_d_instruction:
or [vex_required],8
mov [mmx_size],0
call setup_66_0f_38
lods byte [esi]
call get_size_operator
cmp al,10h
jne avx_mem
lods byte [esi]
call convert_avx_register
mov bl,al
call take_avx512_mask
lods byte [esi]
cmp al,','
jne invalid_operand
call take_avx_register
mov [postbyte_register],al
jmp nomem_instruction_ready
avx_lddqu_instruction:
mov ah,0F2h
or [vex_required],2
avx_load_instruction:
mov [opcode_prefix],ah
mov [base_code],0Fh
mov [extended_code],al
mov [mmx_size],0
or [vex_required],1
call take_avx_register
mov [postbyte_register],al
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,'['
jne invalid_operand
call get_address
jmp instruction_ready
avx_movntdqa_instruction:
mov [supplemental_code],al
mov al,38h
mov ah,66h
jmp avx_load_instruction
avx_movq_instruction:
or [rex_prefix],8
mov [mmx_size],8
jmp avx_mov_instruction
avx_movd_instruction:
mov [mmx_size],4
avx_mov_instruction:
or [vex_required],1
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [extended_code],7Eh
lods byte [esi]
call get_size_operator
cmp al,10h
je avx_movd_reg
cmp al,'['
jne invalid_operand
call get_address
mov al,[mmx_size]
not al
and [operand_size],al
jnz invalid_operand_size
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_avx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
cmp [mmx_size],8
jne instruction_ready
and [rex_prefix],not 8
or [rex_prefix],80h
mov [extended_code],0D6h
jmp instruction_ready
avx_movd_reg:
lods byte [esi]
cmp al,0C0h
jae avx_movd_xmmreg
call convert_register
cmp ah,[mmx_size]
jne invalid_operand_size
mov [operand_size],0
mov bl,al
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_avx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
avx_movd_reg_ready:
test [rex_prefix],8
jz nomem_instruction_ready
cmp [code_type],64
jne illegal_instruction
jmp nomem_instruction_ready
avx_movd_xmmreg:
sub [extended_code],10h
call convert_avx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
mov [operand_size],0
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
je avx_movd_xmmreg_reg
cmp al,'['
jne invalid_operand
call get_address
mov al,[mmx_size]
cmp al,8
jne avx_movd_xmmreg_mem_ready
call avx_movq_xmmreg_xmmreg_opcode
avx_movd_xmmreg_mem_ready:
not al
test [operand_size],al
jnz invalid_operand_size
jmp instruction_ready
avx_movd_xmmreg_reg:
lods byte [esi]
cmp al,0C0h
jae avx_movq_xmmreg_xmmreg
call convert_register
cmp ah,[mmx_size]
jne invalid_operand_size
mov bl,al
jmp avx_movd_reg_ready
avx_movq_xmmreg_xmmreg:
cmp [mmx_size],8
jne invalid_operand
call avx_movq_xmmreg_xmmreg_opcode
call convert_avx_register
cmp ah,16
jne invalid_operand_size
mov bl,al
jmp nomem_instruction_ready
avx_movq_xmmreg_xmmreg_opcode:
and [rex_prefix],not 8
or [rex_prefix],80h
add [extended_code],10h
mov [opcode_prefix],0F3h
ret
avx_movddup_instruction:
or [vex_required],1
mov [opcode_prefix],0F2h
mov [base_code],0Fh
mov [extended_code],al
or [rex_prefix],80h
xor al,al
mov [mmx_size],al
mov [broadcast_size],al
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_avx_register
mov [postbyte_register],al
cmp ah,16
ja avx_movddup_size_ok
mov [mmx_size],8
avx_movddup_size_ok:
call take_avx512_mask
jmp avx_vex_reg_ok
avx_movlpd_instruction:
mov [opcode_prefix],66h
or [rex_prefix],80h
avx_movlps_instruction:
mov [base_code],0Fh
mov [extended_code],al
mov [mmx_size],8
mov [broadcast_size],0
or [vex_required],1
lods byte [esi]
call get_size_operator
cmp al,10h
jne avx_movlps_mem
lods byte [esi]
call convert_avx_register
mov [postbyte_register],al
lods byte [esi]
cmp al,','
jne invalid_operand
call take_avx_register
mov [vex_register],al
cmp [operand_size],16
jne invalid_operand
mov [operand_size],0
lods byte [esi]
cmp al,','
jne invalid_operand
call take_avx_rm
jc invalid_operand
jmp instruction_ready
avx_movlps_mem:
cmp al,'['
jne invalid_operand
call get_address
avx_movlps_mem_:
mov al,[operand_size]
or al,al
jz avx_movlps_mem_size_ok
cmp al,[mmx_size]
jne invalid_operand_size
mov [operand_size],0
avx_movlps_mem_size_ok:
lods byte [esi]
cmp al,','
jne invalid_operand
call take_avx_register
cmp ah,16
jne invalid_operand
mov [postbyte_register],al
inc [extended_code]
jmp instruction_ready
avx_movhlps_instruction:
mov [base_code],0Fh
mov [extended_code],al
or [vex_required],1
call take_avx_register
cmp ah,16
jne invalid_operand
mov [postbyte_register],al
lods byte [esi]
cmp al,','
jne invalid_operand
call take_avx_register
mov [vex_register],al
lods byte [esi]
cmp al,','
jne invalid_operand
call take_avx_register
mov bl,al
jmp nomem_instruction_ready
avx_movsd_instruction:
mov al,0F2h
mov cl,8
or [rex_prefix],80h
jmp avx_movs_instruction
avx_movss_instruction:
mov al,0F3h
mov cl,4
avx_movs_instruction:
mov [opcode_prefix],al
mov [mmx_size],cl
or [vex_required],1
mov [base_code],0Fh
mov [extended_code],10h
lods byte [esi]
call get_size_operator
cmp al,10h
jne avx_movs_mem
lods byte [esi]
call convert_avx_register
cmp ah,16
jne invalid_operand
mov [postbyte_register],al
call take_avx512_mask
xor cl,cl
xchg cl,[operand_size]
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
jne avx_movs_reg_mem
mov [operand_size],cl
lods byte [esi]
call convert_avx_register
mov [vex_register],al
lods byte [esi]
cmp al,','
jne invalid_operand
call take_avx_register
mov bl,al
cmp bl,8
jb nomem_instruction_ready
inc [extended_code]
xchg bl,[postbyte_register]
jmp nomem_instruction_ready
avx_movs_reg_mem:
cmp al,'['
jne invalid_operand
call get_address
mov al,[operand_size]
or al,al
jz avx_movs_reg_mem_ok
cmp al,[mmx_size]
jne invalid_operand_size
avx_movs_reg_mem_ok:
jmp instruction_ready
avx_movs_mem:
cmp al,'['
jne invalid_operand
call get_address
or [operand_flags],20h
call take_avx512_mask
jmp avx_movlps_mem_
avx_comiss_instruction:
or [operand_flags],2+4+10h
mov cl,4
jmp avx_instruction
avx_comisd_instruction:
or [operand_flags],2+4+10h
mov [opcode_prefix],66h
or [rex_prefix],80h
mov cl,8
jmp avx_instruction
avx_movshdup_instruction:
or [operand_flags],2
mov [opcode_prefix],0F3h
xor cl,cl
jmp avx_instruction
avx_cvtqq2pd_instruction:
mov [opcode_prefix],0F3h
or [vex_required],8
or [operand_flags],2+4+8
or [rex_prefix],8
mov cx,0800h
jmp avx_instruction_with_broadcast
avx_pshuf_w_instruction:
mov [opcode_prefix],al
or [operand_flags],2
mov [immediate_size],1
mov al,70h
xor cl,cl
jmp avx_instruction
avx_single_source_128bit_instruction_38_noevex:
or [operand_flags],2
avx_128bit_instruction_38_noevex:
mov cl,16
jmp avx_instruction_38_noevex
avx_single_source_instruction_38_noevex:
or [operand_flags],2
jmp avx_pi_instruction_38_noevex
avx_pi_instruction_38_noevex:
xor cl,cl
avx_instruction_38_noevex:
or [vex_required],2
avx_instruction_38:
mov [opcode_prefix],66h
mov [supplemental_code],al
mov al,38h
jmp avx_instruction
avx_ss_instruction_3a_imm8_noevex:
mov cl,4
jmp avx_instruction_3a_imm8_noevex
avx_sd_instruction_3a_imm8_noevex:
mov cl,8
jmp avx_instruction_3a_imm8_noevex
avx_single_source_128bit_instruction_3a_imm8_noevex:
or [operand_flags],2
avx_128bit_instruction_3a_imm8_noevex:
mov cl,16
jmp avx_instruction_3a_imm8_noevex
avx_triple_source_instruction_3a_noevex:
xor cl,cl
mov [immediate_size],-1
mov byte [value],0
jmp avx_instruction_3a_noevex
avx_single_source_instruction_3a_imm8_noevex:
or [operand_flags],2
avx_pi_instruction_3a_imm8_noevex:
xor cl,cl
avx_instruction_3a_imm8_noevex:
mov [immediate_size],1
avx_instruction_3a_noevex:
or [vex_required],2
avx_instruction_3a:
mov [opcode_prefix],66h
mov [supplemental_code],al
mov al,3Ah
jmp avx_instruction
avx_pi_instruction_3a_imm8:
xor cl,cl
mov [immediate_size],1
jmp avx_instruction_3a
avx_pclmulqdq_instruction:
mov byte [value],al
mov [immediate_size],-4
xor cl,cl
mov al,44h
or [operand_flags],10h
jmp avx_instruction_3a
avx_instruction_38_nomask:
or [operand_flags],10h
xor cl,cl
jmp avx_instruction_38
avx512_single_source_pd_instruction_sae_imm8:
or [operand_flags],2
avx512_pd_instruction_sae_imm8:
or [rex_prefix],8
mov cx,0800h
jmp avx512_instruction_sae_imm8
avx512_single_source_ps_instruction_sae_imm8:
or [operand_flags],2
avx512_ps_instruction_sae_imm8:
mov cx,0400h
jmp avx512_instruction_sae_imm8
avx512_sd_instruction_sae_imm8:
or [rex_prefix],8
mov cx,0008h
jmp avx512_instruction_sae_imm8
avx512_ss_instruction_sae_imm8:
mov cx,0004h
avx512_instruction_sae_imm8:
or [operand_flags],4
avx512_instruction_imm8:
or [vex_required],8
mov [opcode_prefix],66h
mov [immediate_size],1
mov [supplemental_code],al
mov al,3Ah
jmp avx_instruction_with_broadcast
avx512_pd_instruction_er:
or [operand_flags],4+8
jmp avx512_pd_instruction
avx512_single_source_pd_instruction_sae:
or [operand_flags],4
avx512_single_source_pd_instruction:
or [operand_flags],2
avx512_pd_instruction:
or [rex_prefix],8