Subversion Repositories Kolibri OS

Rev

Rev 7836 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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