gas/
[deliverable/binutils-gdb.git] / opcodes / i386-dis.c
index 673266d1196892ec27be8df6c4c318ab7f9d0cdf..83de1f72536647dc4ab517e9954dcd3a49ad4bc6 100644 (file)
@@ -1,6 +1,7 @@
 /* Print i386 instructions for GDB, the GNU debugger.
    Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   Free Software Foundation, Inc.
 
    This file is part of the GNU opcodes library.
 
@@ -53,6 +54,8 @@ static void oappend (const char *);
 static void append_seg (void);
 static void OP_indirE (int, int);
 static void print_operand_value (char *, int, bfd_vma);
+static void OP_E_register (int, int);
+static void OP_E_memory (int, int, int);
 static void OP_E_extended (int, int, int);
 static void print_displacement (char *, bfd_vma);
 static void OP_E (int, int);
@@ -89,13 +92,20 @@ static void OP_MXC (int,int);
 static void OP_MS (int, int);
 static void OP_XS (int, int);
 static void OP_M (int, int);
+static void OP_VEX (int, int);
+static void OP_EX_Vex (int, int);
+static void OP_XMM_Vex (int, int);
+static void OP_REG_VexI4 (int, int);
+static void PCLMUL_Fixup (int, int);
+static void VZERO_Fixup (int, int);
+static void VCMP_Fixup (int, int);
 static void OP_0f07 (int, int);
 static void OP_Monitor (int, int);
 static void OP_Mwait (int, int);
 static void NOP_Fixup1 (int, int);
 static void NOP_Fixup2 (int, int);
 static void OP_3DNowSuffix (int, int);
-static void OP_SIMD_Suffix (int, int);
+static void CMP_Fixup (int, int);
 static void BadOp (void);
 static void REP_Fixup (int, int);
 static void CMPXCHG8B_Fixup (int, int);
@@ -106,6 +116,7 @@ static void OP_DREX4 (int, int);
 static void OP_DREX3 (int, int);
 static void OP_DREX_ICMP (int, int);
 static void OP_DREX_FCMP (int, int);
+static void MOVBE_Fixup (int, int);
 
 struct dis_private {
   /* Points to first byte not fetched.  */
@@ -132,6 +143,11 @@ static int prefixes;
 static int rex;
 /* Bits of REX we've already used.  */
 static int rex_used;
+/* Original REX prefix.  */
+static int rex_original;
+/* REX bits in original REX prefix ignored.  It may not be the same
+   as rex_original since some bits may not be ignored.  */
+static int rex_ignored;
 /* Mark parts used in the REX prefix.  When we are testing for
    empty prefix (for 8bit register REX extension), just mask it
    out.  Otherwise test for REX bit is excuse for existence of REX
@@ -218,7 +234,9 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define XX { NULL, 0 }
 
 #define Eb { OP_E, b_mode }
+#define EbS { OP_E, b_swap_mode }
 #define Ev { OP_E, v_mode }
+#define EvS { OP_E, v_swap_mode }
 #define Ed { OP_E, d_mode }
 #define Edq { OP_E, dq_mode }
 #define Edqw { OP_E, dqw_mode }
@@ -231,11 +249,14 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define Em { OP_E, m_mode }
 #define Ew { OP_E, w_mode }
 #define M { OP_M, 0 }          /* lea, lgdt, etc. */
-#define Ma { OP_M, v_mode }
+#define Ma { OP_M, a_mode }
 #define Mb { OP_M, b_mode }
 #define Md { OP_M, d_mode }
+#define Mo { OP_M, o_mode }
 #define Mp { OP_M, f_mode }            /* 32 or 48 bit memory operand for LDS, LES etc */
 #define Mq { OP_M, q_mode }
+#define Mx { OP_M, x_mode }
+#define Mxmm { OP_M, xmm_mode }
 #define Gb { OP_G, b_mode }
 #define Gv { OP_G, v_mode }
 #define Gd { OP_G, d_mode }
@@ -328,21 +349,43 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 
 #define MX { OP_MMX, 0 }
 #define XM { OP_XMM, 0 }
+#define XMM { OP_XMM, xmm_mode }
 #define EM { OP_EM, v_mode }
+#define EMS { OP_EM, v_swap_mode }
 #define EMd { OP_EM, d_mode }
 #define EMx { OP_EM, x_mode }
 #define EXw { OP_EX, w_mode }
 #define EXd { OP_EX, d_mode }
+#define EXdS { OP_EX, d_swap_mode }
 #define EXq { OP_EX, q_mode }
+#define EXqS { OP_EX, q_swap_mode }
 #define EXx { OP_EX, x_mode }
+#define EXxS { OP_EX, x_swap_mode }
+#define EXxmm { OP_EX, xmm_mode }
+#define EXxmmq { OP_EX, xmmq_mode }
+#define EXymmq { OP_EX, ymmq_mode }
+#define EXVexWdq { OP_EX, vex_w_dq_mode }
 #define MS { OP_MS, v_mode }
 #define XS { OP_XS, v_mode }
 #define EMCq { OP_EMC, q_mode }
 #define MXC { OP_MXC, 0 }
 #define OPSUF { OP_3DNowSuffix, 0 }
-#define OPSIMD { OP_SIMD_Suffix, 0 }
+#define CMP { CMP_Fixup, 0 }
 #define XMM0 { XMM_Fixup, 0 }
 
+#define Vex { OP_VEX, vex_mode }
+#define Vex128 { OP_VEX, vex128_mode }
+#define Vex256 { OP_VEX, vex256_mode }
+#define EXdVex { OP_EX_Vex, d_mode }
+#define EXdVexS { OP_EX_Vex, d_swap_mode }
+#define EXqVex { OP_EX_Vex, q_mode }
+#define EXqVexS { OP_EX_Vex, q_swap_mode }
+#define XMVex { OP_XMM_Vex, 0 }
+#define XMVexI4 { OP_REG_VexI4, x_mode }
+#define PCLMUL { PCLMUL_Fixup, 0 }
+#define VZERO { VZERO_Fixup, 0 }
+#define VCMP { VCMP_Fixup, 0 }
+
 /* Used handle "rep" prefix for string instructions.  */
 #define Xbr { REP_Fixup, eSI_reg }
 #define Xvr { REP_Fixup, eSI_reg }
@@ -363,21 +406,39 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 
 /* byte operand */
 #define b_mode                 1
+/* byte operand with operand swapped */
+#define b_swap_mode            (b_mode + 1)
 /* operand size depends on prefixes */
-#define v_mode                 (b_mode + 1)
+#define v_mode                 (b_swap_mode + 1)
+/* operand size depends on prefixes with operand swapped */
+#define v_swap_mode            (v_mode + 1)
 /* word operand */
-#define w_mode                 (v_mode + 1)
+#define w_mode                 (v_swap_mode + 1)
 /* double word operand  */
 #define d_mode                 (w_mode + 1)
+/* double word operand with operand swapped */
+#define d_swap_mode            (d_mode + 1)
 /* quad word operand */
-#define q_mode                 (d_mode + 1)
+#define q_mode                 (d_swap_mode + 1)
+/* quad word operand with operand swapped */
+#define q_swap_mode            (q_mode + 1)
 /* ten-byte operand */
-#define t_mode                 (q_mode + 1)
-/* 16-byte XMM operand */
+#define t_mode                 (q_swap_mode + 1)
+/* 16-byte XMM or 32-byte YMM operand */
 #define x_mode                 (t_mode + 1)
+/* 16-byte XMM or 32-byte YMM operand with operand swapped */
+#define x_swap_mode            (x_mode + 1)
+/* 16-byte XMM operand */
+#define xmm_mode               (x_swap_mode + 1)
+/* 16-byte XMM or quad word operand */
+#define xmmq_mode              (xmm_mode + 1)
+/* 32-byte YMM or quad word operand */
+#define ymmq_mode              (xmmq_mode + 1)
 /* d_mode in 32bit, q_mode in 64bit mode.  */
-#define m_mode                 (x_mode + 1)
-#define cond_jump_mode         (m_mode + 1)
+#define m_mode                 (ymmq_mode + 1)
+/* pair of v_mode operands */
+#define a_mode                 (m_mode + 1)
+#define cond_jump_mode         (a_mode + 1)
 #define loop_jcxz_mode         (cond_jump_mode + 1)
 /* operand size depends on REX prefixes.  */
 #define dq_mode                        (loop_jcxz_mode + 1)
@@ -396,8 +457,16 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define dqb_mode               (o_mode + 1)
 /* registers like dq_mode, memory like d_mode.  */
 #define dqd_mode               (dqb_mode + 1)
-
-#define es_reg                 (dqd_mode + 1)
+/* normal vex mode */
+#define vex_mode               (dqd_mode + 1)
+/* 128bit vex mode */
+#define vex128_mode            (vex_mode + 1)
+/* 256bit vex mode */
+#define vex256_mode            (vex128_mode + 1)
+/* operand size depends on the VEX.W bit.  */
+#define vex_w_dq_mode          (vex256_mode + 1)
+
+#define es_reg                 (vex_w_dq_mode + 1)
 #define cs_reg                 (es_reg + 1)
 #define ss_reg                 (cs_reg + 1)
 #define ds_reg                 (ss_reg + 1)
@@ -455,13 +524,16 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #error MAX_BYTEMODE must be less than DREX_OC1
 #endif
 
-#define FLOATCODE 1
-#define USE_REG_TABLE 2
-#define USE_MOD_TABLE 3
-#define USE_RM_TABLE 4
-#define USE_PREFIX_TABLE 5
-#define USE_X86_64_TABLE 6
-#define USE_3BYTE_TABLE 7
+#define FLOATCODE              1
+#define USE_REG_TABLE          (FLOATCODE + 1)
+#define USE_MOD_TABLE          (USE_REG_TABLE + 1)
+#define USE_RM_TABLE           (USE_MOD_TABLE + 1)
+#define USE_PREFIX_TABLE       (USE_RM_TABLE + 1)
+#define USE_X86_64_TABLE       (USE_PREFIX_TABLE + 1)
+#define USE_3BYTE_TABLE                (USE_X86_64_TABLE + 1)
+#define USE_VEX_C4_TABLE       (USE_3BYTE_TABLE + 1)
+#define USE_VEX_C5_TABLE       (USE_VEX_C4_TABLE + 1)
+#define USE_VEX_LEN_TABLE      (USE_VEX_C5_TABLE + 1)
 
 #define FLOAT                  NULL, { { NULL, FLOATCODE } }
 
@@ -472,6 +544,9 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define PREFIX_TABLE(I)                DIS386 (USE_PREFIX_TABLE, (I))
 #define X86_64_TABLE(I)                DIS386 (USE_X86_64_TABLE, (I))
 #define THREE_BYTE_TABLE(I)    DIS386 (USE_3BYTE_TABLE, (I))
+#define VEX_C4_TABLE(I)                DIS386 (USE_VEX_C4_TABLE, (I))
+#define VEX_C5_TABLE(I)                DIS386 (USE_VEX_C5_TABLE, (I))
+#define VEX_LEN_TABLE(I)       DIS386 (USE_VEX_LEN_TABLE, (I))
 
 #define REG_80                 0
 #define REG_81                 (REG_80 + 1)
@@ -491,8 +566,8 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define REG_FF                 (REG_FE + 1)
 #define REG_0F00               (REG_FF + 1)
 #define REG_0F01               (REG_0F00 + 1)
-#define REG_0F0E               (REG_0F01 + 1)
-#define REG_0F18               (REG_0F0E + 1)
+#define REG_0F0D               (REG_0F01 + 1)
+#define REG_0F18               (REG_0F0D + 1)
 #define REG_0F71               (REG_0F18 + 1)
 #define REG_0F72               (REG_0F71 + 1)
 #define REG_0F73               (REG_0F72 + 1)
@@ -501,29 +576,37 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define REG_0FAE               (REG_0FA7 + 1)
 #define REG_0FBA               (REG_0FAE + 1)
 #define REG_0FC7               (REG_0FBA + 1)
+#define REG_VEX_71             (REG_0FC7 + 1)
+#define REG_VEX_72             (REG_VEX_71 + 1)
+#define REG_VEX_73             (REG_VEX_72 + 1)
+#define REG_VEX_AE             (REG_VEX_73 + 1)
 
 #define MOD_8D                 0
-#define MOD_0F13               (MOD_8D + 1)
-#define MOD_0F17               (MOD_0F13 + 1)
-#define MOD_0F20               (MOD_0F17 + 1)
-#define MOD_0F21               (MOD_0F20 + 1)
-#define MOD_0F22               (MOD_0F21 + 1)
-#define MOD_0F23               (MOD_0F22 + 1)
-#define MOD_0F24               (MOD_0F23 + 1)
-#define MOD_0F26               (MOD_0F24 + 1)
-#define MOD_0FB2               (MOD_0F26 + 1)
-#define MOD_0FB4               (MOD_0FB2 + 1)
-#define MOD_0FB5               (MOD_0FB4 + 1)
-#define MOD_0F01_REG_0         (MOD_0FB5 + 1)
+#define MOD_0F01_REG_0         (MOD_8D + 1)
 #define MOD_0F01_REG_1         (MOD_0F01_REG_0 + 1)
 #define MOD_0F01_REG_2         (MOD_0F01_REG_1 + 1)
 #define MOD_0F01_REG_3         (MOD_0F01_REG_2 + 1)
 #define MOD_0F01_REG_7         (MOD_0F01_REG_3 + 1)
-#define MOD_0F18_REG_0         (MOD_0F01_REG_7 + 1)
+#define MOD_0F12_PREFIX_0      (MOD_0F01_REG_7 + 1)
+#define MOD_0F13               (MOD_0F12_PREFIX_0 + 1)
+#define MOD_0F16_PREFIX_0      (MOD_0F13 + 1)
+#define MOD_0F17               (MOD_0F16_PREFIX_0 + 1)
+#define MOD_0F18_REG_0         (MOD_0F17 + 1)
 #define MOD_0F18_REG_1         (MOD_0F18_REG_0 + 1)
 #define MOD_0F18_REG_2         (MOD_0F18_REG_1 + 1)
 #define MOD_0F18_REG_3         (MOD_0F18_REG_2 + 1)
-#define MOD_0F71_REG_2         (MOD_0F18_REG_3 + 1)
+#define MOD_0F20               (MOD_0F18_REG_3 + 1)
+#define MOD_0F21               (MOD_0F20 + 1)
+#define MOD_0F22               (MOD_0F21 + 1)
+#define MOD_0F23               (MOD_0F22 + 1)
+#define MOD_0F24               (MOD_0F23 + 1)
+#define MOD_0F26               (MOD_0F24 + 1)
+#define MOD_0F2B_PREFIX_0      (MOD_0F26 + 1)
+#define MOD_0F2B_PREFIX_1      (MOD_0F2B_PREFIX_0 + 1)
+#define MOD_0F2B_PREFIX_2      (MOD_0F2B_PREFIX_1 + 1)
+#define MOD_0F2B_PREFIX_3      (MOD_0F2B_PREFIX_2 + 1)
+#define MOD_0F51               (MOD_0F2B_PREFIX_3 + 1)
+#define MOD_0F71_REG_2         (MOD_0F51 + 1)
 #define MOD_0F71_REG_4         (MOD_0F71_REG_2 + 1)
 #define MOD_0F71_REG_6         (MOD_0F71_REG_4 + 1)
 #define MOD_0F72_REG_2         (MOD_0F71_REG_6 + 1)
@@ -537,21 +620,56 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define MOD_0FAE_REG_1         (MOD_0FAE_REG_0 + 1)
 #define MOD_0FAE_REG_2         (MOD_0FAE_REG_1 + 1)
 #define MOD_0FAE_REG_3         (MOD_0FAE_REG_2 + 1)
-#define MOD_0FAE_REG_5         (MOD_0FAE_REG_3 + 1)
+#define MOD_0FAE_REG_4         (MOD_0FAE_REG_3 + 1)
+#define MOD_0FAE_REG_5         (MOD_0FAE_REG_4 + 1)
 #define MOD_0FAE_REG_6         (MOD_0FAE_REG_5 + 1)
 #define MOD_0FAE_REG_7         (MOD_0FAE_REG_6 + 1)
-#define MOD_0FC7_REG_6         (MOD_0FAE_REG_7 + 1)
+#define MOD_0FB2               (MOD_0FAE_REG_7 + 1)
+#define MOD_0FB4               (MOD_0FB2 + 1)
+#define MOD_0FB5               (MOD_0FB4 + 1)
+#define MOD_0FC7_REG_6         (MOD_0FB5 + 1)
 #define MOD_0FC7_REG_7         (MOD_0FC7_REG_6 + 1)
-#define MOD_0F12_PREFIX_0      (MOD_0FC7_REG_7 + 1)
-#define MOD_0F16_PREFIX_0      (MOD_0F12_PREFIX_0 + 1)
-#define MOD_0FF0_PREFIX_3      (MOD_0F16_PREFIX_0 + 1)
-#define MOD_62_32BIT           (MOD_0FF0_PREFIX_3 + 1)
+#define MOD_0FD7               (MOD_0FC7_REG_7 + 1)
+#define MOD_0FE7_PREFIX_2      (MOD_0FD7 + 1)
+#define MOD_0FF0_PREFIX_3      (MOD_0FE7_PREFIX_2 + 1)
+#define MOD_0F382A_PREFIX_2    (MOD_0FF0_PREFIX_3 + 1)
+#define MOD_62_32BIT           (MOD_0F382A_PREFIX_2 + 1)
 #define MOD_C4_32BIT           (MOD_62_32BIT + 1)
 #define MOD_C5_32BIT           (MOD_C4_32BIT + 1)
+#define MOD_VEX_12_PREFIX_0    (MOD_C5_32BIT + 1)
+#define MOD_VEX_13             (MOD_VEX_12_PREFIX_0 + 1)
+#define MOD_VEX_16_PREFIX_0    (MOD_VEX_13 + 1)
+#define MOD_VEX_17             (MOD_VEX_16_PREFIX_0 + 1)
+#define MOD_VEX_2B             (MOD_VEX_17 + 1)
+#define MOD_VEX_51             (MOD_VEX_2B + 1)
+#define MOD_VEX_71_REG_2       (MOD_VEX_51 + 1)
+#define MOD_VEX_71_REG_4       (MOD_VEX_71_REG_2 + 1)
+#define MOD_VEX_71_REG_6       (MOD_VEX_71_REG_4 + 1)
+#define MOD_VEX_72_REG_2       (MOD_VEX_71_REG_6 + 1)
+#define MOD_VEX_72_REG_4       (MOD_VEX_72_REG_2 + 1)
+#define MOD_VEX_72_REG_6       (MOD_VEX_72_REG_4 + 1)
+#define MOD_VEX_73_REG_2       (MOD_VEX_72_REG_6 + 1)
+#define MOD_VEX_73_REG_3       (MOD_VEX_73_REG_2 + 1)
+#define MOD_VEX_73_REG_6       (MOD_VEX_73_REG_3 + 1)
+#define MOD_VEX_73_REG_7       (MOD_VEX_73_REG_6 + 1)
+#define MOD_VEX_AE_REG_2       (MOD_VEX_73_REG_7 + 1)
+#define MOD_VEX_AE_REG_3       (MOD_VEX_AE_REG_2 + 1)
+#define MOD_VEX_D7_PREFIX_2    (MOD_VEX_AE_REG_3 + 1)
+#define MOD_VEX_E7_PREFIX_2    (MOD_VEX_D7_PREFIX_2 + 1)
+#define MOD_VEX_F0_PREFIX_3    (MOD_VEX_E7_PREFIX_2 + 1)
+#define MOD_VEX_3818_PREFIX_2  (MOD_VEX_F0_PREFIX_3 + 1)
+#define MOD_VEX_3819_PREFIX_2  (MOD_VEX_3818_PREFIX_2 + 1)
+#define MOD_VEX_381A_PREFIX_2  (MOD_VEX_3819_PREFIX_2 + 1)
+#define MOD_VEX_382A_PREFIX_2  (MOD_VEX_381A_PREFIX_2 + 1)
+#define MOD_VEX_382C_PREFIX_2  (MOD_VEX_382A_PREFIX_2 + 1)
+#define MOD_VEX_382D_PREFIX_2  (MOD_VEX_382C_PREFIX_2 + 1)
+#define MOD_VEX_382E_PREFIX_2  (MOD_VEX_382D_PREFIX_2 + 1)
+#define MOD_VEX_382F_PREFIX_2  (MOD_VEX_382E_PREFIX_2 + 1)
 
 #define RM_0F01_REG_0          0
 #define RM_0F01_REG_1          (RM_0F01_REG_0 + 1)
-#define RM_0F01_REG_3          (RM_0F01_REG_1 + 1)
+#define RM_0F01_REG_2          (RM_0F01_REG_1 + 1)
+#define RM_0F01_REG_3          (RM_0F01_REG_2 + 1)
 #define RM_0F01_REG_7          (RM_0F01_REG_3 + 1)
 #define RM_0FAE_REG_5          (RM_0F01_REG_7 + 1)
 #define RM_0FAE_REG_6          (RM_0FAE_REG_5 + 1)
@@ -586,7 +704,9 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define PREFIX_0F6D            (PREFIX_0F6C + 1)
 #define PREFIX_0F6F            (PREFIX_0F6D + 1)
 #define PREFIX_0F70            (PREFIX_0F6F + 1)
-#define PREFIX_0F78            (PREFIX_0F70 + 1)
+#define PREFIX_0F73_REG_3      (PREFIX_0F70 + 1)
+#define PREFIX_0F73_REG_7      (PREFIX_0F73_REG_3 + 1)
+#define PREFIX_0F78            (PREFIX_0F73_REG_7 + 1)
 #define PREFIX_0F79            (PREFIX_0F78 + 1)
 #define PREFIX_0F7C            (PREFIX_0F79 + 1)
 #define PREFIX_0F7D            (PREFIX_0F7C + 1)
@@ -595,7 +715,9 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define PREFIX_0FB8            (PREFIX_0F7F + 1)
 #define PREFIX_0FBD            (PREFIX_0FB8 + 1)
 #define PREFIX_0FC2            (PREFIX_0FBD + 1)
-#define PREFIX_0FD0            (PREFIX_0FC2 + 1)
+#define PREFIX_0FC3            (PREFIX_0FC2 + 1)
+#define PREFIX_0FC7_REG_6      (PREFIX_0FC3 + 1)
+#define PREFIX_0FD0            (PREFIX_0FC7_REG_6 + 1)
 #define PREFIX_0FD6            (PREFIX_0FD0 + 1)
 #define PREFIX_0FE6            (PREFIX_0FD6 + 1)
 #define PREFIX_0FE7            (PREFIX_0FE6 + 1)
@@ -632,7 +754,14 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define PREFIX_0F383F          (PREFIX_0F383E + 1)
 #define PREFIX_0F3840          (PREFIX_0F383F + 1)
 #define PREFIX_0F3841          (PREFIX_0F3840 + 1)
-#define PREFIX_0F38F0          (PREFIX_0F3841 + 1)
+#define PREFIX_0F3880          (PREFIX_0F3841 + 1)
+#define PREFIX_0F3881          (PREFIX_0F3880 + 1)
+#define PREFIX_0F38DB          (PREFIX_0F3881 + 1)
+#define PREFIX_0F38DC          (PREFIX_0F38DB + 1)
+#define PREFIX_0F38DD          (PREFIX_0F38DC + 1)
+#define PREFIX_0F38DE          (PREFIX_0F38DD + 1)
+#define PREFIX_0F38DF          (PREFIX_0F38DE + 1)
+#define PREFIX_0F38F0          (PREFIX_0F38DF + 1)
 #define PREFIX_0F38F1          (PREFIX_0F38F0 + 1)
 #define PREFIX_0F3A08          (PREFIX_0F38F1 + 1)
 #define PREFIX_0F3A09          (PREFIX_0F3A08 + 1)
@@ -651,13 +780,238 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define PREFIX_0F3A40          (PREFIX_0F3A22 + 1)
 #define PREFIX_0F3A41          (PREFIX_0F3A40 + 1)
 #define PREFIX_0F3A42          (PREFIX_0F3A41 + 1)
-#define PREFIX_0F3A60          (PREFIX_0F3A42 + 1)
+#define PREFIX_0F3A44          (PREFIX_0F3A42 + 1)
+#define PREFIX_0F3A60          (PREFIX_0F3A44 + 1)
 #define PREFIX_0F3A61          (PREFIX_0F3A60 + 1)
 #define PREFIX_0F3A62          (PREFIX_0F3A61 + 1)
 #define PREFIX_0F3A63          (PREFIX_0F3A62 + 1)
-#define PREFIX_0F73_REG_3      (PREFIX_0F3A63 + 1)
-#define PREFIX_0F73_REG_7      (PREFIX_0F73_REG_3 + 1)
-#define PREFIX_0FC7_REG_6      (PREFIX_0F73_REG_7 + 1)
+#define PREFIX_0F3ADF          (PREFIX_0F3A63 + 1)
+#define PREFIX_VEX_10          (PREFIX_0F3ADF + 1)
+#define PREFIX_VEX_11          (PREFIX_VEX_10 + 1)
+#define PREFIX_VEX_12          (PREFIX_VEX_11 + 1)
+#define PREFIX_VEX_16          (PREFIX_VEX_12 + 1)
+#define PREFIX_VEX_2A          (PREFIX_VEX_16 + 1)
+#define PREFIX_VEX_2C          (PREFIX_VEX_2A + 1)
+#define PREFIX_VEX_2D          (PREFIX_VEX_2C + 1)
+#define PREFIX_VEX_2E          (PREFIX_VEX_2D + 1)
+#define PREFIX_VEX_2F          (PREFIX_VEX_2E + 1)
+#define PREFIX_VEX_51          (PREFIX_VEX_2F + 1)
+#define PREFIX_VEX_52          (PREFIX_VEX_51 + 1)
+#define PREFIX_VEX_53          (PREFIX_VEX_52 + 1)
+#define PREFIX_VEX_58          (PREFIX_VEX_53 + 1)
+#define PREFIX_VEX_59          (PREFIX_VEX_58 + 1)
+#define PREFIX_VEX_5A          (PREFIX_VEX_59 + 1)
+#define PREFIX_VEX_5B          (PREFIX_VEX_5A + 1)
+#define PREFIX_VEX_5C          (PREFIX_VEX_5B + 1)
+#define PREFIX_VEX_5D          (PREFIX_VEX_5C + 1)
+#define PREFIX_VEX_5E          (PREFIX_VEX_5D + 1)
+#define PREFIX_VEX_5F          (PREFIX_VEX_5E + 1)
+#define PREFIX_VEX_60          (PREFIX_VEX_5F + 1)
+#define PREFIX_VEX_61          (PREFIX_VEX_60 + 1)
+#define PREFIX_VEX_62          (PREFIX_VEX_61 + 1)
+#define PREFIX_VEX_63          (PREFIX_VEX_62 + 1)
+#define PREFIX_VEX_64          (PREFIX_VEX_63 + 1)
+#define PREFIX_VEX_65          (PREFIX_VEX_64 + 1)
+#define PREFIX_VEX_66          (PREFIX_VEX_65 + 1)
+#define PREFIX_VEX_67          (PREFIX_VEX_66 + 1)
+#define PREFIX_VEX_68          (PREFIX_VEX_67 + 1)
+#define PREFIX_VEX_69          (PREFIX_VEX_68 + 1)
+#define PREFIX_VEX_6A          (PREFIX_VEX_69 + 1)
+#define PREFIX_VEX_6B          (PREFIX_VEX_6A + 1)
+#define PREFIX_VEX_6C          (PREFIX_VEX_6B + 1)
+#define PREFIX_VEX_6D          (PREFIX_VEX_6C + 1)
+#define PREFIX_VEX_6E          (PREFIX_VEX_6D + 1)
+#define PREFIX_VEX_6F          (PREFIX_VEX_6E + 1)
+#define PREFIX_VEX_70          (PREFIX_VEX_6F + 1)
+#define PREFIX_VEX_71_REG_2    (PREFIX_VEX_70 + 1)
+#define PREFIX_VEX_71_REG_4    (PREFIX_VEX_71_REG_2 + 1)
+#define PREFIX_VEX_71_REG_6    (PREFIX_VEX_71_REG_4 + 1)
+#define PREFIX_VEX_72_REG_2    (PREFIX_VEX_71_REG_6 + 1)
+#define PREFIX_VEX_72_REG_4    (PREFIX_VEX_72_REG_2 + 1)
+#define PREFIX_VEX_72_REG_6    (PREFIX_VEX_72_REG_4 + 1)
+#define PREFIX_VEX_73_REG_2    (PREFIX_VEX_72_REG_6 + 1)
+#define PREFIX_VEX_73_REG_3    (PREFIX_VEX_73_REG_2 + 1)
+#define PREFIX_VEX_73_REG_6    (PREFIX_VEX_73_REG_3 + 1)
+#define PREFIX_VEX_73_REG_7    (PREFIX_VEX_73_REG_6 + 1)
+#define PREFIX_VEX_74          (PREFIX_VEX_73_REG_7 + 1)
+#define PREFIX_VEX_75          (PREFIX_VEX_74 + 1)
+#define PREFIX_VEX_76          (PREFIX_VEX_75 + 1)
+#define PREFIX_VEX_77          (PREFIX_VEX_76 + 1)
+#define PREFIX_VEX_7C          (PREFIX_VEX_77 + 1)
+#define PREFIX_VEX_7D          (PREFIX_VEX_7C + 1)
+#define PREFIX_VEX_7E          (PREFIX_VEX_7D + 1)
+#define PREFIX_VEX_7F          (PREFIX_VEX_7E + 1)
+#define PREFIX_VEX_C2          (PREFIX_VEX_7F + 1)
+#define PREFIX_VEX_C4          (PREFIX_VEX_C2 + 1)
+#define PREFIX_VEX_C5          (PREFIX_VEX_C4 + 1)
+#define PREFIX_VEX_D0          (PREFIX_VEX_C5 + 1)
+#define PREFIX_VEX_D1          (PREFIX_VEX_D0 + 1)
+#define PREFIX_VEX_D2          (PREFIX_VEX_D1 + 1)
+#define PREFIX_VEX_D3          (PREFIX_VEX_D2 + 1)
+#define PREFIX_VEX_D4          (PREFIX_VEX_D3 + 1)
+#define PREFIX_VEX_D5          (PREFIX_VEX_D4 + 1)
+#define PREFIX_VEX_D6          (PREFIX_VEX_D5 + 1)
+#define PREFIX_VEX_D7          (PREFIX_VEX_D6 + 1)
+#define PREFIX_VEX_D8          (PREFIX_VEX_D7 + 1)
+#define PREFIX_VEX_D9          (PREFIX_VEX_D8 + 1)
+#define PREFIX_VEX_DA          (PREFIX_VEX_D9 + 1)
+#define PREFIX_VEX_DB          (PREFIX_VEX_DA + 1)
+#define PREFIX_VEX_DC          (PREFIX_VEX_DB + 1)
+#define PREFIX_VEX_DD          (PREFIX_VEX_DC + 1)
+#define PREFIX_VEX_DE          (PREFIX_VEX_DD + 1)
+#define PREFIX_VEX_DF          (PREFIX_VEX_DE + 1)
+#define PREFIX_VEX_E0          (PREFIX_VEX_DF + 1)
+#define PREFIX_VEX_E1          (PREFIX_VEX_E0 + 1)
+#define PREFIX_VEX_E2          (PREFIX_VEX_E1 + 1)
+#define PREFIX_VEX_E3          (PREFIX_VEX_E2 + 1)
+#define PREFIX_VEX_E4          (PREFIX_VEX_E3 + 1)
+#define PREFIX_VEX_E5          (PREFIX_VEX_E4 + 1)
+#define PREFIX_VEX_E6          (PREFIX_VEX_E5 + 1)
+#define PREFIX_VEX_E7          (PREFIX_VEX_E6 + 1)
+#define PREFIX_VEX_E8          (PREFIX_VEX_E7 + 1)
+#define PREFIX_VEX_E9          (PREFIX_VEX_E8 + 1)
+#define PREFIX_VEX_EA          (PREFIX_VEX_E9 + 1)
+#define PREFIX_VEX_EB          (PREFIX_VEX_EA + 1)
+#define PREFIX_VEX_EC          (PREFIX_VEX_EB + 1)
+#define PREFIX_VEX_ED          (PREFIX_VEX_EC + 1)
+#define PREFIX_VEX_EE          (PREFIX_VEX_ED + 1)
+#define PREFIX_VEX_EF          (PREFIX_VEX_EE + 1)
+#define PREFIX_VEX_F0          (PREFIX_VEX_EF + 1)
+#define PREFIX_VEX_F1          (PREFIX_VEX_F0 + 1)
+#define PREFIX_VEX_F2          (PREFIX_VEX_F1 + 1)
+#define PREFIX_VEX_F3          (PREFIX_VEX_F2 + 1)
+#define PREFIX_VEX_F4          (PREFIX_VEX_F3 + 1)
+#define PREFIX_VEX_F5          (PREFIX_VEX_F4 + 1)
+#define PREFIX_VEX_F6          (PREFIX_VEX_F5 + 1)
+#define PREFIX_VEX_F7          (PREFIX_VEX_F6 + 1)
+#define PREFIX_VEX_F8          (PREFIX_VEX_F7 + 1)
+#define PREFIX_VEX_F9          (PREFIX_VEX_F8 + 1)
+#define PREFIX_VEX_FA          (PREFIX_VEX_F9 + 1)
+#define PREFIX_VEX_FB          (PREFIX_VEX_FA + 1)
+#define PREFIX_VEX_FC          (PREFIX_VEX_FB + 1)
+#define PREFIX_VEX_FD          (PREFIX_VEX_FC + 1)
+#define PREFIX_VEX_FE          (PREFIX_VEX_FD + 1)
+#define PREFIX_VEX_3800                (PREFIX_VEX_FE + 1)
+#define PREFIX_VEX_3801                (PREFIX_VEX_3800 + 1)
+#define PREFIX_VEX_3802                (PREFIX_VEX_3801 + 1)
+#define PREFIX_VEX_3803                (PREFIX_VEX_3802 + 1)
+#define PREFIX_VEX_3804                (PREFIX_VEX_3803 + 1)
+#define PREFIX_VEX_3805                (PREFIX_VEX_3804 + 1)
+#define PREFIX_VEX_3806                (PREFIX_VEX_3805 + 1)
+#define PREFIX_VEX_3807                (PREFIX_VEX_3806 + 1)
+#define PREFIX_VEX_3808                (PREFIX_VEX_3807 + 1)
+#define PREFIX_VEX_3809                (PREFIX_VEX_3808 + 1)
+#define PREFIX_VEX_380A                (PREFIX_VEX_3809 + 1)
+#define PREFIX_VEX_380B                (PREFIX_VEX_380A + 1)
+#define PREFIX_VEX_380C                (PREFIX_VEX_380B + 1)
+#define PREFIX_VEX_380D                (PREFIX_VEX_380C + 1)
+#define PREFIX_VEX_380E                (PREFIX_VEX_380D + 1)
+#define PREFIX_VEX_380F                (PREFIX_VEX_380E + 1)
+#define PREFIX_VEX_3817                (PREFIX_VEX_380F + 1)
+#define PREFIX_VEX_3818                (PREFIX_VEX_3817 + 1)
+#define PREFIX_VEX_3819                (PREFIX_VEX_3818 + 1)
+#define PREFIX_VEX_381A                (PREFIX_VEX_3819 + 1)
+#define PREFIX_VEX_381C                (PREFIX_VEX_381A + 1)
+#define PREFIX_VEX_381D                (PREFIX_VEX_381C + 1)
+#define PREFIX_VEX_381E                (PREFIX_VEX_381D + 1)
+#define PREFIX_VEX_3820                (PREFIX_VEX_381E + 1)
+#define PREFIX_VEX_3821                (PREFIX_VEX_3820 + 1)
+#define PREFIX_VEX_3822                (PREFIX_VEX_3821 + 1)
+#define PREFIX_VEX_3823                (PREFIX_VEX_3822 + 1)
+#define PREFIX_VEX_3824                (PREFIX_VEX_3823 + 1)
+#define PREFIX_VEX_3825                (PREFIX_VEX_3824 + 1)
+#define PREFIX_VEX_3828                (PREFIX_VEX_3825 + 1)
+#define PREFIX_VEX_3829                (PREFIX_VEX_3828 + 1)
+#define PREFIX_VEX_382A                (PREFIX_VEX_3829 + 1)
+#define PREFIX_VEX_382B                (PREFIX_VEX_382A + 1)
+#define PREFIX_VEX_382C                (PREFIX_VEX_382B + 1)
+#define PREFIX_VEX_382D                (PREFIX_VEX_382C + 1)
+#define PREFIX_VEX_382E                (PREFIX_VEX_382D + 1)
+#define PREFIX_VEX_382F                (PREFIX_VEX_382E + 1)
+#define PREFIX_VEX_3830                (PREFIX_VEX_382F + 1)
+#define PREFIX_VEX_3831                (PREFIX_VEX_3830 + 1)
+#define PREFIX_VEX_3832                (PREFIX_VEX_3831 + 1)
+#define PREFIX_VEX_3833                (PREFIX_VEX_3832 + 1)
+#define PREFIX_VEX_3834                (PREFIX_VEX_3833 + 1)
+#define PREFIX_VEX_3835                (PREFIX_VEX_3834 + 1)
+#define PREFIX_VEX_3837                (PREFIX_VEX_3835 + 1)
+#define PREFIX_VEX_3838                (PREFIX_VEX_3837 + 1)
+#define PREFIX_VEX_3839                (PREFIX_VEX_3838 + 1)
+#define PREFIX_VEX_383A                (PREFIX_VEX_3839 + 1)
+#define PREFIX_VEX_383B                (PREFIX_VEX_383A + 1)
+#define PREFIX_VEX_383C                (PREFIX_VEX_383B + 1)
+#define PREFIX_VEX_383D                (PREFIX_VEX_383C + 1)
+#define PREFIX_VEX_383E                (PREFIX_VEX_383D + 1)
+#define PREFIX_VEX_383F                (PREFIX_VEX_383E + 1)
+#define PREFIX_VEX_3840                (PREFIX_VEX_383F + 1)
+#define PREFIX_VEX_3841                (PREFIX_VEX_3840 + 1)
+#define PREFIX_VEX_3896                (PREFIX_VEX_3841 + 1)
+#define PREFIX_VEX_3897                (PREFIX_VEX_3896 + 1)
+#define PREFIX_VEX_3898                (PREFIX_VEX_3897 + 1)
+#define PREFIX_VEX_3899                (PREFIX_VEX_3898 + 1)
+#define PREFIX_VEX_389A                (PREFIX_VEX_3899 + 1)
+#define PREFIX_VEX_389B                (PREFIX_VEX_389A + 1)
+#define PREFIX_VEX_389C                (PREFIX_VEX_389B + 1)
+#define PREFIX_VEX_389D                (PREFIX_VEX_389C + 1)
+#define PREFIX_VEX_389E                (PREFIX_VEX_389D + 1)
+#define PREFIX_VEX_389F                (PREFIX_VEX_389E + 1)
+#define PREFIX_VEX_38A6                (PREFIX_VEX_389F + 1)
+#define PREFIX_VEX_38A7                (PREFIX_VEX_38A6 + 1)
+#define PREFIX_VEX_38A8                (PREFIX_VEX_38A7 + 1)
+#define PREFIX_VEX_38A9                (PREFIX_VEX_38A8 + 1)
+#define PREFIX_VEX_38AA                (PREFIX_VEX_38A9 + 1)
+#define PREFIX_VEX_38AB                (PREFIX_VEX_38AA + 1)
+#define PREFIX_VEX_38AC                (PREFIX_VEX_38AB + 1)
+#define PREFIX_VEX_38AD                (PREFIX_VEX_38AC + 1)
+#define PREFIX_VEX_38AE                (PREFIX_VEX_38AD + 1)
+#define PREFIX_VEX_38AF                (PREFIX_VEX_38AE + 1)
+#define PREFIX_VEX_38B6                (PREFIX_VEX_38AF + 1)
+#define PREFIX_VEX_38B7                (PREFIX_VEX_38B6 + 1)
+#define PREFIX_VEX_38B8                (PREFIX_VEX_38B7 + 1)
+#define PREFIX_VEX_38B9                (PREFIX_VEX_38B8 + 1)
+#define PREFIX_VEX_38BA                (PREFIX_VEX_38B9 + 1)
+#define PREFIX_VEX_38BB                (PREFIX_VEX_38BA + 1)
+#define PREFIX_VEX_38BC                (PREFIX_VEX_38BB + 1)
+#define PREFIX_VEX_38BD                (PREFIX_VEX_38BC + 1)
+#define PREFIX_VEX_38BE                (PREFIX_VEX_38BD + 1)
+#define PREFIX_VEX_38BF                (PREFIX_VEX_38BE + 1)
+#define PREFIX_VEX_38DB                (PREFIX_VEX_38BF + 1)
+#define PREFIX_VEX_38DC                (PREFIX_VEX_38DB + 1)
+#define PREFIX_VEX_38DD                (PREFIX_VEX_38DC + 1)
+#define PREFIX_VEX_38DE                (PREFIX_VEX_38DD + 1)
+#define PREFIX_VEX_38DF                (PREFIX_VEX_38DE + 1)
+#define PREFIX_VEX_3A04                (PREFIX_VEX_38DF + 1)
+#define PREFIX_VEX_3A05                (PREFIX_VEX_3A04 + 1)
+#define PREFIX_VEX_3A06                (PREFIX_VEX_3A05 + 1)
+#define PREFIX_VEX_3A08                (PREFIX_VEX_3A06 + 1)
+#define PREFIX_VEX_3A09                (PREFIX_VEX_3A08 + 1)
+#define PREFIX_VEX_3A0A                (PREFIX_VEX_3A09 + 1)
+#define PREFIX_VEX_3A0B                (PREFIX_VEX_3A0A + 1)
+#define PREFIX_VEX_3A0C                (PREFIX_VEX_3A0B + 1)
+#define PREFIX_VEX_3A0D                (PREFIX_VEX_3A0C + 1)
+#define PREFIX_VEX_3A0E                (PREFIX_VEX_3A0D + 1)
+#define PREFIX_VEX_3A0F                (PREFIX_VEX_3A0E + 1)
+#define PREFIX_VEX_3A14                (PREFIX_VEX_3A0F + 1)
+#define PREFIX_VEX_3A15                (PREFIX_VEX_3A14 + 1)
+#define PREFIX_VEX_3A16                (PREFIX_VEX_3A15 + 1)
+#define PREFIX_VEX_3A17                (PREFIX_VEX_3A16 + 1)
+#define PREFIX_VEX_3A18                (PREFIX_VEX_3A17 + 1)
+#define PREFIX_VEX_3A19                (PREFIX_VEX_3A18 + 1)
+#define PREFIX_VEX_3A20                (PREFIX_VEX_3A19 + 1)
+#define PREFIX_VEX_3A21                (PREFIX_VEX_3A20 + 1)
+#define PREFIX_VEX_3A22                (PREFIX_VEX_3A21 + 1)
+#define PREFIX_VEX_3A40                (PREFIX_VEX_3A22 + 1)
+#define PREFIX_VEX_3A41                (PREFIX_VEX_3A40 + 1)
+#define PREFIX_VEX_3A42                (PREFIX_VEX_3A41 + 1)
+#define PREFIX_VEX_3A44                (PREFIX_VEX_3A42 + 1)
+#define PREFIX_VEX_3A4A                (PREFIX_VEX_3A44 + 1)
+#define PREFIX_VEX_3A4B                (PREFIX_VEX_3A4A + 1)
+#define PREFIX_VEX_3A4C                (PREFIX_VEX_3A4B + 1)
+#define PREFIX_VEX_3A60                (PREFIX_VEX_3A4C + 1)
+#define PREFIX_VEX_3A61                (PREFIX_VEX_3A60 + 1)
+#define PREFIX_VEX_3A62                (PREFIX_VEX_3A61 + 1)
+#define PREFIX_VEX_3A63                (PREFIX_VEX_3A62 + 1)
+#define PREFIX_VEX_3ADF                (PREFIX_VEX_3A63 + 1)
 
 #define X86_64_06              0
 #define X86_64_07              (X86_64_06 + 1)
@@ -695,6 +1049,205 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define THREE_BYTE_0F7A                (THREE_BYTE_0F3A + 1)
 #define THREE_BYTE_0F7B                (THREE_BYTE_0F7A + 1)
 
+#define VEX_0F                 0
+#define VEX_0F38               (VEX_0F + 1)
+#define VEX_0F3A               (VEX_0F38 + 1)
+
+#define VEX_LEN_10_P_1 0
+#define VEX_LEN_10_P_3 (VEX_LEN_10_P_1 + 1)
+#define VEX_LEN_11_P_1 (VEX_LEN_10_P_3 + 1)
+#define VEX_LEN_11_P_3 (VEX_LEN_11_P_1 + 1)
+#define VEX_LEN_12_P_0_M_0     (VEX_LEN_11_P_3 + 1)
+#define VEX_LEN_12_P_0_M_1     (VEX_LEN_12_P_0_M_0 + 1)
+#define VEX_LEN_12_P_2 (VEX_LEN_12_P_0_M_1 + 1)
+#define VEX_LEN_13_M_0 (VEX_LEN_12_P_2 + 1)
+#define VEX_LEN_16_P_0_M_0     (VEX_LEN_13_M_0 + 1)
+#define VEX_LEN_16_P_0_M_1     (VEX_LEN_16_P_0_M_0 + 1)
+#define VEX_LEN_16_P_2 (VEX_LEN_16_P_0_M_1 + 1)
+#define VEX_LEN_17_M_0 (VEX_LEN_16_P_2 + 1)
+#define VEX_LEN_2A_P_1 (VEX_LEN_17_M_0 + 1)
+#define VEX_LEN_2A_P_3 (VEX_LEN_2A_P_1 + 1)
+#define VEX_LEN_2C_P_1 (VEX_LEN_2A_P_3 + 1)
+#define VEX_LEN_2C_P_3 (VEX_LEN_2C_P_1 + 1)
+#define VEX_LEN_2D_P_1 (VEX_LEN_2C_P_3 + 1)
+#define VEX_LEN_2D_P_3 (VEX_LEN_2D_P_1 + 1)
+#define VEX_LEN_2E_P_0 (VEX_LEN_2D_P_3 + 1)
+#define VEX_LEN_2E_P_2 (VEX_LEN_2E_P_0 + 1)
+#define VEX_LEN_2F_P_0 (VEX_LEN_2E_P_2 + 1)
+#define VEX_LEN_2F_P_2 (VEX_LEN_2F_P_0 + 1)
+#define VEX_LEN_51_P_1 (VEX_LEN_2F_P_2 + 1)
+#define VEX_LEN_51_P_3 (VEX_LEN_51_P_1 + 1)
+#define VEX_LEN_52_P_1 (VEX_LEN_51_P_3 + 1)
+#define VEX_LEN_53_P_1 (VEX_LEN_52_P_1 + 1)
+#define VEX_LEN_58_P_1 (VEX_LEN_53_P_1 + 1)
+#define VEX_LEN_58_P_3 (VEX_LEN_58_P_1 + 1)
+#define VEX_LEN_59_P_1 (VEX_LEN_58_P_3 + 1)
+#define VEX_LEN_59_P_3 (VEX_LEN_59_P_1 + 1)
+#define VEX_LEN_5A_P_1 (VEX_LEN_59_P_3 + 1)
+#define VEX_LEN_5A_P_3 (VEX_LEN_5A_P_1 + 1)
+#define VEX_LEN_5C_P_1 (VEX_LEN_5A_P_3 + 1)
+#define VEX_LEN_5C_P_3 (VEX_LEN_5C_P_1 + 1)
+#define VEX_LEN_5D_P_1 (VEX_LEN_5C_P_3 + 1)
+#define VEX_LEN_5D_P_3 (VEX_LEN_5D_P_1 + 1)
+#define VEX_LEN_5E_P_1 (VEX_LEN_5D_P_3 + 1)
+#define VEX_LEN_5E_P_3 (VEX_LEN_5E_P_1 + 1)
+#define VEX_LEN_5F_P_1 (VEX_LEN_5E_P_3 + 1)
+#define VEX_LEN_5F_P_3 (VEX_LEN_5F_P_1 + 1)
+#define VEX_LEN_60_P_2 (VEX_LEN_5F_P_3 + 1)
+#define VEX_LEN_61_P_2 (VEX_LEN_60_P_2 + 1)
+#define VEX_LEN_62_P_2 (VEX_LEN_61_P_2 + 1)
+#define VEX_LEN_63_P_2 (VEX_LEN_62_P_2 + 1)
+#define VEX_LEN_64_P_2 (VEX_LEN_63_P_2 + 1)
+#define VEX_LEN_65_P_2 (VEX_LEN_64_P_2 + 1)
+#define VEX_LEN_66_P_2 (VEX_LEN_65_P_2 + 1)
+#define VEX_LEN_67_P_2 (VEX_LEN_66_P_2 + 1)
+#define VEX_LEN_68_P_2 (VEX_LEN_67_P_2 + 1)
+#define VEX_LEN_69_P_2 (VEX_LEN_68_P_2 + 1)
+#define VEX_LEN_6A_P_2 (VEX_LEN_69_P_2 + 1)
+#define VEX_LEN_6B_P_2 (VEX_LEN_6A_P_2 + 1)
+#define VEX_LEN_6C_P_2 (VEX_LEN_6B_P_2 + 1)
+#define VEX_LEN_6D_P_2 (VEX_LEN_6C_P_2 + 1)
+#define VEX_LEN_6E_P_2 (VEX_LEN_6D_P_2 + 1)
+#define VEX_LEN_70_P_1 (VEX_LEN_6E_P_2 + 1)
+#define VEX_LEN_70_P_2 (VEX_LEN_70_P_1 + 1)
+#define VEX_LEN_70_P_3 (VEX_LEN_70_P_2 + 1)
+#define VEX_LEN_71_R_2_P_2     (VEX_LEN_70_P_3 + 1)
+#define VEX_LEN_71_R_4_P_2     (VEX_LEN_71_R_2_P_2 + 1)
+#define VEX_LEN_71_R_6_P_2     (VEX_LEN_71_R_4_P_2 + 1)
+#define VEX_LEN_72_R_2_P_2     (VEX_LEN_71_R_6_P_2 + 1)
+#define VEX_LEN_72_R_4_P_2     (VEX_LEN_72_R_2_P_2 + 1)
+#define VEX_LEN_72_R_6_P_2     (VEX_LEN_72_R_4_P_2 + 1)
+#define VEX_LEN_73_R_2_P_2     (VEX_LEN_72_R_6_P_2 + 1)
+#define VEX_LEN_73_R_3_P_2     (VEX_LEN_73_R_2_P_2 + 1)
+#define VEX_LEN_73_R_6_P_2     (VEX_LEN_73_R_3_P_2 + 1)
+#define VEX_LEN_73_R_7_P_2     (VEX_LEN_73_R_6_P_2 + 1)
+#define VEX_LEN_74_P_2 (VEX_LEN_73_R_7_P_2 + 1)
+#define VEX_LEN_75_P_2 (VEX_LEN_74_P_2 + 1)
+#define VEX_LEN_76_P_2 (VEX_LEN_75_P_2 + 1)
+#define VEX_LEN_7E_P_1 (VEX_LEN_76_P_2 + 1)
+#define VEX_LEN_7E_P_2 (VEX_LEN_7E_P_1 + 1)
+#define VEX_LEN_AE_R_2_M_0     (VEX_LEN_7E_P_2 + 1)
+#define VEX_LEN_AE_R_3_M_0     (VEX_LEN_AE_R_2_M_0 + 1)
+#define VEX_LEN_C2_P_1 (VEX_LEN_AE_R_3_M_0 + 1)
+#define VEX_LEN_C2_P_3 (VEX_LEN_C2_P_1 + 1)
+#define VEX_LEN_C4_P_2 (VEX_LEN_C2_P_3 + 1)
+#define VEX_LEN_C5_P_2 (VEX_LEN_C4_P_2 + 1)
+#define VEX_LEN_D1_P_2 (VEX_LEN_C5_P_2 + 1)
+#define VEX_LEN_D2_P_2 (VEX_LEN_D1_P_2 + 1)
+#define VEX_LEN_D3_P_2 (VEX_LEN_D2_P_2 + 1)
+#define VEX_LEN_D4_P_2 (VEX_LEN_D3_P_2 + 1)
+#define VEX_LEN_D5_P_2 (VEX_LEN_D4_P_2 + 1)
+#define VEX_LEN_D6_P_2 (VEX_LEN_D5_P_2 + 1)
+#define VEX_LEN_D7_P_2_M_1     (VEX_LEN_D6_P_2 + 1)
+#define VEX_LEN_D8_P_2 (VEX_LEN_D7_P_2_M_1 + 1)
+#define VEX_LEN_D9_P_2 (VEX_LEN_D8_P_2 + 1)
+#define VEX_LEN_DA_P_2 (VEX_LEN_D9_P_2 + 1)
+#define VEX_LEN_DB_P_2 (VEX_LEN_DA_P_2 + 1)
+#define VEX_LEN_DC_P_2 (VEX_LEN_DB_P_2 + 1)
+#define VEX_LEN_DD_P_2 (VEX_LEN_DC_P_2 + 1)
+#define VEX_LEN_DE_P_2 (VEX_LEN_DD_P_2 + 1)
+#define VEX_LEN_DF_P_2 (VEX_LEN_DE_P_2 + 1)
+#define VEX_LEN_E0_P_2 (VEX_LEN_DF_P_2 + 1)
+#define VEX_LEN_E1_P_2 (VEX_LEN_E0_P_2 + 1)
+#define VEX_LEN_E2_P_2 (VEX_LEN_E1_P_2 + 1)
+#define VEX_LEN_E3_P_2 (VEX_LEN_E2_P_2 + 1)
+#define VEX_LEN_E4_P_2 (VEX_LEN_E3_P_2 + 1)
+#define VEX_LEN_E5_P_2 (VEX_LEN_E4_P_2 + 1)
+#define VEX_LEN_E8_P_2 (VEX_LEN_E5_P_2 + 1)
+#define VEX_LEN_E9_P_2 (VEX_LEN_E8_P_2 + 1)
+#define VEX_LEN_EA_P_2 (VEX_LEN_E9_P_2 + 1)
+#define VEX_LEN_EB_P_2 (VEX_LEN_EA_P_2 + 1)
+#define VEX_LEN_EC_P_2 (VEX_LEN_EB_P_2 + 1)
+#define VEX_LEN_ED_P_2 (VEX_LEN_EC_P_2 + 1)
+#define VEX_LEN_EE_P_2 (VEX_LEN_ED_P_2 + 1)
+#define VEX_LEN_EF_P_2 (VEX_LEN_EE_P_2 + 1)
+#define VEX_LEN_F1_P_2 (VEX_LEN_EF_P_2 + 1)
+#define VEX_LEN_F2_P_2 (VEX_LEN_F1_P_2 + 1)
+#define VEX_LEN_F3_P_2 (VEX_LEN_F2_P_2 + 1)
+#define VEX_LEN_F4_P_2 (VEX_LEN_F3_P_2 + 1)
+#define VEX_LEN_F5_P_2 (VEX_LEN_F4_P_2 + 1)
+#define VEX_LEN_F6_P_2 (VEX_LEN_F5_P_2 + 1)
+#define VEX_LEN_F7_P_2 (VEX_LEN_F6_P_2 + 1)
+#define VEX_LEN_F8_P_2 (VEX_LEN_F7_P_2 + 1)
+#define VEX_LEN_F9_P_2 (VEX_LEN_F8_P_2 + 1)
+#define VEX_LEN_FA_P_2 (VEX_LEN_F9_P_2 + 1)
+#define VEX_LEN_FB_P_2 (VEX_LEN_FA_P_2 + 1)
+#define VEX_LEN_FC_P_2 (VEX_LEN_FB_P_2 + 1)
+#define VEX_LEN_FD_P_2 (VEX_LEN_FC_P_2 + 1)
+#define VEX_LEN_FE_P_2 (VEX_LEN_FD_P_2 + 1)
+#define VEX_LEN_3800_P_2       (VEX_LEN_FE_P_2 + 1)
+#define VEX_LEN_3801_P_2       (VEX_LEN_3800_P_2 + 1)
+#define VEX_LEN_3802_P_2       (VEX_LEN_3801_P_2 + 1)
+#define VEX_LEN_3803_P_2       (VEX_LEN_3802_P_2 + 1)
+#define VEX_LEN_3804_P_2       (VEX_LEN_3803_P_2 + 1)
+#define VEX_LEN_3805_P_2       (VEX_LEN_3804_P_2 + 1)
+#define VEX_LEN_3806_P_2       (VEX_LEN_3805_P_2 + 1)
+#define VEX_LEN_3807_P_2       (VEX_LEN_3806_P_2 + 1)
+#define VEX_LEN_3808_P_2       (VEX_LEN_3807_P_2 + 1)
+#define VEX_LEN_3809_P_2       (VEX_LEN_3808_P_2 + 1)
+#define VEX_LEN_380A_P_2       (VEX_LEN_3809_P_2 + 1)
+#define VEX_LEN_380B_P_2       (VEX_LEN_380A_P_2 + 1)
+#define VEX_LEN_3819_P_2_M_0   (VEX_LEN_380B_P_2 + 1)
+#define VEX_LEN_381A_P_2_M_0   (VEX_LEN_3819_P_2_M_0 + 1)
+#define VEX_LEN_381C_P_2       (VEX_LEN_381A_P_2_M_0 + 1)
+#define VEX_LEN_381D_P_2       (VEX_LEN_381C_P_2 + 1)
+#define VEX_LEN_381E_P_2       (VEX_LEN_381D_P_2 + 1)
+#define VEX_LEN_3820_P_2       (VEX_LEN_381E_P_2 + 1)
+#define VEX_LEN_3821_P_2       (VEX_LEN_3820_P_2 + 1)
+#define VEX_LEN_3822_P_2       (VEX_LEN_3821_P_2 + 1)
+#define VEX_LEN_3823_P_2       (VEX_LEN_3822_P_2 + 1)
+#define VEX_LEN_3824_P_2       (VEX_LEN_3823_P_2 + 1)
+#define VEX_LEN_3825_P_2       (VEX_LEN_3824_P_2 + 1)
+#define VEX_LEN_3828_P_2       (VEX_LEN_3825_P_2 + 1)
+#define VEX_LEN_3829_P_2       (VEX_LEN_3828_P_2 + 1)
+#define VEX_LEN_382A_P_2_M_0   (VEX_LEN_3829_P_2 + 1)
+#define VEX_LEN_382B_P_2       (VEX_LEN_382A_P_2_M_0 + 1)
+#define VEX_LEN_3830_P_2       (VEX_LEN_382B_P_2 + 1)
+#define VEX_LEN_3831_P_2       (VEX_LEN_3830_P_2 + 1)
+#define VEX_LEN_3832_P_2       (VEX_LEN_3831_P_2 + 1)
+#define VEX_LEN_3833_P_2       (VEX_LEN_3832_P_2 + 1)
+#define VEX_LEN_3834_P_2       (VEX_LEN_3833_P_2 + 1)
+#define VEX_LEN_3835_P_2       (VEX_LEN_3834_P_2 + 1)
+#define VEX_LEN_3837_P_2       (VEX_LEN_3835_P_2 + 1)
+#define VEX_LEN_3838_P_2       (VEX_LEN_3837_P_2 + 1)
+#define VEX_LEN_3839_P_2       (VEX_LEN_3838_P_2 + 1)
+#define VEX_LEN_383A_P_2       (VEX_LEN_3839_P_2 + 1)
+#define VEX_LEN_383B_P_2       (VEX_LEN_383A_P_2 + 1)
+#define VEX_LEN_383C_P_2       (VEX_LEN_383B_P_2 + 1)
+#define VEX_LEN_383D_P_2       (VEX_LEN_383C_P_2 + 1)
+#define VEX_LEN_383E_P_2       (VEX_LEN_383D_P_2 + 1)
+#define VEX_LEN_383F_P_2       (VEX_LEN_383E_P_2 + 1)
+#define VEX_LEN_3840_P_2       (VEX_LEN_383F_P_2 + 1)
+#define VEX_LEN_3841_P_2       (VEX_LEN_3840_P_2 + 1)
+#define VEX_LEN_38DB_P_2       (VEX_LEN_3841_P_2 + 1)
+#define VEX_LEN_38DC_P_2       (VEX_LEN_38DB_P_2 + 1)
+#define VEX_LEN_38DD_P_2       (VEX_LEN_38DC_P_2 + 1)
+#define VEX_LEN_38DE_P_2       (VEX_LEN_38DD_P_2 + 1)
+#define VEX_LEN_38DF_P_2       (VEX_LEN_38DE_P_2 + 1)
+#define VEX_LEN_3A06_P_2       (VEX_LEN_38DF_P_2 + 1)
+#define VEX_LEN_3A0A_P_2       (VEX_LEN_3A06_P_2 + 1)
+#define VEX_LEN_3A0B_P_2       (VEX_LEN_3A0A_P_2 + 1)
+#define VEX_LEN_3A0E_P_2       (VEX_LEN_3A0B_P_2 + 1)
+#define VEX_LEN_3A0F_P_2       (VEX_LEN_3A0E_P_2 + 1)
+#define VEX_LEN_3A14_P_2       (VEX_LEN_3A0F_P_2 + 1)
+#define VEX_LEN_3A15_P_2       (VEX_LEN_3A14_P_2 + 1)
+#define VEX_LEN_3A16_P_2       (VEX_LEN_3A15_P_2 + 1)
+#define VEX_LEN_3A17_P_2       (VEX_LEN_3A16_P_2 + 1)
+#define VEX_LEN_3A18_P_2       (VEX_LEN_3A17_P_2 + 1)
+#define VEX_LEN_3A19_P_2       (VEX_LEN_3A18_P_2 + 1)
+#define VEX_LEN_3A20_P_2       (VEX_LEN_3A19_P_2 + 1)
+#define VEX_LEN_3A21_P_2       (VEX_LEN_3A20_P_2 + 1)
+#define VEX_LEN_3A22_P_2       (VEX_LEN_3A21_P_2 + 1)
+#define VEX_LEN_3A41_P_2       (VEX_LEN_3A22_P_2 + 1)
+#define VEX_LEN_3A42_P_2       (VEX_LEN_3A41_P_2 + 1)
+#define VEX_LEN_3A44_P_2       (VEX_LEN_3A42_P_2 + 1)
+#define VEX_LEN_3A4C_P_2       (VEX_LEN_3A44_P_2 + 1)
+#define VEX_LEN_3A60_P_2       (VEX_LEN_3A4C_P_2 + 1)
+#define VEX_LEN_3A61_P_2       (VEX_LEN_3A60_P_2 + 1)
+#define VEX_LEN_3A62_P_2       (VEX_LEN_3A61_P_2 + 1)
+#define VEX_LEN_3A63_P_2       (VEX_LEN_3A62_P_2 + 1)
+#define VEX_LEN_3ADF_P_2       (VEX_LEN_3A63_P_2 + 1)
+
 typedef void (*op_rtn) (int bytemode, int sizeflag);
 
 struct dis386 {
@@ -710,24 +1263,25 @@ struct dis386 {
    'A' => print 'b' if no register operands or suffix_always is true
    'B' => print 'b' if suffix_always is true
    'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
-   .      size prefix
+         size prefix
    'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
-   .      suffix_always is true
+         suffix_always is true
    'E' => print 'e' if 32-bit form of jcxz
    'F' => print 'w' or 'l' depending on address size prefix (loop insns)
    'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
    'H' => print ",pt" or ",pn" branch hint
    'I' => honor following macro letter even in Intel mode (implemented only
-   .      for some of the macro letters)
+         for some of the macro letters)
    'J' => print 'l'
    'K' => print 'd' or 'q' if rex prefix is present.
    'L' => print 'l' if suffix_always is true
+   'M' => print 'r' if intel_mnemonic is false.
    'N' => print 'n' if instruction has no wait "prefix"
    'O' => print 'd' or 'o' (or 'q' in Intel mode)
    'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
-   .      or suffix_always is true.  print 'q' if rex prefix is present.
-   'Q' => print 'w', 'l' or 'q' if no register operands or suffix_always
-   .      is true
+         or suffix_always is true.  print 'q' if rex prefix is present.
+   'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
+         is true
    'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
    'S' => print 'w', 'l' or 'q' if suffix_always is true
    'T' => print 'q' in 64bit mode and behave as 'P' otherwise
@@ -738,6 +1292,15 @@ struct dis386 {
    'Y' => 'q' if instruction has an REX 64bit overwrite prefix and
          suffix_always is true.
    'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
+   '!' => change condition from true to false or from false to true.
+   '%' => add 1 upper case letter to the macro.
+
+   2 upper case letter macros:
+   "XY" => print 'x' or 'y' if no register operands or suffix_always
+          is true.
+   'XW' => print 's', 'd' depending on the VEX.W bit (for FMA)
+   'LQ' => print 'l' ('d' in Intel mode) or 'q' for memory operand
+          or suffix_always is true
 
    Many of the above letters print nothing in Intel mode.  See "putop"
    for the details.
@@ -749,8 +1312,8 @@ static const struct dis386 dis386[] = {
   /* 00 */
   { "addB",            { Eb, Gb } },
   { "addS",            { Ev, Gv } },
-  { "addB",            { Gb, Eb } },
-  { "addS",            { Gv, Ev } },
+  { "addB",            { Gb, EbS } },
+  { "addS",            { Gv, EvS } },
   { "addB",            { AL, Ib } },
   { "addS",            { eAX, Iv } },
   { X86_64_TABLE (X86_64_06) },
@@ -758,8 +1321,8 @@ static const struct dis386 dis386[] = {
   /* 08 */
   { "orB",             { Eb, Gb } },
   { "orS",             { Ev, Gv } },
-  { "orB",             { Gb, Eb } },
-  { "orS",             { Gv, Ev } },
+  { "orB",             { Gb, EbS } },
+  { "orS",             { Gv, EvS } },
   { "orB",             { AL, Ib } },
   { "orS",             { eAX, Iv } },
   { X86_64_TABLE (X86_64_0D) },
@@ -767,8 +1330,8 @@ static const struct dis386 dis386[] = {
   /* 10 */
   { "adcB",            { Eb, Gb } },
   { "adcS",            { Ev, Gv } },
-  { "adcB",            { Gb, Eb } },
-  { "adcS",            { Gv, Ev } },
+  { "adcB",            { Gb, EbS } },
+  { "adcS",            { Gv, EvS } },
   { "adcB",            { AL, Ib } },
   { "adcS",            { eAX, Iv } },
   { X86_64_TABLE (X86_64_16) },
@@ -776,8 +1339,8 @@ static const struct dis386 dis386[] = {
   /* 18 */
   { "sbbB",            { Eb, Gb } },
   { "sbbS",            { Ev, Gv } },
-  { "sbbB",            { Gb, Eb } },
-  { "sbbS",            { Gv, Ev } },
+  { "sbbB",            { Gb, EbS } },
+  { "sbbS",            { Gv, EvS } },
   { "sbbB",            { AL, Ib } },
   { "sbbS",            { eAX, Iv } },
   { X86_64_TABLE (X86_64_1E) },
@@ -785,8 +1348,8 @@ static const struct dis386 dis386[] = {
   /* 20 */
   { "andB",            { Eb, Gb } },
   { "andS",            { Ev, Gv } },
-  { "andB",            { Gb, Eb } },
-  { "andS",            { Gv, Ev } },
+  { "andB",            { Gb, EbS } },
+  { "andS",            { Gv, EvS } },
   { "andB",            { AL, Ib } },
   { "andS",            { eAX, Iv } },
   { "(bad)",           { XX } },       /* SEG ES prefix */
@@ -794,8 +1357,8 @@ static const struct dis386 dis386[] = {
   /* 28 */
   { "subB",            { Eb, Gb } },
   { "subS",            { Ev, Gv } },
-  { "subB",            { Gb, Eb } },
-  { "subS",            { Gv, Ev } },
+  { "subB",            { Gb, EbS } },
+  { "subS",            { Gv, EvS } },
   { "subB",            { AL, Ib } },
   { "subS",            { eAX, Iv } },
   { "(bad)",           { XX } },       /* SEG CS prefix */
@@ -803,8 +1366,8 @@ static const struct dis386 dis386[] = {
   /* 30 */
   { "xorB",            { Eb, Gb } },
   { "xorS",            { Ev, Gv } },
-  { "xorB",            { Gb, Eb } },
-  { "xorS",            { Gv, Ev } },
+  { "xorB",            { Gb, EbS } },
+  { "xorS",            { Gv, EvS } },
   { "xorB",            { AL, Ib } },
   { "xorS",            { eAX, Iv } },
   { "(bad)",           { XX } },       /* SEG SS prefix */
@@ -812,8 +1375,8 @@ static const struct dis386 dis386[] = {
   /* 38 */
   { "cmpB",            { Eb, Gb } },
   { "cmpS",            { Ev, Gv } },
-  { "cmpB",            { Gb, Eb } },
-  { "cmpS",            { Gv, Ev } },
+  { "cmpB",            { Gb, EbS } },
+  { "cmpS",            { Gv, EvS } },
   { "cmpB",            { AL, Ib } },
   { "cmpS",            { eAX, Iv } },
   { "(bad)",           { XX } },       /* SEG DS prefix */
@@ -902,8 +1465,8 @@ static const struct dis386 dis386[] = {
   /* 88 */
   { "movB",            { Eb, Gb } },
   { "movS",            { Ev, Gv } },
-  { "movB",            { Gb, Eb } },
-  { "movS",            { Gv, Ev } },
+  { "movB",            { Gb, EbS } },
+  { "movS",            { Gv, EvS } },
   { "movD",            { Sv, Sw } },
   { MOD_TABLE (MOD_8D) },
   { "movD",            { Sw, Sv } },
@@ -974,8 +1537,8 @@ static const struct dis386 dis386[] = {
   /* c8 */
   { "enterT",          { Iw, Ib } },
   { "leaveT",          { XX } },
-  { "lretP",           { Iw } },
-  { "lretP",           { XX } },
+  { "Jret{|f}P",       { Iw } },
+  { "Jret{|f}P",       { XX } },
   { "int3",            { XX } },
   { "int",             { Ib } },
   { X86_64_TABLE (X86_64_CE) },
@@ -1052,7 +1615,7 @@ static const struct dis386 dis386_twobyte[] = {
   { "(bad)",           { XX } },
   { "ud2a",            { XX } },
   { "(bad)",           { XX } },
-  { REG_TABLE (REG_0F0E) },
+  { REG_TABLE (REG_0F0D) },
   { "femms",           { XX } },
   { "",                        { MX, EM, OPSUF } }, /* See OP_3DNowSuffix.  */
   /* 10 */
@@ -1066,12 +1629,12 @@ static const struct dis386 dis386_twobyte[] = {
   { MOD_TABLE (MOD_0F17) },
   /* 18 */
   { REG_TABLE (REG_0F18) },
-  { "(bad)",           { XX } },
-  { "(bad)",           { XX } },
-  { "(bad)",           { XX } },
-  { "(bad)",           { XX } },
-  { "(bad)",           { XX } },
-  { "(bad)",           { XX } },
+  { "nopQ",            { Ev } },
+  { "nopQ",            { Ev } },
+  { "nopQ",            { Ev } },
+  { "nopQ",            { Ev } },
+  { "nopQ",            { Ev } },
+  { "nopQ",            { Ev } },
   { "nopQ",            { Ev } },
   /* 20 */
   { MOD_TABLE (MOD_0F20) },
@@ -1084,7 +1647,7 @@ static const struct dis386 dis386_twobyte[] = {
   { "(bad)",           { XX } },
   /* 28 */
   { "movapX",          { XM, EXx } },
-  { "movapX",          { EXx XM } },
+  { "movapX",          { EXxS, XM } },
   { PREFIX_TABLE (PREFIX_0F2A) },
   { PREFIX_TABLE (PREFIX_0F2B) },
   { PREFIX_TABLE (PREFIX_0F2C) },
@@ -1110,25 +1673,25 @@ static const struct dis386 dis386_twobyte[] = {
   { "(bad)",           { XX } },
   { "(bad)",           { XX } },
   /* 40 */
-  { "cmovo",           { Gv, Ev } },
-  { "cmovno",          { Gv, Ev } },
-  { "cmovb",           { Gv, Ev } },
-  { "cmovae",          { Gv, Ev } },
-  { "cmove",           { Gv, Ev } },
-  { "cmovne",          { Gv, Ev } },
-  { "cmovbe",          { Gv, Ev } },
-  { "cmova",           { Gv, Ev } },
+  { "cmovoS",          { Gv, Ev } },
+  { "cmovnoS",         { Gv, Ev } },
+  { "cmovbS",          { Gv, Ev } },
+  { "cmovaeS",         { Gv, Ev } },
+  { "cmoveS",          { Gv, Ev } },
+  { "cmovneS",         { Gv, Ev } },
+  { "cmovbeS",         { Gv, Ev } },
+  { "cmovaS",          { Gv, Ev } },
   /* 48 */
-  { "cmovs",           { Gv, Ev } },
-  { "cmovns",          { Gv, Ev } },
-  { "cmovp",           { Gv, Ev } },
-  { "cmovnp",          { Gv, Ev } },
-  { "cmovl",           { Gv, Ev } },
-  { "cmovge",          { Gv, Ev } },
-  { "cmovle",          { Gv, Ev } },
-  { "cmovg",           { Gv, Ev } },
+  { "cmovsS",          { Gv, Ev } },
+  { "cmovnsS",         { Gv, Ev } },
+  { "cmovpS",          { Gv, Ev } },
+  { "cmovnpS",         { Gv, Ev } },
+  { "cmovlS",          { Gv, Ev } },
+  { "cmovgeS",         { Gv, Ev } },
+  { "cmovleS",         { Gv, Ev } },
+  { "cmovgS",          { Gv, Ev } },
   /* 50 */
-  { "movmskpX",                { Gdq, XS } },
+  { MOD_TABLE (MOD_0F51) },
   { PREFIX_TABLE (PREFIX_0F51) },
   { PREFIX_TABLE (PREFIX_0F52) },
   { PREFIX_TABLE (PREFIX_0F53) },
@@ -1257,7 +1820,7 @@ static const struct dis386 dis386_twobyte[] = {
   { "xaddB",           { Eb, Gb } },
   { "xaddS",           { Ev, Gv } },
   { PREFIX_TABLE (PREFIX_0FC2) },
-  { "movntiS",         { Ev, Gv } },
+  { PREFIX_TABLE (PREFIX_0FC3) },
   { "pinsrw",          { MX, Edqw, Ib } },
   { "pextrw",          { Gdq, MS, Ib } },
   { "shufpX",          { XM, EXx, Ib } },
@@ -1279,7 +1842,7 @@ static const struct dis386 dis386_twobyte[] = {
   { "paddq",           { MX, EM } },
   { "pmullw",          { MX, EM } },
   { PREFIX_TABLE (PREFIX_0FD6) },
-  { "pmovmskb",                { Gdq, MS } },
+  { MOD_TABLE (MOD_0FD7) },
   /* d8 */
   { "psubusb",         { MX, EM } },
   { "psubusw",         { MX, EM } },
@@ -1354,7 +1917,7 @@ static const unsigned char twobyte_has_modrm[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
   /*       -------------------------------        */
   /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
-  /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1, /* 1f */
+  /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
   /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
   /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
   /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
@@ -1375,6 +1938,7 @@ static const unsigned char twobyte_has_modrm[256] = {
 
 static char obuf[100];
 static char *obufp;
+static char *mnemonicendp;
 static char scratchbuf[100];
 static unsigned char *start_codep;
 static unsigned char *insn_codep;
@@ -1393,6 +1957,23 @@ static struct
   }
 modrm;
 static unsigned char need_modrm;
+static struct
+  {
+    int register_specifier;
+    int length;
+    int prefix;
+    int w;
+  }
+vex;
+static unsigned char need_vex;
+static unsigned char need_vex_reg;
+static unsigned char vex_w_done;
+
+struct op
+  {
+    const char *name;
+    unsigned int len;
+  };
 
 /* If we are accessing mod/rm/reg without need_modrm set, then the
    values are stale.  Hitting this abort likely indicates that you
@@ -1664,7 +2245,7 @@ static const struct dis386 reg_table[][8] = {
     { "lmsw",  { Ew } },
     { MOD_TABLE (MOD_0F01_REG_7) },
   },
-  /* REG_0F0E */
+  /* REG_0F0D */
   {
     { "prefetch",      { Eb } },
     { "prefetchw",     { Eb } },
@@ -1747,7 +2328,7 @@ static const struct dis386 reg_table[][8] = {
     { MOD_TABLE (MOD_0FAE_REG_1) },
     { MOD_TABLE (MOD_0FAE_REG_2) },
     { MOD_TABLE (MOD_0FAE_REG_3) },
-    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_0FAE_REG_4) },
     { MOD_TABLE (MOD_0FAE_REG_5) },
     { MOD_TABLE (MOD_0FAE_REG_6) },
     { MOD_TABLE (MOD_0FAE_REG_7) },
@@ -1774,6 +2355,50 @@ static const struct dis386 reg_table[][8] = {
     { MOD_TABLE (MOD_0FC7_REG_6) },
     { MOD_TABLE (MOD_0FC7_REG_7) },
   },
+  /* REG_VEX_71 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_71_REG_2) },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_71_REG_4) },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_71_REG_6) },
+    { "(bad)", { XX } },
+  },
+  /* REG_VEX_72 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_72_REG_2) },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_72_REG_4) },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_72_REG_6) },
+    { "(bad)", { XX } },
+  },
+  /* REG_VEX_73 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_73_REG_2) },
+    { MOD_TABLE (MOD_VEX_73_REG_3) },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_73_REG_6) },
+    { MOD_TABLE (MOD_VEX_73_REG_7) },
+  },
+  /* REG_VEX_AE */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_AE_REG_2) },
+    { MOD_TABLE (MOD_VEX_AE_REG_3) },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+  },
 };
 
 static const struct dis386 prefix_table[][4] = {
@@ -1795,10 +2420,10 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_0F11 */
   {
-    { "movups",        { EXx XM } },
-    { "movss", { EXd XM } },
-    { "movupd",        { EXx XM } },
-    { "movsd", { EXq XM } },
+    { "movups",        { EXxS, XM } },
+    { "movss", { EXdS, XM } },
+    { "movupd",        { EXxS, XM } },
+    { "movsd", { EXqS, XM } },
   },
 
   /* PREFIX_0F12 */
@@ -1820,17 +2445,17 @@ static const struct dis386 prefix_table[][4] = {
   /* PREFIX_0F2A */
   {
     { "cvtpi2ps", { XM, EMCq } },
-    { "cvtsi2ssY", { XM, Ev } },
+    { "cvtsi2ss%LQ", { XM, Ev } },
     { "cvtpi2pd", { XM, EMCq } },
-    { "cvtsi2sdY", { XM, Ev } },
+    { "cvtsi2sd%LQ", { XM, Ev } },
   },
 
   /* PREFIX_0F2B */
   {
-    {"movntps", { Ev, XM } },
-    {"movntss", { Ed, XM } },
-    {"movntpd", { Ev, XM } },
-    {"movntsd", { Eq, XM } },
+    { MOD_TABLE (MOD_0F2B_PREFIX_0) },
+    { MOD_TABLE (MOD_0F2B_PREFIX_1) },
+    { MOD_TABLE (MOD_0F2B_PREFIX_2) },
+    { MOD_TABLE (MOD_0F2B_PREFIX_3) },
   },
 
   /* PREFIX_0F2C */
@@ -2009,6 +2634,22 @@ static const struct dis386 prefix_table[][4] = {
     { "pshuflw",{ XM, EXx, Ib } },
   },
 
+  /* PREFIX_0F73_REG_3 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "psrldq",        { XS, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_0F73_REG_7 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pslldq",        { XS, Ib } },
+    { "(bad)", { XX } },
+  },
+
   /* PREFIX_0F78 */
   {
     {"vmread", { Em, Gm } },
@@ -2051,9 +2692,9 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_0F7F */
   {
-    { "movq",  { EM, MX } },
-    { "movdqu",        { EXx XM } },
-    { "movdqa",        { EXx XM } },
+    { "movq",  { EMS, MX } },
+    { "movdqu",        { EXxS, XM } },
+    { "movdqa",        { EXxS, XM } },
     { "(bad)", { XX } },
   },
 
@@ -2075,10 +2716,26 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_0FC2 */
   {
-    { "", { XM, EXx, OPSIMD } },       /* See OP_SIMD_SUFFIX.  */
-    { "", { XM, EXd, OPSIMD } },
-    { "", { XM, EXx, OPSIMD } },
-    { "", { XM, EXq, OPSIMD } },
+    { "cmpps", { XM, EXx, CMP } },
+    { "cmpss", { XM, EXd, CMP } },
+    { "cmppd", { XM, EXx, CMP } },
+    { "cmpsd", { XM, EXq, CMP } },
+  },
+
+  /* PREFIX_0FC3 */
+  {
+    { "movntiS", { Ma, Gv } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_0FC7_REG_6 */
+  {
+    { "vmptrld",{ Mq } },
+    { "vmxon", { Mq } },
+    { "vmclear",{ Mq } },
+    { "(bad)", { XX } },
   },
 
   /* PREFIX_0FD0 */
@@ -2093,7 +2750,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "movq2dq",{ XM, MS } },
-    { "movq",  { EXq, XM } },
+    { "movq",  { EXqS, XM } },
     { "movdq2q",{ MX, XS } },
   },
 
@@ -2107,9 +2764,9 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_0FE7 */
   {
-    { "movntq",        { EM, MX } },
+    { "movntq",        { Mq, MX } },
     { "(bad)", { XX } },
-    { "movntdq",{ EM, XM } },
+    { MOD_TABLE (MOD_0FE7_PREFIX_2) },
     { "(bad)", { XX } },
   },
 
@@ -2133,7 +2790,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "pblendvb", {XM, EXx, XMM0 } },
+    { "pblendvb", { XM, EXx, XMM0 } },
     { "(bad)", { XX } },
   },
 
@@ -2141,7 +2798,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "blendvps", {XM, EXx, XMM0 } },
+    { "blendvps", { XM, EXx, XMM0 } },
     { "(bad)", { XX } },
   },
 
@@ -2229,7 +2886,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "movntdqa", { XM, EM } },
+    { MOD_TABLE (MOD_0F382A_PREFIX_2) },
     { "(bad)", { XX } },
   },
 
@@ -2377,19 +3034,75 @@ static const struct dis386 prefix_table[][4] = {
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_0F38F0 */
+  /* PREFIX_0F3880 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
+    { "invept",        { Gm, Mo } },
     { "(bad)", { XX } },
-    { "crc32", { Gdq, { CRC32_Fixup, b_mode } } },     
   },
 
-  /* PREFIX_0F38F1 */
+  /* PREFIX_0F3881 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "invvpid", { Gm, Mo } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_0F38DB */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "aesimc", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_0F38DC */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "aesenc", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_0F38DD */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "aesenclast", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_0F38DE */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "aesdec", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_0F38DF */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
+    { "aesdeclast", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_0F38F0 */
+  {
+    { "movbeS",        { Gv, { MOVBE_Fixup, v_mode } } },
+    { "(bad)", { XX } },
+    { "movbeS",        { Gv, { MOVBE_Fixup, v_mode } } },
+    { "crc32", { Gdq, { CRC32_Fixup, b_mode } } },     
+  },
+
+  /* PREFIX_0F38F1 */
+  {
+    { "movbeS",        { { MOVBE_Fixup, v_mode }, Gv } },
     { "(bad)", { XX } },
+    { "movbeS",        { { MOVBE_Fixup, v_mode }, Gv } },
     { "crc32", { Gdq, { CRC32_Fixup, v_mode } } },     
   },
 
@@ -2529,6 +3242,14 @@ static const struct dis386 prefix_table[][4] = {
     { "(bad)", { XX } },
   },
 
+  /* PREFIX_0F3A44 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pclmulqdq", { XM, EXx, PCLMUL } },
+    { "(bad)", { XX } },
+  },
+
   /* PREFIX_0F3A60 */
   {
     { "(bad)", { XX } },
@@ -2561,424 +3282,3671 @@ static const struct dis386 prefix_table[][4] = {
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_0F73_REG_3 */
+  /* PREFIX_0F3ADF */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "psrldq",        { MS, Ib } },
+    { "aeskeygenassist", { XM, EXx, Ib } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_0F73_REG_7 */
+  /* PREFIX_VEX_10 */
   {
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "pslldq",        { MS, Ib } },
-    { "(bad)", { XX } },
+    { "vmovups", { XM, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_10_P_1) },
+    { "vmovupd", { XM, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_10_P_3) },
   },
 
-  /* PREFIX_0FC7_REG_6 */
+  /* PREFIX_VEX_11 */
   {
-    { "vmptrld",{ Mq } },
-    { "vmxon", { Mq } },
-    { "vmclear",{ Mq } },
-    { "(bad)", { XX } },
+    { "vmovups", { EXxS, XM } },
+    { VEX_LEN_TABLE (VEX_LEN_11_P_1) },
+    { "vmovupd", { EXxS, XM } },
+    { VEX_LEN_TABLE (VEX_LEN_11_P_3) },
   },
-};
 
-static const struct dis386 x86_64_table[][2] = {
-  /* X86_64_06 */
+  /* PREFIX_VEX_12 */
   {
-    { "push{T|}", { es } },
-    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_12_PREFIX_0) },
+    { "vmovsldup", { XM, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_12_P_2) },
+    { "vmovddup", { XM, EXymmq } },
   },
 
-  /* X86_64_07 */
+  /* PREFIX_VEX_16 */
   {
-    { "pop{T|}", { es } },
-    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_16_PREFIX_0) },
+    { "vmovshdup", { XM, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_16_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_0D */
+  /* PREFIX_VEX_2A */
   {
-    { "push{T|}", { cs } },
-    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2A_P_1) },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2A_P_3) },
   },
 
-  /* X86_64_16 */
+  /* PREFIX_VEX_2C */
   {
-    { "push{T|}", { ss } },
-    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2C_P_1) },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2C_P_3) },
   },
 
-  /* X86_64_17 */
+  /* PREFIX_VEX_2D */
   {
-    { "pop{T|}", { ss } },
-    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2D_P_1) },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2D_P_3) },
   },
 
-  /* X86_64_1E */
+  /* PREFIX_VEX_2E */
   {
-    { "push{T|}", { ds } },
-    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2E_P_0) },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2E_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_1F */
+  /* PREFIX_VEX_2F */
   {
-    { "pop{T|}", { ds } },
-    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2F_P_0) },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_2F_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_27 */
+  /* PREFIX_VEX_51 */
   {
-    { "daa", { XX } },
-    { "(bad)", { XX } },
+    { "vsqrtps", { XM, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_51_P_1) },
+    { "vsqrtpd", { XM, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_51_P_3) },
   },
 
-  /* X86_64_2F */
+  /* PREFIX_VEX_52 */
   {
-    { "das", { XX } },
-    { "(bad)", { XX } },
+    { "vrsqrtps", { XM, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_52_P_1) },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_37 */
+  /* PREFIX_VEX_53 */
   {
-    { "aaa", { XX } },
-    { "(bad)", { XX } },
+    { "vrcpps",        { XM, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_53_P_1) },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_3F */
+  /* PREFIX_VEX_58 */
   {
-    { "aas", { XX } },
-    { "(bad)", { XX } },
+    { "vaddps",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_58_P_1) },
+    { "vaddpd",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_58_P_3) },
   },
 
-  /* X86_64_60 */
+  /* PREFIX_VEX_59 */
   {
-    { "pusha{P|}", { XX } },
-    { "(bad)", { XX } },
+    { "vmulps",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_59_P_1) },
+    { "vmulpd",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_59_P_3) },
   },
 
-  /* X86_64_61 */
+  /* PREFIX_VEX_5A */
   {
-    { "popa{P|}", { XX } },
-    { "(bad)", { XX } },
+    { "vcvtps2pd", { XM, EXxmmq } },
+    { VEX_LEN_TABLE (VEX_LEN_5A_P_1) },
+    { "vcvtpd2ps%XY", { XMM, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_5A_P_3) },
   },
 
-  /* X86_64_62 */
+  /* PREFIX_VEX_5B */
   {
-    { MOD_TABLE (MOD_62_32BIT) },
-    { "(bad)", { XX } },
+    { "vcvtdq2ps", { XM, EXx } },
+    { "vcvttps2dq", { XM, EXx } },
+    { "vcvtps2dq", { XM, EXx } },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_63 */
+  /* PREFIX_VEX_5C */
   {
-    { "arpl", { Ew, Gw } },
-    { "movs{lq|xd}", { Gv, Ed } },
+    { "vsubps",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_5C_P_1) },
+    { "vsubpd",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_5C_P_3) },
   },
 
-  /* X86_64_6D */
+  /* PREFIX_VEX_5D */
   {
-    { "ins{R|}", { Yzr, indirDX } },
-    { "ins{G|}", { Yzr, indirDX } },
+    { "vminps",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_5D_P_1) },
+    { "vminpd",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_5D_P_3) },
   },
 
-  /* X86_64_6F */
+  /* PREFIX_VEX_5E */
   {
-    { "outs{R|}", { indirDXr, Xz } },
-    { "outs{G|}", { indirDXr, Xz } },
+    { "vdivps",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_5E_P_1) },
+    { "vdivpd",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_5E_P_3) },
   },
 
-  /* X86_64_9A */
+  /* PREFIX_VEX_5F */
   {
-    { "Jcall{T|}", { Ap } },
-    { "(bad)", { XX } },
+    { "vmaxps",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_5F_P_1) },
+    { "vmaxpd",        { XM, Vex, EXx } },
+    { VEX_LEN_TABLE (VEX_LEN_5F_P_3) },
   },
 
-  /* X86_64_C4 */
+  /* PREFIX_VEX_60 */
   {
-    { MOD_TABLE (MOD_C4_32BIT) },
-    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_60_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_C5 */
+  /* PREFIX_VEX_61 */
   {
-    { MOD_TABLE (MOD_C5_32BIT) },
-    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_61_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_CE */
+  /* PREFIX_VEX_62 */
   {
-    { "into", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_62_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_D4 */
+  /* PREFIX_VEX_63 */
   {
-    { "aam", { sIb } },
-    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_63_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_D5 */
+  /* PREFIX_VEX_64 */
   {
-    { "aad", { sIb } },
-    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_64_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_EA */
+  /* PREFIX_VEX_65 */
   {
-    { "Jjmp{T|}", { Ap } },
-    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_65_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_0F01_REG_0 */
+  /* PREFIX_VEX_66 */
   {
-    { "sgdt{Q|IQ}", { M } },
-    { "sgdt", { M } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_66_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_0F01_REG_1 */
+  /* PREFIX_VEX_67 */
   {
-    { "sidt{Q|IQ}", { M } },
-    { "sidt", { M } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_67_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_0F01_REG_2 */
+  /* PREFIX_VEX_68 */
   {
-    { "lgdt{Q|Q}", { M } },
-    { "lgdt", { M } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_68_P_2) },
+    { "(bad)", { XX } },
   },
 
-  /* X86_64_0F01_REG_3 */
+  /* PREFIX_VEX_69 */
   {
-    { "lidt{Q|Q}", { M } },
-    { "lidt", { M } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_69_P_2) },
+    { "(bad)", { XX } },
   },
-};
 
-static const struct dis386 three_byte_table[][256] = {
-  /* THREE_BYTE_0F24 */
+  /* PREFIX_VEX_6A */
   {
-    /* 00 */
-    { "fmaddps",       { { OP_DREX4, q_mode } } },
-    { "fmaddpd",       { { OP_DREX4, q_mode } } },
-    { "fmaddss",       { { OP_DREX4, w_mode } } },
-    { "fmaddsd",       { { OP_DREX4, d_mode } } },
-    { "fmaddps",       { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fmaddpd",       { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fmaddss",       { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "fmaddsd",       { { OP_DREX4, DREX_OC1 + d_mode } } },
-    /* 08 */
-    { "fmsubps",       { { OP_DREX4, q_mode } } },
-    { "fmsubpd",       { { OP_DREX4, q_mode } } },
-    { "fmsubss",       { { OP_DREX4, w_mode } } },
-    { "fmsubsd",       { { OP_DREX4, d_mode } } },
-    { "fmsubps",       { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fmsubpd",       { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fmsubss",       { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "fmsubsd",       { { OP_DREX4, DREX_OC1 + d_mode } } },
-    /* 10 */
-    { "fnmaddps",      { { OP_DREX4, q_mode } } },
-    { "fnmaddpd",      { { OP_DREX4, q_mode } } },
-    { "fnmaddss",      { { OP_DREX4, w_mode } } },
-    { "fnmaddsd",      { { OP_DREX4, d_mode } } },
-    { "fnmaddps",      { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fnmaddpd",      { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fnmaddss",      { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "fnmaddsd",      { { OP_DREX4, DREX_OC1 + d_mode } } },
-    /* 18 */
-    { "fnmsubps",      { { OP_DREX4, q_mode } } },
-    { "fnmsubpd",      { { OP_DREX4, q_mode } } },
-    { "fnmsubss",      { { OP_DREX4, w_mode } } },
-    { "fnmsubsd",      { { OP_DREX4, d_mode } } },
-    { "fnmsubps",      { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fnmsubpd",      { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fnmsubss",      { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "fnmsubsd",      { { OP_DREX4, DREX_OC1 + d_mode } } },
-    /* 20 */
-    { "permps",                { { OP_DREX4, q_mode } } },
-    { "permpd",                { { OP_DREX4, q_mode } } },
-    { "pcmov",         { { OP_DREX4, q_mode } } },
-    { "pperm",         { { OP_DREX4, q_mode } } },
-    { "permps",                { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "permpd",                { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "pcmov",         { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "pperm",         { { OP_DREX4, DREX_OC1 + d_mode } } },
-    /* 28 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 30 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 38 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 40 */
-    { "protb",         { { OP_DREX3, q_mode } } },
-    { "protw",         { { OP_DREX3, q_mode } } },
-    { "protd",         { { OP_DREX3, q_mode } } },
-    { "protq",         { { OP_DREX3, q_mode } } },
-    { "pshlb",         { { OP_DREX3, q_mode } } },
-    { "pshlw",         { { OP_DREX3, q_mode } } },
-    { "pshld",         { { OP_DREX3, q_mode } } },
-    { "pshlq",         { { OP_DREX3, q_mode } } },
-    /* 48 */
-    { "pshab",         { { OP_DREX3, q_mode } } },
-    { "pshaw",         { { OP_DREX3, q_mode } } },
-    { "pshad",         { { OP_DREX3, q_mode } } },
-    { "pshaq",         { { OP_DREX3, q_mode } } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 50 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 58 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 60 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 68 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 70 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 78 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 80 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "pmacssww",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacsswd",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacssdql",     { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    /* 88 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "pmacssdd",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacssdqh",     { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    /* 90 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "pmacsww",       { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacswd",       { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacsdql",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    /* 98 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "pmacsdd",       { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacsdqh",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    /* a0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "pmadcsswd",     { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "(bad)",         { XX } },
-    /* a8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* b0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "pmadcswd",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "(bad)",         { XX } },
-    /* b8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* c0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_6A_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_6B */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_6B_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_6C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_6C_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_6D */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_6D_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_6E */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_6E_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_6F */
+  {
+    { "(bad)", { XX } },
+    { "vmovdqu", { XM, EXx } },
+    { "vmovdqa", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_70 */
+  {
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_70_P_1) },
+    { VEX_LEN_TABLE (VEX_LEN_70_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_70_P_3) },
+  },
+
+  /* PREFIX_VEX_71_REG_2 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_71_R_2_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_71_REG_4 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_71_R_4_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_71_REG_6 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_71_R_6_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_72_REG_2 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_72_R_2_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_72_REG_4 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_72_R_4_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_72_REG_6 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_72_R_6_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_73_REG_2 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_73_R_2_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_73_REG_3 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_73_R_3_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_73_REG_6 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_73_R_6_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_73_REG_7 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_73_R_7_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_74 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_74_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_75 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_75_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_76 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_76_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_77 */
+  {
+    { "",      { VZERO } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_7C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vhaddpd", { XM, Vex, EXx } },
+    { "vhaddps", { XM, Vex, EXx } },
+  },
+
+  /* PREFIX_VEX_7D */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vhsubpd", { XM, Vex, EXx } },
+    { "vhsubps", { XM, Vex, EXx } },
+  },
+
+  /* PREFIX_VEX_7E */
+  {
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_7E_P_1) },
+    { VEX_LEN_TABLE (VEX_LEN_7E_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_7F */
+  {
+    { "(bad)", { XX } },
+    { "vmovdqu", { EXxS, XM } },
+    { "vmovdqa", { EXxS, XM } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_C2 */
+  {
+    { "vcmpps",        { XM, Vex, EXx, VCMP } },
+    { VEX_LEN_TABLE (VEX_LEN_C2_P_1) },
+    { "vcmppd",        { XM, Vex, EXx, VCMP } },
+    { VEX_LEN_TABLE (VEX_LEN_C2_P_3) },
+  },
+
+  /* PREFIX_VEX_C4 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_C4_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_C5 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_C5_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_D0 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vaddsubpd", { XM, Vex, EXx } },
+    { "vaddsubps", { XM, Vex, EXx } },
+  },
+
+  /* PREFIX_VEX_D1 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_D1_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_D2 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_D2_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_D3 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_D3_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_D4 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_D4_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_D5 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_D5_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_D6 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_D6_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_D7 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_D7_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_D8 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_D8_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_D9 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_D9_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_DA */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_DA_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_DB */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_DB_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_DC */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_DC_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_DD */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_DD_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_DE */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_DE_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_DF */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_DF_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_E0 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_E0_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_E1 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_E1_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_E2 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_E2_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_E3 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_E3_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_E4 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_E4_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_E5 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_E5_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_E6 */
+  {
+    { "(bad)", { XX } },
+    { "vcvtdq2pd", { XM, EXxmmq } },
+    { "vcvttpd2dq%XY", { XMM, EXx } },
+    { "vcvtpd2dq%XY", { XMM, EXx } },
+  },
+
+  /* PREFIX_VEX_E7 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_E7_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_E8 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_E8_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_E9 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_E9_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_EA */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_EA_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_EB */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_EB_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_EC */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_EC_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_ED */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_ED_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_EE */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_EE_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_EF */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_EF_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_F0 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_F0_PREFIX_3) },
+  },
+
+  /* PREFIX_VEX_F1 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_F1_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_F2 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_F2_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_F3 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_F3_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_F4 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_F4_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_F5 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_F5_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_F6 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_F6_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_F7 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_F7_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_F8 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_F8_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_F9 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_F9_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_FA */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_FA_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_FB */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_FB_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_FC */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_FC_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_FD */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_FD_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_FE */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_FE_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3800 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3800_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3801 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3801_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3802 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3802_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3803 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3803_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3804 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3804_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3805 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3805_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3806 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3806_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3807 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3807_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3808 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3808_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3809 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3809_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_380A */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_380A_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_380B */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_380B_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_380C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vpermilps", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_380D */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vpermilpd", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_380E */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vtestps", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_380F */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vtestpd", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3817 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vptest",        { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3818 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_3818_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3819 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_3819_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_381A */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_381A_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_381C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_381C_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_381D */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_381D_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_381E */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_381E_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3820 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3820_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3821 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3821_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3822 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3822_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3823 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3823_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3824 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3824_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3825 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3825_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3828 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3828_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3829 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3829_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_382A */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { MOD_TABLE (MOD_VEX_382A_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_382B */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_382B_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_382C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+     { MOD_TABLE (MOD_VEX_382C_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_382D */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+     { MOD_TABLE (MOD_VEX_382D_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_382E */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+     { MOD_TABLE (MOD_VEX_382E_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_382F */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+     { MOD_TABLE (MOD_VEX_382F_PREFIX_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3830 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3830_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3831 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3831_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3832 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3832_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3833 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3833_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3834 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3834_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3835 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3835_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3837 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3837_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3838 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3838_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3839 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3839_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_383A */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_383A_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_383B */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_383B_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_383C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_383C_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_383D */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_383D_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_383E */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_383E_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_383F */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_383F_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3840 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3840_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3841 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3841_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3896 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmaddsub132p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3897 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmsubadd132p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3898 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmadd132p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3899 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmadd132s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_389A */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmsub132p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_389B */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmsub132s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_389C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmadd132p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_389D */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmadd132s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_389E */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmsub132p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_389F */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmsub132s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38A6 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmaddsub213p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38A7 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmsubadd213p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38A8 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmadd213p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38A9 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmadd213s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38AA */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmsub213p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38AB */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmsub213s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38AC */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmadd213p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38AD */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmadd213s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38AE */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmsub213p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38AF */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmsub213s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38B6 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmaddsub231p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38B7 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmsubadd231p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38B8 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmadd231p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38B9 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmadd231s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38BA */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmsub231p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38BB */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfmsub231s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38BC */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmadd231p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38BD */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmadd231s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38BE */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmsub231p%XW", { XM, Vex, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38BF */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vfnmsub231s%XW", { XM, Vex, EXVexWdq } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38DB */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_38DB_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38DC */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_38DC_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38DD */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_38DD_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38DE */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_38DE_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_38DF */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_38DF_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A04 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vpermilps", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A05 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vpermilpd", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A06 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A06_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A08 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vroundps", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A09 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vroundpd", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0A */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A0A_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0B */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A0B_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vblendps", { XM, Vex, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0D */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vblendpd", { XM, Vex, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0E */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A0E_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0F */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A0F_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A14 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A14_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A15 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A15_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A16 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A16_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A17 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A17_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A18 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A18_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A19 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A19_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A20 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A20_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A21 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A21_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A22 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A22_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A40 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vdpps", { XM, Vex, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A41 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A41_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A42 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A42_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A44 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A44_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A4A */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vblendvps", { XM, Vex, EXx, XMVexI4 } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A4B */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vblendvpd", { XM, Vex, EXx, XMVexI4 } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A4C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A4C_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A60 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A60_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A61 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A61_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A62 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A62_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A63 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A63_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3ADF */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3ADF_P_2) },
+    { "(bad)", { XX } },
+  },
+};
+
+static const struct dis386 x86_64_table[][2] = {
+  /* X86_64_06 */
+  {
+    { "push{T|}", { es } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_07 */
+  {
+    { "pop{T|}", { es } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_0D */
+  {
+    { "push{T|}", { cs } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_16 */
+  {
+    { "push{T|}", { ss } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_17 */
+  {
+    { "pop{T|}", { ss } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_1E */
+  {
+    { "push{T|}", { ds } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_1F */
+  {
+    { "pop{T|}", { ds } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_27 */
+  {
+    { "daa", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_2F */
+  {
+    { "das", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_37 */
+  {
+    { "aaa", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_3F */
+  {
+    { "aas", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_60 */
+  {
+    { "pusha{P|}", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_61 */
+  {
+    { "popa{P|}", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_62 */
+  {
+    { MOD_TABLE (MOD_62_32BIT) },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_63 */
+  {
+    { "arpl", { Ew, Gw } },
+    { "movs{lq|xd}", { Gv, Ed } },
+  },
+
+  /* X86_64_6D */
+  {
+    { "ins{R|}", { Yzr, indirDX } },
+    { "ins{G|}", { Yzr, indirDX } },
+  },
+
+  /* X86_64_6F */
+  {
+    { "outs{R|}", { indirDXr, Xz } },
+    { "outs{G|}", { indirDXr, Xz } },
+  },
+
+  /* X86_64_9A */
+  {
+    { "Jcall{T|}", { Ap } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_C4 */
+  {
+    { MOD_TABLE (MOD_C4_32BIT) },
+    { VEX_C4_TABLE (VEX_0F) },
+  },
+
+  /* X86_64_C5 */
+  {
+    { MOD_TABLE (MOD_C5_32BIT) },
+    { VEX_C5_TABLE (VEX_0F) },
+  },
+
+  /* X86_64_CE */
+  {
+    { "into", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_D4 */
+  {
+    { "aam", { sIb } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_D5 */
+  {
+    { "aad", { sIb } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_EA */
+  {
+    { "Jjmp{T|}", { Ap } },
+    { "(bad)", { XX } },
+  },
+
+  /* X86_64_0F01_REG_0 */
+  {
+    { "sgdt{Q|IQ}", { M } },
+    { "sgdt", { M } },
+  },
+
+  /* X86_64_0F01_REG_1 */
+  {
+    { "sidt{Q|IQ}", { M } },
+    { "sidt", { M } },
+  },
+
+  /* X86_64_0F01_REG_2 */
+  {
+    { "lgdt{Q|Q}", { M } },
+    { "lgdt", { M } },
+  },
+
+  /* X86_64_0F01_REG_3 */
+  {
+    { "lidt{Q|Q}", { M } },
+    { "lidt", { M } },
+  },
+};
+
+static const struct dis386 three_byte_table[][256] = {
+  /* THREE_BYTE_0F24 */
+  {
+    /* 00 */
+    { "fmaddps",       { { OP_DREX4, q_mode } } },
+    { "fmaddpd",       { { OP_DREX4, q_mode } } },
+    { "fmaddss",       { { OP_DREX4, w_mode } } },
+    { "fmaddsd",       { { OP_DREX4, d_mode } } },
+    { "fmaddps",       { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "fmaddpd",       { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "fmaddss",       { { OP_DREX4, DREX_OC1 + w_mode } } },
+    { "fmaddsd",       { { OP_DREX4, DREX_OC1 + d_mode } } },
+    /* 08 */
+    { "fmsubps",       { { OP_DREX4, q_mode } } },
+    { "fmsubpd",       { { OP_DREX4, q_mode } } },
+    { "fmsubss",       { { OP_DREX4, w_mode } } },
+    { "fmsubsd",       { { OP_DREX4, d_mode } } },
+    { "fmsubps",       { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "fmsubpd",       { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "fmsubss",       { { OP_DREX4, DREX_OC1 + w_mode } } },
+    { "fmsubsd",       { { OP_DREX4, DREX_OC1 + d_mode } } },
+    /* 10 */
+    { "fnmaddps",      { { OP_DREX4, q_mode } } },
+    { "fnmaddpd",      { { OP_DREX4, q_mode } } },
+    { "fnmaddss",      { { OP_DREX4, w_mode } } },
+    { "fnmaddsd",      { { OP_DREX4, d_mode } } },
+    { "fnmaddps",      { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "fnmaddpd",      { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "fnmaddss",      { { OP_DREX4, DREX_OC1 + w_mode } } },
+    { "fnmaddsd",      { { OP_DREX4, DREX_OC1 + d_mode } } },
+    /* 18 */
+    { "fnmsubps",      { { OP_DREX4, q_mode } } },
+    { "fnmsubpd",      { { OP_DREX4, q_mode } } },
+    { "fnmsubss",      { { OP_DREX4, w_mode } } },
+    { "fnmsubsd",      { { OP_DREX4, d_mode } } },
+    { "fnmsubps",      { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "fnmsubpd",      { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "fnmsubss",      { { OP_DREX4, DREX_OC1 + w_mode } } },
+    { "fnmsubsd",      { { OP_DREX4, DREX_OC1 + d_mode } } },
+    /* 20 */
+    { "permps",                { { OP_DREX4, q_mode } } },
+    { "permpd",                { { OP_DREX4, q_mode } } },
+    { "pcmov",         { { OP_DREX4, q_mode } } },
+    { "pperm",         { { OP_DREX4, q_mode } } },
+    { "permps",                { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "permpd",                { { OP_DREX4, DREX_OC1 + q_mode } } },
+    { "pcmov",         { { OP_DREX4, DREX_OC1 + w_mode } } },
+    { "pperm",         { { OP_DREX4, DREX_OC1 + d_mode } } },
+    /* 28 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 30 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 38 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 40 */
+    { "protb",         { { OP_DREX3, q_mode } } },
+    { "protw",         { { OP_DREX3, q_mode } } },
+    { "protd",         { { OP_DREX3, q_mode } } },
+    { "protq",         { { OP_DREX3, q_mode } } },
+    { "pshlb",         { { OP_DREX3, q_mode } } },
+    { "pshlw",         { { OP_DREX3, q_mode } } },
+    { "pshld",         { { OP_DREX3, q_mode } } },
+    { "pshlq",         { { OP_DREX3, q_mode } } },
+    /* 48 */
+    { "pshab",         { { OP_DREX3, q_mode } } },
+    { "pshaw",         { { OP_DREX3, q_mode } } },
+    { "pshad",         { { OP_DREX3, q_mode } } },
+    { "pshaq",         { { OP_DREX3, q_mode } } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 50 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 58 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 60 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 68 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 70 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 78 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 80 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "pmacssww",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "pmacsswd",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "pmacssdql",     { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    /* 88 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "pmacssdd",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "pmacssdqh",     { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    /* 90 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "pmacsww",       { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "pmacswd",       { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "pmacsdql",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    /* 98 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "pmacsdd",       { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "pmacsdqh",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    /* a0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "pmadcsswd",     { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "(bad)",         { XX } },
+    /* a8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "pmadcswd",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "(bad)",         { XX } },
+    /* b8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* e0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* e8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+  },
+  /* THREE_BYTE_0F25 */
+  {
+    /* 00 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 08 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 10 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 18 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 20 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 28 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "comps",         { { OP_DREX3, q_mode }, { OP_DREX_FCMP, b_mode } } },
+    { "compd",         { { OP_DREX3, q_mode }, { OP_DREX_FCMP, b_mode } } },
+    { "comss",         { { OP_DREX3, w_mode }, { OP_DREX_FCMP, b_mode } } },
+    { "comsd",         { { OP_DREX3, d_mode }, { OP_DREX_FCMP, b_mode } } },
+    /* 30 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 38 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 40 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 48 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "pcomb",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
+    { "pcomw",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
+    { "pcomd",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
+    { "pcomq",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
+    /* 50 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 58 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 60 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 68 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "pcomub",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
+    { "pcomuw",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
+    { "pcomud",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
+    { "pcomuq",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
+    /* 70 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 78 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 80 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 88 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 90 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 98 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* e0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* e8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+  },
+  /* THREE_BYTE_0F38 */
+  {
+    /* 00 */
+    { "pshufb",                { MX, EM } },
+    { "phaddw",                { MX, EM } },
+    { "phaddd",                { MX, EM } },
+    { "phaddsw",       { MX, EM } },
+    { "pmaddubsw",     { MX, EM } },
+    { "phsubw",                { MX, EM } },
+    { "phsubd",                { MX, EM } },
+    { "phsubsw",       { MX, EM } },
+    /* 08 */
+    { "psignb",                { MX, EM } },
+    { "psignw",                { MX, EM } },
+    { "psignd",                { MX, EM } },
+    { "pmulhrsw",      { MX, EM } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 10 */
+    { PREFIX_TABLE (PREFIX_0F3810) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3814) },
+    { PREFIX_TABLE (PREFIX_0F3815) },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3817) },
+    /* 18 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "pabsb",         { MX, EM } },
+    { "pabsw",         { MX, EM } },
+    { "pabsd",         { MX, EM } },
+    { "(bad)",         { XX } },
+    /* 20 */
+    { PREFIX_TABLE (PREFIX_0F3820) },
+    { PREFIX_TABLE (PREFIX_0F3821) },
+    { PREFIX_TABLE (PREFIX_0F3822) },
+    { PREFIX_TABLE (PREFIX_0F3823) },
+    { PREFIX_TABLE (PREFIX_0F3824) },
+    { PREFIX_TABLE (PREFIX_0F3825) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 28 */
+    { PREFIX_TABLE (PREFIX_0F3828) },
+    { PREFIX_TABLE (PREFIX_0F3829) },
+    { PREFIX_TABLE (PREFIX_0F382A) },
+    { PREFIX_TABLE (PREFIX_0F382B) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 30 */
+    { PREFIX_TABLE (PREFIX_0F3830) },
+    { PREFIX_TABLE (PREFIX_0F3831) },
+    { PREFIX_TABLE (PREFIX_0F3832) },
+    { PREFIX_TABLE (PREFIX_0F3833) },
+    { PREFIX_TABLE (PREFIX_0F3834) },
+    { PREFIX_TABLE (PREFIX_0F3835) },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3837) },
+    /* 38 */
+    { PREFIX_TABLE (PREFIX_0F3838) },
+    { PREFIX_TABLE (PREFIX_0F3839) },
+    { PREFIX_TABLE (PREFIX_0F383A) },
+    { PREFIX_TABLE (PREFIX_0F383B) },
+    { PREFIX_TABLE (PREFIX_0F383C) },
+    { PREFIX_TABLE (PREFIX_0F383D) },
+    { PREFIX_TABLE (PREFIX_0F383E) },
+    { PREFIX_TABLE (PREFIX_0F383F) },
+    /* 40 */
+    { PREFIX_TABLE (PREFIX_0F3840) },
+    { PREFIX_TABLE (PREFIX_0F3841) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 48 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 50 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 58 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 60 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 68 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 70 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 78 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 80 */
+    { PREFIX_TABLE (PREFIX_0F3880) },
+    { PREFIX_TABLE (PREFIX_0F3881) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 88 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 90 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 98 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F38DB) },
+    { PREFIX_TABLE (PREFIX_0F38DC) },
+    { PREFIX_TABLE (PREFIX_0F38DD) },
+    { PREFIX_TABLE (PREFIX_0F38DE) },
+    { PREFIX_TABLE (PREFIX_0F38DF) },
+    /* e0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* e8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f0 */
+    { PREFIX_TABLE (PREFIX_0F38F0) },
+    { PREFIX_TABLE (PREFIX_0F38F1) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+  },
+  /* THREE_BYTE_0F3A */
+  {
+    /* 00 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 08 */
+    { PREFIX_TABLE (PREFIX_0F3A08) },
+    { PREFIX_TABLE (PREFIX_0F3A09) },
+    { PREFIX_TABLE (PREFIX_0F3A0A) },
+    { PREFIX_TABLE (PREFIX_0F3A0B) },
+    { PREFIX_TABLE (PREFIX_0F3A0C) },
+    { PREFIX_TABLE (PREFIX_0F3A0D) },
+    { PREFIX_TABLE (PREFIX_0F3A0E) },
+    { "palignr",       { MX, EM, Ib } },
+    /* 10 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3A14) },
+    { PREFIX_TABLE (PREFIX_0F3A15) },
+    { PREFIX_TABLE (PREFIX_0F3A16) },
+    { PREFIX_TABLE (PREFIX_0F3A17) },
+    /* 18 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 20 */
+    { PREFIX_TABLE (PREFIX_0F3A20) },
+    { PREFIX_TABLE (PREFIX_0F3A21) },
+    { PREFIX_TABLE (PREFIX_0F3A22) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 28 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 30 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 38 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 40 */
+    { PREFIX_TABLE (PREFIX_0F3A40) },
+    { PREFIX_TABLE (PREFIX_0F3A41) },
+    { PREFIX_TABLE (PREFIX_0F3A42) },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3A44) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 48 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 50 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 58 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 60 */
+    { PREFIX_TABLE (PREFIX_0F3A60) },
+    { PREFIX_TABLE (PREFIX_0F3A61) },
+    { PREFIX_TABLE (PREFIX_0F3A62) },
+    { PREFIX_TABLE (PREFIX_0F3A63) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 68 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 70 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 78 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 80 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 88 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 90 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 98 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3ADF) },
+    /* e0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* e8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+  },
+  /* THREE_BYTE_0F7A */
+  {
+    /* 00 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 08 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 10 */
+    { "frczps",                { XM, EXq } },
+    { "frczpd",                { XM, EXq } },
+    { "frczss",                { XM, EXq } },
+    { "frczsd",                { XM, EXq } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 18 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 20 */
+    { "ptest",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 28 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 30 */
+    { "cvtph2ps",      { XM, EXd } },
+    { "cvtps2ph",      { EXd, XM } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 38 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 40 */
+    { "(bad)",         { XX } },
+    { "phaddbw",       { XM, EXq } },
+    { "phaddbd",       { XM, EXq } },
+    { "phaddbq",       { XM, EXq } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "phaddwd",       { XM, EXq } },
+    { "phaddwq",       { XM, EXq } },
+    /* 48 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "phadddq",       { XM, EXq } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 50 */
+    { "(bad)",         { XX } },
+    { "phaddubw",      { XM, EXq } },
+    { "phaddubd",      { XM, EXq } },
+    { "phaddubq",      { XM, EXq } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "phadduwd",      { XM, EXq } },
+    { "phadduwq",      { XM, EXq } },
+    /* 58 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "phaddudq",      { XM, EXq } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 60 */
+    { "(bad)",         { XX } },
+    { "phsubbw",       { XM, EXq } },
+    { "phsubbd",       { XM, EXq } },
+    { "phsubbq",       { XM, EXq } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 68 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 70 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 78 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 80 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 88 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 90 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 98 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* d8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* e0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* e8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* f8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+  },
+  /* THREE_BYTE_0F7B */
+  {
+    /* 00 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 08 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 10 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 18 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 20 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 28 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 30 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 38 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 40 */
+    { "protb",         { XM, EXq, Ib } },
+    { "protw",         { XM, EXq, Ib } },
+    { "protd",         { XM, EXq, Ib } },
+    { "protq",         { XM, EXq, Ib } },
+    { "pshlb",         { XM, EXq, Ib } },
+    { "pshlw",         { XM, EXq, Ib } },
+    { "pshld",         { XM, EXq, Ib } },
+    { "pshlq",         { XM, EXq, Ib } },
+    /* 48 */
+    { "pshab",         { XM, EXq, Ib } },
+    { "pshaw",         { XM, EXq, Ib } },
+    { "pshad",         { XM, EXq, Ib } },
+    { "pshaq",         { XM, EXq, Ib } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 50 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 58 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 60 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 68 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 70 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 78 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 80 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 88 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 90 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 98 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* a8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* b8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -3048,7 +7016,10 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
   },
-  /* THREE_BYTE_0F25 */
+};
+
+static const struct dis386 vex_table[][256] = {
+  /* VEX_0F */
   {
     /* 00 */
     { "(bad)",         { XX } },
@@ -3069,6 +7040,15 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 10 */
+    { PREFIX_TABLE (PREFIX_VEX_10) },
+    { PREFIX_TABLE (PREFIX_VEX_11) },
+    { PREFIX_TABLE (PREFIX_VEX_12) },
+    { MOD_TABLE (MOD_VEX_13) },
+    { "vunpcklpX",     { XM, Vex, EXx } },
+    { "vunpckhpX",     { XM, Vex, EXx } },
+    { PREFIX_TABLE (PREFIX_VEX_16) },
+    { MOD_TABLE (MOD_VEX_17) },
+    /* 18 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -3077,7 +7057,7 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 18 */
+    /* 20 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -3086,7 +7066,16 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 20 */
+    /* 28 */
+    { "vmovapX",       { XM, EXx } },
+    { "vmovapX",       { EXxS, XM } },
+    { PREFIX_TABLE (PREFIX_VEX_2A) },
+    { MOD_TABLE (MOD_VEX_2B) },
+    { PREFIX_TABLE (PREFIX_VEX_2C) },
+    { PREFIX_TABLE (PREFIX_VEX_2D) },
+    { PREFIX_TABLE (PREFIX_VEX_2E) },
+    { PREFIX_TABLE (PREFIX_VEX_2F) },
+    /* 30 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -3095,88 +7084,125 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 28 */
+    /* 38 */
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "comps",         { { OP_DREX3, q_mode }, { OP_DREX_FCMP, b_mode } } },
-    { "compd",         { { OP_DREX3, q_mode }, { OP_DREX_FCMP, b_mode } } },
-    { "comss",         { { OP_DREX3, w_mode }, { OP_DREX_FCMP, b_mode } } },
-    { "comsd",         { { OP_DREX3, d_mode }, { OP_DREX_FCMP, b_mode } } },
-    /* 30 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 40 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 38 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 48 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 40 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 50 */
+    { MOD_TABLE (MOD_VEX_51) },
+    { PREFIX_TABLE (PREFIX_VEX_51) },
+    { PREFIX_TABLE (PREFIX_VEX_52) },
+    { PREFIX_TABLE (PREFIX_VEX_53) },
+    { "vandpX",                { XM, Vex, EXx } },
+    { "vandnpX",       { XM, Vex, EXx } },
+    { "vorpX",         { XM, Vex, EXx } },
+    { "vxorpX",                { XM, Vex, EXx } },
+    /* 58 */
+    { PREFIX_TABLE (PREFIX_VEX_58) },
+    { PREFIX_TABLE (PREFIX_VEX_59) },
+    { PREFIX_TABLE (PREFIX_VEX_5A) },
+    { PREFIX_TABLE (PREFIX_VEX_5B) },
+    { PREFIX_TABLE (PREFIX_VEX_5C) },
+    { PREFIX_TABLE (PREFIX_VEX_5D) },
+    { PREFIX_TABLE (PREFIX_VEX_5E) },
+    { PREFIX_TABLE (PREFIX_VEX_5F) },
+    /* 60 */
+    { PREFIX_TABLE (PREFIX_VEX_60) },
+    { PREFIX_TABLE (PREFIX_VEX_61) },
+    { PREFIX_TABLE (PREFIX_VEX_62) },
+    { PREFIX_TABLE (PREFIX_VEX_63) },
+    { PREFIX_TABLE (PREFIX_VEX_64) },
+    { PREFIX_TABLE (PREFIX_VEX_65) },
+    { PREFIX_TABLE (PREFIX_VEX_66) },
+    { PREFIX_TABLE (PREFIX_VEX_67) },
+    /* 68 */
+    { PREFIX_TABLE (PREFIX_VEX_68) },
+    { PREFIX_TABLE (PREFIX_VEX_69) },
+    { PREFIX_TABLE (PREFIX_VEX_6A) },
+    { PREFIX_TABLE (PREFIX_VEX_6B) },
+    { PREFIX_TABLE (PREFIX_VEX_6C) },
+    { PREFIX_TABLE (PREFIX_VEX_6D) },
+    { PREFIX_TABLE (PREFIX_VEX_6E) },
+    { PREFIX_TABLE (PREFIX_VEX_6F) },
+    /* 70 */
+    { PREFIX_TABLE (PREFIX_VEX_70) },
+    { REG_TABLE (REG_VEX_71) },
+    { REG_TABLE (REG_VEX_72) },
+    { REG_TABLE (REG_VEX_73) },
+    { PREFIX_TABLE (PREFIX_VEX_74) },
+    { PREFIX_TABLE (PREFIX_VEX_75) },
+    { PREFIX_TABLE (PREFIX_VEX_76) },
+    { PREFIX_TABLE (PREFIX_VEX_77) },
+    /* 78 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_7C) },
+    { PREFIX_TABLE (PREFIX_VEX_7D) },
+    { PREFIX_TABLE (PREFIX_VEX_7E) },
+    { PREFIX_TABLE (PREFIX_VEX_7F) },
+    /* 80 */
     { "(bad)",         { XX } },
-    /* 48 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pcomb",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomw",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomd",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomq",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    /* 50 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 88 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 58 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 90 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 60 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 98 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 68 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* a0 */
     { "(bad)",         { XX } },
-    { "pcomub",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomuw",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomud",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomuq",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    /* 70 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -3184,1386 +7210,1860 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* a8 */
     { "(bad)",         { XX } },
-    /* 78 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { REG_TABLE (REG_VEX_AE) },
     { "(bad)",         { XX } },
+    /* b0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 80 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* b8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 88 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* c0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 90 */
+    { PREFIX_TABLE (PREFIX_VEX_C2) },
     { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_C4) },
+    { PREFIX_TABLE (PREFIX_VEX_C5) },
+    { "vshufpX",       { XM, Vex, EXx, Ib } },
     { "(bad)",         { XX } },
+    /* c8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 98 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* d0 */
+    { PREFIX_TABLE (PREFIX_VEX_D0) },
+    { PREFIX_TABLE (PREFIX_VEX_D1) },
+    { PREFIX_TABLE (PREFIX_VEX_D2) },
+    { PREFIX_TABLE (PREFIX_VEX_D3) },
+    { PREFIX_TABLE (PREFIX_VEX_D4) },
+    { PREFIX_TABLE (PREFIX_VEX_D5) },
+    { PREFIX_TABLE (PREFIX_VEX_D6) },
+    { PREFIX_TABLE (PREFIX_VEX_D7) },
+    /* d8 */
+    { PREFIX_TABLE (PREFIX_VEX_D8) },
+    { PREFIX_TABLE (PREFIX_VEX_D9) },
+    { PREFIX_TABLE (PREFIX_VEX_DA) },
+    { PREFIX_TABLE (PREFIX_VEX_DB) },
+    { PREFIX_TABLE (PREFIX_VEX_DC) },
+    { PREFIX_TABLE (PREFIX_VEX_DD) },
+    { PREFIX_TABLE (PREFIX_VEX_DE) },
+    { PREFIX_TABLE (PREFIX_VEX_DF) },
+    /* e0 */
+    { PREFIX_TABLE (PREFIX_VEX_E0) },
+    { PREFIX_TABLE (PREFIX_VEX_E1) },
+    { PREFIX_TABLE (PREFIX_VEX_E2) },
+    { PREFIX_TABLE (PREFIX_VEX_E3) },
+    { PREFIX_TABLE (PREFIX_VEX_E4) },
+    { PREFIX_TABLE (PREFIX_VEX_E5) },
+    { PREFIX_TABLE (PREFIX_VEX_E6) },
+    { PREFIX_TABLE (PREFIX_VEX_E7) },
+    /* e8 */
+    { PREFIX_TABLE (PREFIX_VEX_E8) },
+    { PREFIX_TABLE (PREFIX_VEX_E9) },
+    { PREFIX_TABLE (PREFIX_VEX_EA) },
+    { PREFIX_TABLE (PREFIX_VEX_EB) },
+    { PREFIX_TABLE (PREFIX_VEX_EC) },
+    { PREFIX_TABLE (PREFIX_VEX_ED) },
+    { PREFIX_TABLE (PREFIX_VEX_EE) },
+    { PREFIX_TABLE (PREFIX_VEX_EF) },
+    /* f0 */
+    { PREFIX_TABLE (PREFIX_VEX_F0) },
+    { PREFIX_TABLE (PREFIX_VEX_F1) },
+    { PREFIX_TABLE (PREFIX_VEX_F2) },
+    { PREFIX_TABLE (PREFIX_VEX_F3) },
+    { PREFIX_TABLE (PREFIX_VEX_F4) },
+    { PREFIX_TABLE (PREFIX_VEX_F5) },
+    { PREFIX_TABLE (PREFIX_VEX_F6) },
+    { PREFIX_TABLE (PREFIX_VEX_F7) },
+    /* f8 */
+    { PREFIX_TABLE (PREFIX_VEX_F8) },
+    { PREFIX_TABLE (PREFIX_VEX_F9) },
+    { PREFIX_TABLE (PREFIX_VEX_FA) },
+    { PREFIX_TABLE (PREFIX_VEX_FB) },
+    { PREFIX_TABLE (PREFIX_VEX_FC) },
+    { PREFIX_TABLE (PREFIX_VEX_FD) },
+    { PREFIX_TABLE (PREFIX_VEX_FE) },
     { "(bad)",         { XX } },
+  },
+  /* VEX_0F38 */
+  {
+    /* 00 */
+    { PREFIX_TABLE (PREFIX_VEX_3800) },
+    { PREFIX_TABLE (PREFIX_VEX_3801) },
+    { PREFIX_TABLE (PREFIX_VEX_3802) },
+    { PREFIX_TABLE (PREFIX_VEX_3803) },
+    { PREFIX_TABLE (PREFIX_VEX_3804) },
+    { PREFIX_TABLE (PREFIX_VEX_3805) },
+    { PREFIX_TABLE (PREFIX_VEX_3806) },
+    { PREFIX_TABLE (PREFIX_VEX_3807) },
+    /* 08 */
+    { PREFIX_TABLE (PREFIX_VEX_3808) },
+    { PREFIX_TABLE (PREFIX_VEX_3809) },
+    { PREFIX_TABLE (PREFIX_VEX_380A) },
+    { PREFIX_TABLE (PREFIX_VEX_380B) },
+    { PREFIX_TABLE (PREFIX_VEX_380C) },
+    { PREFIX_TABLE (PREFIX_VEX_380D) },
+    { PREFIX_TABLE (PREFIX_VEX_380E) },
+    { PREFIX_TABLE (PREFIX_VEX_380F) },
+    /* 10 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* a0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3817) },
+    /* 18 */
+    { PREFIX_TABLE (PREFIX_VEX_3818) },
+    { PREFIX_TABLE (PREFIX_VEX_3819) },
+    { PREFIX_TABLE (PREFIX_VEX_381A) },
     { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_381C) },
+    { PREFIX_TABLE (PREFIX_VEX_381D) },
+    { PREFIX_TABLE (PREFIX_VEX_381E) },
     { "(bad)",         { XX } },
+    /* 20 */
+    { PREFIX_TABLE (PREFIX_VEX_3820) },
+    { PREFIX_TABLE (PREFIX_VEX_3821) },
+    { PREFIX_TABLE (PREFIX_VEX_3822) },
+    { PREFIX_TABLE (PREFIX_VEX_3823) },
+    { PREFIX_TABLE (PREFIX_VEX_3824) },
+    { PREFIX_TABLE (PREFIX_VEX_3825) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 28 */
+    { PREFIX_TABLE (PREFIX_VEX_3828) },
+    { PREFIX_TABLE (PREFIX_VEX_3829) },
+    { PREFIX_TABLE (PREFIX_VEX_382A) },
+    { PREFIX_TABLE (PREFIX_VEX_382B) },
+    { PREFIX_TABLE (PREFIX_VEX_382C) },
+    { PREFIX_TABLE (PREFIX_VEX_382D) },
+    { PREFIX_TABLE (PREFIX_VEX_382E) },
+    { PREFIX_TABLE (PREFIX_VEX_382F) },
+    /* 30 */
+    { PREFIX_TABLE (PREFIX_VEX_3830) },
+    { PREFIX_TABLE (PREFIX_VEX_3831) },
+    { PREFIX_TABLE (PREFIX_VEX_3832) },
+    { PREFIX_TABLE (PREFIX_VEX_3833) },
+    { PREFIX_TABLE (PREFIX_VEX_3834) },
+    { PREFIX_TABLE (PREFIX_VEX_3835) },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3837) },
+    /* 38 */
+    { PREFIX_TABLE (PREFIX_VEX_3838) },
+    { PREFIX_TABLE (PREFIX_VEX_3839) },
+    { PREFIX_TABLE (PREFIX_VEX_383A) },
+    { PREFIX_TABLE (PREFIX_VEX_383B) },
+    { PREFIX_TABLE (PREFIX_VEX_383C) },
+    { PREFIX_TABLE (PREFIX_VEX_383D) },
+    { PREFIX_TABLE (PREFIX_VEX_383E) },
+    { PREFIX_TABLE (PREFIX_VEX_383F) },
+    /* 40 */
+    { PREFIX_TABLE (PREFIX_VEX_3840) },
+    { PREFIX_TABLE (PREFIX_VEX_3841) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* a8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 48 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* b0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 50 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* b8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 58 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* c0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 60 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* c8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 68 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* d0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 70 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* d8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 78 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* e0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 80 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* e8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 88 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* f0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 90 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* f8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3896) },
+    { PREFIX_TABLE (PREFIX_VEX_3897) },
+    /* 98 */
+    { PREFIX_TABLE (PREFIX_VEX_3898) },
+    { PREFIX_TABLE (PREFIX_VEX_3899) },
+    { PREFIX_TABLE (PREFIX_VEX_389A) },
+    { PREFIX_TABLE (PREFIX_VEX_389B) },
+    { PREFIX_TABLE (PREFIX_VEX_389C) },
+    { PREFIX_TABLE (PREFIX_VEX_389D) },
+    { PREFIX_TABLE (PREFIX_VEX_389E) },
+    { PREFIX_TABLE (PREFIX_VEX_389F) },
+    /* a0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-  },
-  /* THREE_BYTE_0F38 */
-  {
-    /* 00 */
-    { "pshufb", { MX, EM } },
-    { "phaddw", { MX, EM } },
-    { "phaddd",        { MX, EM } },
-    { "phaddsw", { MX, EM } },
-    { "pmaddubsw", { MX, EM } },
-    { "phsubw", { MX, EM } },
-    { "phsubd", { MX, EM } },
-    { "phsubsw", { MX, EM } },
-    /* 08 */
-    { "psignb", { MX, EM } },
-    { "psignw", { MX, EM } },
-    { "psignd", { MX, EM } },
-    { "pmulhrsw", { MX, EM } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 10 */
-    { PREFIX_TABLE (PREFIX_0F3810) },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { PREFIX_TABLE (PREFIX_0F3814) },
-    { PREFIX_TABLE (PREFIX_0F3815) },
-    { "(bad)", { XX } },
-    { PREFIX_TABLE (PREFIX_0F3817) },
-    /* 18 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "pabsb", { MX, EM } },
-    { "pabsw", { MX, EM } },
-    { "pabsd", { MX, EM } },
-    { "(bad)", { XX } },
-    /* 20 */
-    { PREFIX_TABLE (PREFIX_0F3820) },
-    { PREFIX_TABLE (PREFIX_0F3821) },
-    { PREFIX_TABLE (PREFIX_0F3822) },
-    { PREFIX_TABLE (PREFIX_0F3823) },
-    { PREFIX_TABLE (PREFIX_0F3824) },
-    { PREFIX_TABLE (PREFIX_0F3825) },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 28 */
-    { PREFIX_TABLE (PREFIX_0F3828) },
-    { PREFIX_TABLE (PREFIX_0F3829) },
-    { PREFIX_TABLE (PREFIX_0F382A) },
-    { PREFIX_TABLE (PREFIX_0F382B) },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 30 */
-    { PREFIX_TABLE (PREFIX_0F3830) },
-    { PREFIX_TABLE (PREFIX_0F3831) },
-    { PREFIX_TABLE (PREFIX_0F3832) },
-    { PREFIX_TABLE (PREFIX_0F3833) },
-    { PREFIX_TABLE (PREFIX_0F3834) },
-    { PREFIX_TABLE (PREFIX_0F3835) },
-    { "(bad)", { XX } },
-    { PREFIX_TABLE (PREFIX_0F3837) },
-    /* 38 */
-    { PREFIX_TABLE (PREFIX_0F3838) },
-    { PREFIX_TABLE (PREFIX_0F3839) },
-    { PREFIX_TABLE (PREFIX_0F383A) },
-    { PREFIX_TABLE (PREFIX_0F383B) },
-    { PREFIX_TABLE (PREFIX_0F383C) },
-    { PREFIX_TABLE (PREFIX_0F383D) },
-    { PREFIX_TABLE (PREFIX_0F383E) },
-    { PREFIX_TABLE (PREFIX_0F383F) },
-    /* 40 */
-    { PREFIX_TABLE (PREFIX_0F3840) },
-    { PREFIX_TABLE (PREFIX_0F3841) },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 48 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 50 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 58 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 60 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 68 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 70 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 78 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 80 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 88 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 90 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 98 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* a0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_38A6) },
+    { PREFIX_TABLE (PREFIX_VEX_38A7) },
     /* a8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_38A8) },
+    { PREFIX_TABLE (PREFIX_VEX_38A9) },
+    { PREFIX_TABLE (PREFIX_VEX_38AA) },
+    { PREFIX_TABLE (PREFIX_VEX_38AB) },
+    { PREFIX_TABLE (PREFIX_VEX_38AC) },
+    { PREFIX_TABLE (PREFIX_VEX_38AD) },
+    { PREFIX_TABLE (PREFIX_VEX_38AE) },
+    { PREFIX_TABLE (PREFIX_VEX_38AF) },
     /* b0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_38B6) },
+    { PREFIX_TABLE (PREFIX_VEX_38B7) },
     /* b8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_38B8) },
+    { PREFIX_TABLE (PREFIX_VEX_38B9) },
+    { PREFIX_TABLE (PREFIX_VEX_38BA) },
+    { PREFIX_TABLE (PREFIX_VEX_38BB) },
+    { PREFIX_TABLE (PREFIX_VEX_38BC) },
+    { PREFIX_TABLE (PREFIX_VEX_38BD) },
+    { PREFIX_TABLE (PREFIX_VEX_38BE) },
+    { PREFIX_TABLE (PREFIX_VEX_38BF) },
     /* c0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* c8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* d0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* d8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_38DB) },
+    { PREFIX_TABLE (PREFIX_VEX_38DC) },
+    { PREFIX_TABLE (PREFIX_VEX_38DD) },
+    { PREFIX_TABLE (PREFIX_VEX_38DE) },
+    { PREFIX_TABLE (PREFIX_VEX_38DF) },
     /* e0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* e8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* f0 */
-    { PREFIX_TABLE (PREFIX_0F38F0) },
-    { PREFIX_TABLE (PREFIX_0F38F1) },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* f8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
   },
-  /* THREE_BYTE_0F3A */
+  /* VEX_0F3A */
   {
     /* 00 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A04) },
+    { PREFIX_TABLE (PREFIX_VEX_3A05) },
+    { PREFIX_TABLE (PREFIX_VEX_3A06) },
+    { "(bad)",         { XX } },
     /* 08 */
-    { PREFIX_TABLE (PREFIX_0F3A08) },
-    { PREFIX_TABLE (PREFIX_0F3A09) },
-    { PREFIX_TABLE (PREFIX_0F3A0A) },
-    { PREFIX_TABLE (PREFIX_0F3A0B) },
-    { PREFIX_TABLE (PREFIX_0F3A0C) },
-    { PREFIX_TABLE (PREFIX_0F3A0D) },
-    { PREFIX_TABLE (PREFIX_0F3A0E) },
-    { "palignr", { MX, EM, Ib } },
+    { PREFIX_TABLE (PREFIX_VEX_3A08) },
+    { PREFIX_TABLE (PREFIX_VEX_3A09) },
+    { PREFIX_TABLE (PREFIX_VEX_3A0A) },
+    { PREFIX_TABLE (PREFIX_VEX_3A0B) },
+    { PREFIX_TABLE (PREFIX_VEX_3A0C) },
+    { PREFIX_TABLE (PREFIX_VEX_3A0D) },
+    { PREFIX_TABLE (PREFIX_VEX_3A0E) },
+    { PREFIX_TABLE (PREFIX_VEX_3A0F) },
     /* 10 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { PREFIX_TABLE (PREFIX_0F3A14) },
-    { PREFIX_TABLE (PREFIX_0F3A15) },
-    { PREFIX_TABLE (PREFIX_0F3A16) },
-    { PREFIX_TABLE (PREFIX_0F3A17) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A14) },
+    { PREFIX_TABLE (PREFIX_VEX_3A15) },
+    { PREFIX_TABLE (PREFIX_VEX_3A16) },
+    { PREFIX_TABLE (PREFIX_VEX_3A17) },
     /* 18 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A18) },
+    { PREFIX_TABLE (PREFIX_VEX_3A19) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 20 */
-    { PREFIX_TABLE (PREFIX_0F3A20) },
-    { PREFIX_TABLE (PREFIX_0F3A21) },
-    { PREFIX_TABLE (PREFIX_0F3A22) },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A20) },
+    { PREFIX_TABLE (PREFIX_VEX_3A21) },
+    { PREFIX_TABLE (PREFIX_VEX_3A22) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 28 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 30 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 38 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 40 */
-    { PREFIX_TABLE (PREFIX_0F3A40) },
-    { PREFIX_TABLE (PREFIX_0F3A41) },
-    { PREFIX_TABLE (PREFIX_0F3A42) },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A40) },
+    { PREFIX_TABLE (PREFIX_VEX_3A41) },
+    { PREFIX_TABLE (PREFIX_VEX_3A42) },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A44) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 48 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A4A) },
+    { PREFIX_TABLE (PREFIX_VEX_3A4B) },
+    { PREFIX_TABLE (PREFIX_VEX_3A4C) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 50 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 58 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 60 */
-    { PREFIX_TABLE (PREFIX_0F3A60) },
-    { PREFIX_TABLE (PREFIX_0F3A61) },
-    { PREFIX_TABLE (PREFIX_0F3A62) },
-    { PREFIX_TABLE (PREFIX_0F3A63) },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A60) },
+    { PREFIX_TABLE (PREFIX_VEX_3A61) },
+    { PREFIX_TABLE (PREFIX_VEX_3A62) },
+    { PREFIX_TABLE (PREFIX_VEX_3A63) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 68 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 70 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 78 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 80 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 88 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 90 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 98 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* a0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* a8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* b0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* b8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* c0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* c8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* c8 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* d0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* d8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3ADF) },
     /* e0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* e8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* f0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* f8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+  },
+};
+
+static const struct dis386 vex_len_table[][2] = {
+  /* VEX_LEN_10_P_1 */
+  {
+    { "vmovss",                { XMVex, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_10_P_3 */
+  {
+    { "vmovsd",                { XMVex, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_11_P_1 */
+  {
+    { "vmovss",                { EXdVexS, Vex128, XM } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_11_P_3 */
+  {
+    { "vmovsd",                { EXqVexS, Vex128, XM } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_12_P_0_M_0 */
+  {
+    { "vmovlps",       { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_12_P_0_M_1 */
+  {
+    { "vmovhlps",      { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_12_P_2 */
+  {
+    { "vmovlpd",       { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_13_M_0 */
+  {
+    { "vmovlpX",       { EXq, XM } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_16_P_0_M_0 */
+  {
+    { "vmovhps",       { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_16_P_0_M_1 */
+  {
+    { "vmovlhps",      { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_16_P_2 */
+  {
+    { "vmovhpd",       { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_17_M_0 */
+  {
+    { "vmovhpX",       { EXq, XM } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2A_P_1 */
+  {
+    { "vcvtsi2ss%LQ",  { XM, Vex128, Ev } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2A_P_3 */
+  {
+    { "vcvtsi2sd%LQ",  { XM, Vex128, Ev } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2C_P_1 */
+  {
+    { "vcvttss2siY",   { Gv, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2C_P_3 */
+  {
+    { "vcvttsd2siY",   { Gv, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2D_P_1 */
+  {
+    { "vcvtss2siY",    { Gv, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2D_P_3 */
+  {
+    { "vcvtsd2siY",    { Gv, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2E_P_0 */
+  {
+    { "vucomiss",      { XM, EXd } }, 
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2E_P_2 */
+  {
+    { "vucomisd",      { XM, EXq } }, 
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2F_P_0 */
+  {
+    { "vcomiss",       { XM, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2F_P_2 */
+  {
+    { "vcomisd",       { XM, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_51_P_1 */
+  {
+    { "vsqrtss",       { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_51_P_3 */
+  {
+    { "vsqrtsd",       { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_52_P_1 */
+  {
+    { "vrsqrtss",      { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_53_P_1 */
+  {
+    { "vrcpss",                { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_58_P_1 */
+  {
+    { "vaddss",                { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_58_P_3 */
+  {
+    { "vaddsd",                { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_59_P_1 */
+  {
+    { "vmulss",                { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_59_P_3 */
+  {
+    { "vmulsd",                { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5A_P_1 */
+  {
+    { "vcvtss2sd",     { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5A_P_3 */
+  {
+    { "vcvtsd2ss",     { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5C_P_1 */
+  {
+    { "vsubss",                { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5C_P_3 */
+  {
+    { "vsubsd",                { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5D_P_1 */
+  {
+    { "vminss",                { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5D_P_3 */
+  {
+    { "vminsd",                { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5E_P_1 */
+  {
+    { "vdivss",                { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5E_P_3 */
+  {
+    { "vdivsd",                { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
   },
-  /* THREE_BYTE_0F7A */
+
+  /* VEX_LEN_5F_P_1 */
   {
-    /* 00 */
+    { "vmaxss",                { XM, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5F_P_3 */
+  {
+    { "vmaxsd",                { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_60_P_2 */
+  {
+    { "vpunpcklbw",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_61_P_2 */
+  {
+    { "vpunpcklwd",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_62_P_2 */
+  {
+    { "vpunpckldq",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_63_P_2 */
+  {
+    { "vpacksswb",     { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_64_P_2 */
+  {
+    { "vpcmpgtb",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_65_P_2 */
+  {
+    { "vpcmpgtw",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_66_P_2 */
+  {
+    { "vpcmpgtd",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
-    /* 08 */
+  },
+
+  /* VEX_LEN_67_P_2 */
+  {
+    { "vpackuswb",     { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_68_P_2 */
+  {
+    { "vpunpckhbw",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_69_P_2 */
+  {
+    { "vpunpckhwd",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6A_P_2 */
+  {
+    { "vpunpckhdq",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6B_P_2 */
+  {
+    { "vpackssdw",     { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6C_P_2 */
+  {
+    { "vpunpcklqdq",   { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6D_P_2 */
+  {
+    { "vpunpckhqdq",   { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6E_P_2 */
+  {
+    { "vmovK",         { XM, Edq } },
     { "(bad)",         { XX } },
-    /* 10 */
-    { "frczps",                { XM, EXq } },
-    { "frczpd",                { XM, EXq } },
-    { "frczss",                { XM, EXq } },
-    { "frczsd",                { XM, EXq } },
+  },
+
+  /* VEX_LEN_70_P_1 */
+  {
+    { "vpshufhw",      { XM, EXx, Ib } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_70_P_2 */
+  {
+    { "vpshufd",       { XM, EXx, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_70_P_3 */
+  {
+    { "vpshuflw",      { XM, EXx, Ib } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_71_R_2_P_2 */
+  {
+    { "vpsrlw",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_71_R_4_P_2 */
+  {
+    { "vpsraw",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
-    /* 18 */
+  },
+
+  /* VEX_LEN_71_R_6_P_2 */
+  {
+    { "vpsllw",                { Vex128, XS, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_72_R_2_P_2 */
+  {
+    { "vpsrld",                { Vex128, XS, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_72_R_4_P_2 */
+  {
+    { "vpsrad",                { Vex128, XS, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_72_R_6_P_2 */
+  {
+    { "vpslld",                { Vex128, XS, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_73_R_2_P_2 */
+  {
+    { "vpsrlq",                { Vex128, XS, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_73_R_3_P_2 */
+  {
+    { "vpsrldq",       { Vex128, XS, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_73_R_6_P_2 */
+  {
+    { "vpsllq",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_73_R_7_P_2 */
+  {
+    { "vpslldq",       { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_74_P_2 */
+  {
+    { "vpcmpeqb",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_75_P_2 */
+  {
+    { "vpcmpeqw",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_76_P_2 */
+  {
+    { "vpcmpeqd",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_7E_P_1 */
+  {
+    { "vmovq",         { XM, EXq } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_7E_P_2 */
+  {
+    { "vmovK",         { Edq, XM } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_AE_R_2_M0 */
+  {
+    { "vldmxcsr",      { Md } },
     { "(bad)",         { XX } },
-    /* 20 */
-    { "ptest",         { XX } },
+  },
+
+  /* VEX_LEN_AE_R_3_M0 */
+  {
+    { "vstmxcsr",      { Md } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_C2_P_1 */
+  {
+    { "vcmpss",                { XM, Vex128, EXd, VCMP } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_C2_P_3 */
+  {
+    { "vcmpsd",                { XM, Vex128, EXq, VCMP } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_C4_P_2 */
+  {
+    { "vpinsrw",       { XM, Vex128, Edqw, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_C5_P_2 */
+  {
+    { "vpextrw",       { Gdq, XS, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D1_P_2 */
+  {
+    { "vpsrlw",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D2_P_2 */
+  {
+    { "vpsrld",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D3_P_2 */
+  {
+    { "vpsrlq",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D4_P_2 */
+  {
+    { "vpaddq",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D5_P_2 */
+  {
+    { "vpmullw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D6_P_2 */
+  {
+    { "vmovq",         { EXqS, XM } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D7_P_2_M_1 */
+  {
+    { "vpmovmskb",     { Gdq, XS } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D8_P_2 */
+  {
+    { "vpsubusb",      { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D9_P_2 */
+  {
+    { "vpsubusw",      { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DA_P_2 */
+  {
+    { "vpminub",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DB_P_2 */
+  {
+    { "vpand",         { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DC_P_2 */
+  {
+    { "vpaddusb",      { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DD_P_2 */
+  {
+    { "vpaddusw",      { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DE_P_2 */
+  {
+    { "vpmaxub",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DF_P_2 */
+  {
+    { "vpandn",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E0_P_2 */
+  {
+    { "vpavgb",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E1_P_2 */
+  {
+    { "vpsraw",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E2_P_2 */
+  {
+    { "vpsrad",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E3_P_2 */
+  {
+    { "vpavgw",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E4_P_2 */
+  {
+    { "vpmulhuw",      { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E5_P_2 */
+  {
+    { "vpmulhw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E8_P_2 */
+  {
+    { "vpsubsb",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E9_P_2 */
+  {
+    { "vpsubsw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EA_P_2 */
+  {
+    { "vpminsw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EB_P_2 */
+  {
+    { "vpor",          { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EC_P_2 */
+  {
+    { "vpaddsb",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_ED_P_2 */
+  {
+    { "vpaddsw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EE_P_2 */
+  {
+    { "vpmaxsw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EF_P_2 */
+  {
+    { "vpxor",         { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F1_P_2 */
+  {
+    { "vpsllw",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F2_P_2 */
+  {
+    { "vpslld",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F3_P_2 */
+  {
+    { "vpsllq",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F4_P_2 */
+  {
+    { "vpmuludq",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F5_P_2 */
+  {
+    { "vpmaddwd",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
-    /* 28 */
+  },
+
+  /* VEX_LEN_F6_P_2 */
+  {
+    { "vpsadbw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F7_P_2 */
+  {
+    { "vmaskmovdqu",   { XM, XS } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F8_P_2 */
+  {
+    { "vpsubb",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F9_P_2 */
+  {
+    { "vpsubw",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 30 */
-    { "cvtph2ps",      { XM, EXd } },
-    { "cvtps2ph",      { EXd, XM } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 38 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 40 */
-    { "(bad)", { XX } },
-    { "phaddbw",       { XM, EXq } },
-    { "phaddbd",       { XM, EXq } },
-    { "phaddbq",       { XM, EXq } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "phaddwd",       { XM, EXq } },
-    { "phaddwq",       { XM, EXq } },
-    /* 48 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "phadddq",       { XM, EXq } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 50 */
-    { "(bad)", { XX } },
-    { "phaddubw",      { XM, EXq } },
-    { "phaddubd",      { XM, EXq } },
-    { "phaddubq",      { XM, EXq } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "phadduwd",      { XM, EXq } },
-    { "phadduwq",      { XM, EXq } },
-    /* 58 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "phaddudq",      { XM, EXq } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 60 */
-    { "(bad)", { XX } },
-    { "phsubbw",       { XM, EXq } },
-    { "phsubbd",       { XM, EXq } },
-    { "phsubbq",       { XM, EXq } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 68 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 70 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 78 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 80 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 88 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 90 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 98 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* a0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* a8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* b0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* b8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* c0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* c8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* d0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* d8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* e0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* e8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* f0 */
+  },
+
+  /* VEX_LEN_FA_P_2 */
+  {
+    { "vpsubd",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_FB_P_2 */
+  {
+    { "vpsubq",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* f8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
   },
-  /* THREE_BYTE_0F7B */
+
+  /* VEX_LEN_FC_P_2 */
   {
-    /* 00 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 08 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 10 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 18 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 20 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 28 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 30 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { "vpaddb",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_FD_P_2 */
+  {
+    { "vpaddw",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_FE_P_2 */
+  {
+    { "vpaddd",                { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3800_P_2 */
+  {
+    { "vpshufb",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3801_P_2 */
+  {
+    { "vphaddw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3802_P_2 */
+  {
+    { "vphaddd",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3803_P_2 */
+  {
+    { "vphaddsw",      { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3804_P_2 */
+  {
+    { "vpmaddubsw",    { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3805_P_2 */
+  {
+    { "vphsubw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3806_P_2 */
+  {
+    { "vphsubd",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3807_P_2 */
+  {
+    { "vphsubsw",      { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3808_P_2 */
+  {
+    { "vpsignb",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3809_P_2 */
+  {
+    { "vpsignw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_380A_P_2 */
+  {
+    { "vpsignd",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_380B_P_2 */
+  {
+    { "vpmulhrsw",     { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3819_P_2_M_0 */
+  {
+    { "(bad)",         { XX } },
+    { "vbroadcastsd",  { XM, Mq } },
+  },
+
+  /* VEX_LEN_381A_P_2_M_0 */
+  {
+    { "(bad)",         { XX } },
+    { "vbroadcastf128",        { XM, Mxmm } },
+  },
+
+  /* VEX_LEN_381C_P_2 */
+  {
+    { "vpabsb",                { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_381D_P_2 */
+  {
+    { "vpabsw",                { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_381E_P_2 */
+  {
+    { "vpabsd",                { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3820_P_2 */
+  {
+    { "vpmovsxbw",     { XM, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3821_P_2 */
+  {
+    { "vpmovsxbd",     { XM, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3822_P_2 */
+  {
+    { "vpmovsxbq",     { XM, EXw } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3823_P_2 */
+  {
+    { "vpmovsxwd",     { XM, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3824_P_2 */
+  {
+    { "vpmovsxwq",     { XM, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3825_P_2 */
+  {
+    { "vpmovsxdq",     { XM, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3828_P_2 */
+  {
+    { "vpmuldq",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3829_P_2 */
+  {
+    { "vpcmpeqq",      { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_382A_P_2_M_0 */
+  {
+    { "vmovntdqa",     { XM, Mx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_382B_P_2 */
+  {
+    { "vpackusdw",     { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3830_P_2 */
+  {
+    { "vpmovzxbw",     { XM, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3831_P_2 */
+  {
+    { "vpmovzxbd",     { XM, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3832_P_2 */
+  {
+    { "vpmovzxbq",     { XM, EXw } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3833_P_2 */
+  {
+    { "vpmovzxwd",     { XM, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3834_P_2 */
+  {
+    { "vpmovzxwq",     { XM, EXd } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3835_P_2 */
+  {
+    { "vpmovzxdq",     { XM, EXq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3837_P_2 */
+  {
+    { "vpcmpgtq",      { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3838_P_2 */
+  {
+    { "vpminsb",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3839_P_2 */
+  {
+    { "vpminsd",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383A_P_2 */
+  {
+    { "vpminuw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383B_P_2 */
+  {
+    { "vpminud",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383C_P_2 */
+  {
+    { "vpmaxsb",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383D_P_2 */
+  {
+    { "vpmaxsd",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383E_P_2 */
+  {
+    { "vpmaxuw",       { XM, Vex128, EXx } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383F_P_2 */
+  {
+    { "vpmaxud",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3840_P_2 */
+  {
+    { "vpmulld",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
-    /* 38 */
+  },
+
+  /* VEX_LEN_3841_P_2 */
+  {
+    { "vphminposuw",   { XM, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_38DB_P_2 */
+  {
+    { "vaesimc",       { XM, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_38DC_P_2 */
+  {
+    { "vaesenc",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 40 */
-    { "protb",         { XM, EXq, Ib } },
-    { "protw",         { XM, EXq, Ib } },
-    { "protd",         { XM, EXq, Ib } },
-    { "protq",         { XM, EXq, Ib } },
-    { "pshlb",         { XM, EXq, Ib } },
-    { "pshlw",         { XM, EXq, Ib } },
-    { "pshld",         { XM, EXq, Ib } },
-    { "pshlq",         { XM, EXq, Ib } },
-    /* 48 */
-    { "pshab",         { XM, EXq, Ib } },
-    { "pshaw",         { XM, EXq, Ib } },
-    { "pshad",         { XM, EXq, Ib } },
-    { "pshaq",         { XM, EXq, Ib } },
+  },
+
+  /* VEX_LEN_38DD_P_2 */
+  {
+    { "vaesenclast",   { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 50 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 58 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 60 */
+  },
+
+  /* VEX_LEN_38DE_P_2 */
+  {
+    { "vaesdec",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_38DF_P_2 */
+  {
+    { "vaesdeclast",   { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A06_P_2 */
+  {
     { "(bad)",         { XX } },
+    { "vperm2f128",    { XM, Vex256, EXx, Ib } },
+  },
+
+  /* VEX_LEN_3A0A_P_2 */
+  {
+    { "vroundss",      { XM, Vex128, EXd, Ib } },
     { "(bad)",         { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 68 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 70 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 78 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 80 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 88 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 90 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* 98 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* a0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* a8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* b0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* b8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* c0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* c8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* d0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* d8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* e0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* e8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* f0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    /* f8 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-  }
-};
+  },
+
+  /* VEX_LEN_3A0B_P_2 */
+  {
+    { "vroundsd",      { XM, Vex128, EXq, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A0E_P_2 */
+  {
+    { "vpblendw",      { XM, Vex128, EXx, Ib } },
+    { "(bad)",         { XX } },
+  },
 
-static const struct dis386 mod_table[][2] = {
+  /* VEX_LEN_3A0F_P_2 */
   {
-    /* MOD_8D */
-    { "leaS",          { Gv, M } },
+    { "vpalignr",      { XM, Vex128, EXx, Ib } },
     { "(bad)",         { XX } },
   },
+
+  /* VEX_LEN_3A14_P_2 */
   {
-    /* MOD_0F13 */
-    { "movlpX",                { EXq, XM } },
+    { "vpextrb",       { Edqb, XM, Ib } },
     { "(bad)",         { XX } },
   },
+
+  /* VEX_LEN_3A15_P_2 */
   {
-    /* MOD_0F17 */
-    { "movhpX",                { EXq, XM } },
+    { "vpextrw",       { Edqw, XM, Ib } },
     { "(bad)",         { XX } },
   },
+
+  /* VEX_LEN_3A16_P_2  */
   {
-    /* MOD_0F20 */
+    { "vpextrK",       { Edq, XM, Ib } },
     { "(bad)",         { XX } },
-    { "movZ",          { Rm, Cm } },
   },
+
+  /* VEX_LEN_3A17_P_2 */
   {
-    /* MOD_0F21 */
+    { "vextractps",    { Edqd, XM, Ib } },
     { "(bad)",         { XX } },
-    { "movZ",          { Rm, Dm } },
   },
+
+  /* VEX_LEN_3A18_P_2 */
   {
-    /* MOD_0F22 */
     { "(bad)",         { XX } },
-    { "movZ",          { Cm, Rm } },
+    { "vinsertf128",   { XM, Vex256, EXxmm, Ib } },
   },
+
+  /* VEX_LEN_3A19_P_2 */
   {
-    /* MOD_0F23 */
     { "(bad)",         { XX } },
-    { "movZ",          { Dm, Rm } },
+    { "vextractf128",  { EXxmm, XM, Ib } },
   },
+
+  /* VEX_LEN_3A20_P_2 */
   {
-    /* MOD_0F24 */
-    { THREE_BYTE_TABLE (THREE_BYTE_0F24) },
-    { "movL",          { Rd, Td } },
+    { "vpinsrb",       { XM, Vex128, Edqb, Ib } },
+    { "(bad)",         { XX } },
   },
+
+  /* VEX_LEN_3A21_P_2 */
   {
-    /* MOD_0F26 */
+    { "vinsertps",     { XM, Vex128, EXd, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A22_P_2 */
+  {
+    { "vpinsrK",       { XM, Vex128, Edq, Ib } },
     { "(bad)",         { XX } },
-    { "movL",          { Td, Rd } },
   },
+
+  /* VEX_LEN_3A41_P_2 */
   {
-    /* MOD_0FB2 */
-    { "lssS",          { Gv, Mp } },
+    { "vdppd",         { XM, Vex128, EXx, Ib } },
     { "(bad)",         { XX } },
   },
+
+  /* VEX_LEN_3A42_P_2 */
   {
-    /* MOD_0FB4 */
-    { "lfsS",          { Gv, Mp } },
+    { "vmpsadbw",      { XM, Vex128, EXx, Ib } },
     { "(bad)",         { XX } },
   },
+
+  /* VEX_LEN_3A44_P_2 */
   {
-    /* MOD_0FB5 */
-    { "lgsS",          { Gv, Mp } },
+    { "vpclmulqdq",    { XM, Vex128, EXx, PCLMUL } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A4C_P_2 */
+  {
+    { "vpblendvb",     { XM, Vex128, EXx, XMVexI4 } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A60_P_2 */
+  {
+    { "vpcmpestrm",    { XM, EXx, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A61_P_2 */
+  {
+    { "vpcmpestri",    { XM, EXx, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A62_P_2 */
+  {
+    { "vpcmpistrm",    { XM, EXx, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A63_P_2 */
+  {
+    { "vpcmpistri",    { XM, EXx, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3ADF_P_2 */
+  {
+    { "vaeskeygenassist", { XM, EXx, Ib } },
+    { "(bad)",         { XX } },
+  },
+};
+
+static const struct dis386 mod_table[][2] = {
+  {
+    /* MOD_8D */
+    { "leaS",          { Gv, M } },
     { "(bad)",         { XX } },
   },
   {
@@ -4579,7 +9079,7 @@ static const struct dis386 mod_table[][2] = {
   {
     /* MOD_0F01_REG_2 */
     { X86_64_TABLE (X86_64_0F01_REG_2) },
-    { "(bad)",         { XX } },
+    { RM_TABLE (RM_0F01_REG_2) },
   },
   {
     /* MOD_0F01_REG_3 */
@@ -4591,6 +9091,26 @@ static const struct dis386 mod_table[][2] = {
     { "invlpg",                { Mb } },
     { RM_TABLE (RM_0F01_REG_7) },
   },
+  {
+    /* MOD_0F12_PREFIX_0 */
+    { "movlps",                { XM, EXq } },
+    { "movhlps",       { XM, EXq } },
+  },
+  {
+    /* MOD_0F13 */
+    { "movlpX",                { EXq, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0F16_PREFIX_0 */
+    { "movhps",                { XM, EXq } },
+    { "movlhps",       { XM, EXq } },
+  },
+  {
+    /* MOD_0F17 */
+    { "movhpX",                { EXq, XM } },
+    { "(bad)",         { XX } },
+  },
   {
     /* MOD_0F18_REG_0 */
     { "prefetchnta",   { Mb } },
@@ -4611,6 +9131,61 @@ static const struct dis386 mod_table[][2] = {
     { "prefetcht2",    { Mb } },
     { "(bad)",         { XX } },
   },
+  {
+    /* MOD_0F20 */
+    { "(bad)",         { XX } },
+    { "movZ",          { Rm, Cm } },
+  },
+  {
+    /* MOD_0F21 */
+    { "(bad)",         { XX } },
+    { "movZ",          { Rm, Dm } },
+  },
+  {
+    /* MOD_0F22 */
+    { "(bad)",         { XX } },
+    { "movZ",          { Cm, Rm } },
+  },
+  {
+    /* MOD_0F23 */
+    { "(bad)",         { XX } },
+    { "movZ",          { Dm, Rm } },
+  },
+  {
+    /* MOD_0F24 */
+    { THREE_BYTE_TABLE (THREE_BYTE_0F24) },
+    { "movL",          { Rd, Td } },
+  },
+  {
+    /* MOD_0F26 */
+    { "(bad)",         { XX } },
+    { "movL",          { Td, Rd } },
+  },
+  {
+    /* MOD_0F2B_PREFIX_0 */
+    {"movntps",                { Mx, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0F2B_PREFIX_1 */
+    {"movntss",                { Md, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0F2B_PREFIX_2 */
+    {"movntpd",                { Mx, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0F2B_PREFIX_3 */
+    {"movntsd",                { Mq, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0F51 */
+    { "(bad)",         { XX } },
+    { "movmskpX",      { Gdq, XS } },
+  },
   {
     /* MOD_0F71_REG_2 */
     { "(bad)",         { XX } },
@@ -4682,13 +9257,18 @@ static const struct dis386 mod_table[][2] = {
     { "(bad)",         { XX } },
   },
   {
-    /* MOD_0FAE_REG_5 */
+    /* MOD_0FAE_REG_4 */
+    { "xsave",         { M } },
     { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0FAE_REG_5 */
+    { "xrstor",                { M } },
     { RM_TABLE (RM_0FAE_REG_5) },
   },
   {
     /* MOD_0FAE_REG_6 */
-    { "(bad)",         { XX } },
+    { "xsaveopt",      { M } },
     { RM_TABLE (RM_0FAE_REG_6) },
   },
   {
@@ -4696,6 +9276,21 @@ static const struct dis386 mod_table[][2] = {
     { "clflush",       { Mb } },
     { RM_TABLE (RM_0FAE_REG_7) },
   },
+  {
+    /* MOD_0FB2 */
+    { "lssS",          { Gv, Mp } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0FB4 */
+    { "lfsS",          { Gv, Mp } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0FB5 */
+    { "lgsS",          { Gv, Mp } },
+    { "(bad)",         { XX } },
+  },
   {
     /* MOD_0FC7_REG_6 */
     { PREFIX_TABLE (PREFIX_0FC7_REG_6) },
@@ -4707,33 +9302,183 @@ static const struct dis386 mod_table[][2] = {
     { "(bad)",         { XX } },
   },
   {
-    /* MOD_0F12_PREFIX_0 */
-    { "movlps",                { XM, EXq } },
-    { "movhlps",       { XM, EXq } },
+    /* MOD_0FD7 */
+    { "(bad)",         { XX } },
+    { "pmovmskb",      { Gdq, MS } },
+  },
+  {
+    /* MOD_0FE7_PREFIX_2 */
+    { "movntdq",       { Mx, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0FF0_PREFIX_3 */
+    { "lddqu",         { XM, M } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_0F382A_PREFIX_2 */
+    { "movntdqa",      { XM, Mx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_62_32BIT */
+    { "bound{S|}",     { Gv, Ma } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_C4_32BIT */
+    { "lesS",          { Gv, Mp } },
+    { VEX_C4_TABLE (VEX_0F) },
+  },
+  {
+    /* MOD_C5_32BIT */
+    { "ldsS",          { Gv, Mp } },
+    { VEX_C5_TABLE (VEX_0F) },
+  },
+  {
+    /* MOD_VEX_12_PREFIX_0 */
+    { VEX_LEN_TABLE (VEX_LEN_12_P_0_M_0) },
+    { VEX_LEN_TABLE (VEX_LEN_12_P_0_M_1) },
+  },
+  {
+    /* MOD_VEX_13 */
+    { VEX_LEN_TABLE (VEX_LEN_13_M_0) },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_VEX_16_PREFIX_0 */
+    { VEX_LEN_TABLE (VEX_LEN_16_P_0_M_0) },
+    { VEX_LEN_TABLE (VEX_LEN_16_P_0_M_1) },
+  },
+  {
+    /* MOD_VEX_17 */
+    { VEX_LEN_TABLE (VEX_LEN_17_M_0) },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_VEX_2B */
+    { "vmovntpX",      { Mx, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_VEX_51 */
+    { "(bad)",         { XX } },
+    { "vmovmskpX",     { Gdq, XS } },
+  },
+  {
+    /* MOD_VEX_71_REG_2 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_71_REG_2) },
+  },
+  {
+    /* MOD_VEX_71_REG_4 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_71_REG_4) },
+  },
+  {
+    /* MOD_VEX_71_REG_6 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_71_REG_6) },
+  },
+  {
+    /* MOD_VEX_72_REG_2 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_72_REG_2) },
+  },
+  {
+    /* MOD_VEX_72_REG_4 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_72_REG_4) },
+  },
+  {
+    /* MOD_VEX_72_REG_6 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_72_REG_6) },
+  },
+  {
+    /* MOD_VEX_73_REG_2 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_73_REG_2) },
+  },
+  {
+    /* MOD_VEX_73_REG_3 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_73_REG_3) },
+  },
+  {
+    /* MOD_VEX_73_REG_6 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_73_REG_6) },
+  },
+  {
+    /* MOD_VEX_73_REG_7 */
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_73_REG_7) },
+  },
+  {
+    /* MOD_VEX_AE_REG_2 */
+    { VEX_LEN_TABLE (VEX_LEN_AE_R_2_M_0) },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_VEX_AE_REG_3 */
+    { VEX_LEN_TABLE (VEX_LEN_AE_R_3_M_0) },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_VEX_D7_PREFIX_2 */
+    { "(bad)",         { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_D7_P_2_M_1) },
+  },
+  {
+    /* MOD_VEX_E7_PREFIX_2 */
+    { "vmovntdq",      { Mx, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_VEX_F0_PREFIX_3 */
+    { "vlddqu",                { XM, M } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_VEX_3818_PREFIX_2 */
+    { "vbroadcastss",  { XM, Md } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_VEX_3819_PREFIX_2 */
+    { VEX_LEN_TABLE (VEX_LEN_3819_P_2_M_0) },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* MOD_VEX_381A_PREFIX_2 */
+    { VEX_LEN_TABLE (VEX_LEN_381A_P_2_M_0) },
+    { "(bad)",         { XX } },
   },
   {
-    /* MOD_0F16_PREFIX_0 */
-    { "movhps",                { XM, EXq } },
-    { "movlhps",       { XM, EXq } },
+    /* MOD_VEX_382A_PREFIX_2 */
+    { VEX_LEN_TABLE (VEX_LEN_382A_P_2_M_0) },
+    { "(bad)",         { XX } },
   },
   {
-    /* MOD_0FF0_PREFIX_3 */
-    { "lddqu",         { XM, M } },
+    /* MOD_VEX_382C_PREFIX_2 */
+    { "vmaskmovps",    { XM, Vex, Mx } },
     { "(bad)",         { XX } },
   },
   {
-    /* MOD_62_32BIT */
-    { "bound{S|}",     { Gv, Ma } },
+    /* MOD_VEX_382D_PREFIX_2 */
+    { "vmaskmovpd",    { XM, Vex, Mx } },
     { "(bad)",         { XX } },
   },
   {
-    /* MOD_C4_32BIT */
-    { "lesS",          { Gv, Mp } },
+    /* MOD_VEX_382E_PREFIX_2 */
+    { "vmaskmovps",    { Mx, Vex, XM } },
     { "(bad)",         { XX } },
   },
   {
-    /* MOD_C5_32BIT */
-    { "ldsS",          { Gv, Mp } },
+    /* MOD_VEX_382F_PREFIX_2 */
+    { "vmaskmovpd",    { Mx, Vex, XM } },
     { "(bad)",         { XX } },
   },
 };
@@ -4761,6 +9506,17 @@ static const struct dis386 rm_table[][8] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
   },
+  {
+    /* RM_0F01_REG_2 */
+    { "xgetbv",                { Skip_MODRM } },
+    { "xsetbv",                { Skip_MODRM } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+  },
   {
     /* RM_0F01_REG_3 */
     { "vmrun",         { Skip_MODRM } },
@@ -4825,6 +9581,8 @@ ckprefix (void)
 {
   int newrex;
   rex = 0;
+  rex_original = 0;
+  rex_ignored = 0;
   prefixes = 0;
   used_prefixes = 0;
   rex_used = 0;
@@ -4911,6 +9669,7 @@ ckprefix (void)
          return;
        }
       rex = newrex;
+      rex_original = rex;
       codep++;
     }
 }
@@ -5010,6 +9769,7 @@ static bfd_vma start_pc;
  */
 
 static char intel_syntax;
+static char intel_mnemonic = !SYSV386_COMPAT;
 static char open_char;
 static char close_char;
 static char separator_char;
@@ -5054,6 +9814,10 @@ with the -M switch (multiple options should be separated by commas):\n"));
   fprintf (stream, _("  i8086       Disassemble in 16bit mode\n"));
   fprintf (stream, _("  att         Display instruction in AT&T syntax\n"));
   fprintf (stream, _("  intel       Display instruction in Intel syntax\n"));
+  fprintf (stream, _("  att-mnemonic\n"
+                    "              Display instruction in AT&T mnemonic\n"));
+  fprintf (stream, _("  intel-mnemonic\n"
+                    "              Display instruction in Intel mnemonic\n"));
   fprintf (stream, _("  addr64      Assume 64bit address size\n"));
   fprintf (stream, _("  addr32      Assume 32bit address size\n"));
   fprintf (stream, _("  addr16      Assume 16bit address size\n"));
@@ -5067,7 +9831,7 @@ with the -M switch (multiple options should be separated by commas):\n"));
 static const struct dis386 *
 get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
 {
-  int index;
+  int index, vex_table_index;
 
   if (dp->name != NULL)
     return dp;
@@ -5088,30 +9852,55 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       break;
 
     case USE_PREFIX_TABLE:
-      index = 0;
-      used_prefixes |= (prefixes & PREFIX_REPZ);
-      if (prefixes & PREFIX_REPZ)
+      if (need_vex)
        {
-         index = 1;
-         repz_prefix = NULL;
+         /* The prefix in VEX is implicit.  */
+         switch (vex.prefix)
+           {
+           case 0:
+             index = 0;
+             break;
+           case REPE_PREFIX_OPCODE:
+             index = 1;
+             break;
+           case DATA_PREFIX_OPCODE:
+             index = 2;
+             break;
+           case REPNE_PREFIX_OPCODE:
+             index = 3;
+             break;
+           default:
+             abort ();
+             break;
+           }
        }
-      else
+      else 
        {
-         /* We should check PREFIX_REPNZ and PREFIX_REPZ before
-            PREFIX_DATA.  */
-         used_prefixes |= (prefixes & PREFIX_REPNZ);
-         if (prefixes & PREFIX_REPNZ)
+         index = 0;
+         used_prefixes |= (prefixes & PREFIX_REPZ);
+         if (prefixes & PREFIX_REPZ)
            {
-             index = 3;
-             repnz_prefix = NULL;
+             index = 1;
+             repz_prefix = NULL;
            }
          else
            {
-             used_prefixes |= (prefixes & PREFIX_DATA);
-             if (prefixes & PREFIX_DATA)
+             /* We should check PREFIX_REPNZ and PREFIX_REPZ before
+                PREFIX_DATA.  */
+             used_prefixes |= (prefixes & PREFIX_REPNZ);
+             if (prefixes & PREFIX_REPNZ)
+               {
+                 index = 3;
+                 repnz_prefix = NULL;
+               }
+             else
                {
-                 index = 2;
-                 data_prefix = NULL;
+                 used_prefixes |= (prefixes & PREFIX_DATA);
+                 if (prefixes & PREFIX_DATA)
+                   {
+                     index = 2;
+                     data_prefix = NULL;
+                   }
                }
            }
        }
@@ -5132,6 +9921,128 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       modrm.rm = *codep & 7;
       break;
 
+    case USE_VEX_LEN_TABLE:
+      if (!need_vex)
+       abort ();
+
+      switch (vex.length)
+       {
+       case 128:
+         index = 0;
+         break;
+       case 256:
+         index = 1;
+         break;
+       default:
+         abort ();
+         break;
+       }
+
+      dp = &vex_len_table[dp->op[1].bytemode][index];
+      break;
+
+    case USE_VEX_C4_TABLE:
+      FETCH_DATA (info, codep + 3);
+      /* All bits in the REX prefix are ignored.  */
+      rex_ignored = rex;
+      rex = ~(*codep >> 5) & 0x7;
+      switch ((*codep & 0x1f))
+       {
+       default:
+         BadOp ();
+       case 0x1:
+         vex_table_index = 0;
+         break;
+       case 0x2:
+         vex_table_index = 1;
+         break;
+       case 0x3:
+         vex_table_index = 2;
+         break;
+       }
+      codep++;
+      vex.w = *codep & 0x80;
+      if (vex.w && address_mode == mode_64bit)
+       rex |= REX_W;
+
+      vex.register_specifier = (~(*codep >> 3)) & 0xf;
+      if (address_mode != mode_64bit
+         && vex.register_specifier > 0x7)
+       BadOp ();
+
+      vex.length = (*codep & 0x4) ? 256 : 128;
+      switch ((*codep & 0x3))
+       {
+       case 0:
+         vex.prefix = 0;
+         break;
+       case 1:
+         vex.prefix = DATA_PREFIX_OPCODE;
+         break;
+       case 2:
+         vex.prefix = REPE_PREFIX_OPCODE;
+         break;
+       case 3:
+         vex.prefix = REPNE_PREFIX_OPCODE;
+         break;
+       }
+      need_vex = 1;
+      need_vex_reg = 1;
+      codep++;
+      index = *codep++;
+      dp = &vex_table[vex_table_index][index];
+      /* There is no MODRM byte for VEX [82|77].  */
+      if (index != 0x77 && index != 0x82)
+       {
+         FETCH_DATA (info, codep + 1);
+         modrm.mod = (*codep >> 6) & 3;
+         modrm.reg = (*codep >> 3) & 7;
+         modrm.rm = *codep & 7;
+       }
+      break;
+
+    case USE_VEX_C5_TABLE:
+      FETCH_DATA (info, codep + 2);
+      /* All bits in the REX prefix are ignored.  */
+      rex_ignored = rex;
+      rex = (*codep & 0x80) ? 0 : REX_R;
+
+      vex.register_specifier = (~(*codep >> 3)) & 0xf;
+      if (address_mode != mode_64bit
+         && vex.register_specifier > 0x7)
+       BadOp ();
+
+      vex.length = (*codep & 0x4) ? 256 : 128;
+      switch ((*codep & 0x3))
+       {
+       case 0:
+         vex.prefix = 0;
+         break;
+       case 1:
+         vex.prefix = DATA_PREFIX_OPCODE;
+         break;
+       case 2:
+         vex.prefix = REPE_PREFIX_OPCODE;
+         break;
+       case 3:
+         vex.prefix = REPNE_PREFIX_OPCODE;
+         break;
+       }
+      need_vex = 1;
+      need_vex_reg = 1;
+      codep++;
+      index = *codep++;
+      dp = &vex_table[dp->op[1].bytemode][index];
+      /* There is no MODRM byte for VEX [82|77].  */
+      if (index != 0x77 && index != 0x82)
+       {
+         FETCH_DATA (info, codep + 1);
+         modrm.mod = (*codep >> 6) & 3;
+         modrm.reg = (*codep >> 3) & 7;
+         modrm.rm = *codep & 7;
+       }
+      break;
+
     default:
       oappend (INTERNAL_DISASSEMBLER_ERROR);
       return NULL;
@@ -5197,10 +10108,14 @@ print_insn (bfd_vma pc, disassemble_info *info)
       else if (CONST_STRNEQ (p, "intel"))
        {
          intel_syntax = 1;
+         if (CONST_STRNEQ (p + 5, "-mnemonic"))
+           intel_mnemonic = 1;
        }
       else if (CONST_STRNEQ (p, "att"))
        {
          intel_syntax = 0;
+         if (CONST_STRNEQ (p + 3, "-mnemonic"))
+           intel_mnemonic = 0;
        }
       else if (CONST_STRNEQ (p, "addr"))
        {
@@ -5421,6 +10336,9 @@ print_insn (bfd_vma pc, disassemble_info *info)
     }
   else
     {
+      need_vex = 0;
+      need_vex_reg = 0;
+      vex_w_done = 0;
       dp = get_valid_dis386 (dp, info);
       if (dp != NULL && putop (dp->name, sizeflag) == 0)
         {
@@ -5448,10 +10366,10 @@ print_insn (bfd_vma pc, disassemble_info *info)
       (*info->fprintf_func) (info->stream, "%s", name);
       return 1;
     }
-  if (rex & ~rex_used)
+  if ((rex_original & ~rex_used) || rex_ignored)
     {
       const char *name;
-      name = prefix_name (rex | 0x40, priv.orig_sizeflag);
+      name = prefix_name (rex_original, priv.orig_sizeflag);
       if (name == NULL)
        name = INTERNAL_DISASSEMBLER_ERROR;
       (*info->fprintf_func) (info->stream, "%s ", name);
@@ -5473,7 +10391,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
   if (prefix_obuf[0] != 0)
     (*info->fprintf_func) (info->stream, "%s", prefix_obuf);
 
-  obufp = obuf + strlen (obuf);
+  obufp = mnemonicendp;
   for (i = strlen (obuf) + strlen (prefix_obuf); i < 6; i++)
     oappend (" ");
   oappend (" ");
@@ -5742,17 +10660,10 @@ static const struct dis386 float_reg[][8] = {
     { "fmul",  { STi, ST } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-#if SYSV386_COMPAT
-    { "fsub",  { STi, ST } },
-    { "fsubr", { STi, ST } },
-    { "fdiv",  { STi, ST } },
-    { "fdivr", { STi, ST } },
-#else
-    { "fsubr", { STi, ST } },
-    { "fsub",  { STi, ST } },
-    { "fdivr", { STi, ST } },
-    { "fdiv",  { STi, ST } },
-#endif
+    { "fsub!M",        { STi, ST } },
+    { "fsubM", { STi, ST } },
+    { "fdiv!M",        { STi, ST } },
+    { "fdivM", { STi, ST } },
   },
   /* dd */
   {
@@ -5771,17 +10682,10 @@ static const struct dis386 float_reg[][8] = {
     { "fmulp", { STi, ST } },
     { "(bad)", { XX } },
     { FGRPde_3 },
-#if SYSV386_COMPAT
-    { "fsubp", { STi, ST } },
-    { "fsubrp",        { STi, ST } },
-    { "fdivp", { STi, ST } },
-    { "fdivrp",        { STi, ST } },
-#else
-    { "fsubrp",        { STi, ST } },
-    { "fsubp", { STi, ST } },
-    { "fdivrp",        { STi, ST } },
-    { "fdivp", { STi, ST } },
-#endif
+    { "fsub!Mp", { STi, ST } },
+    { "fsubMp",        { STi, ST } },
+    { "fdiv!Mp", { STi, ST } },
+    { "fdivMp",        { STi, ST } },
   },
   /* df */
   {
@@ -5844,6 +10748,14 @@ static char *fgrps[][8] = {
   },
 };
 
+static void
+swap_operand (void)
+{
+  mnemonicendp[0] = '.';
+  mnemonicendp[1] = 's';
+  mnemonicendp += 2;
+}
+
 static void
 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED,
               int sizeflag ATTRIBUTE_UNUSED)
@@ -5919,6 +10831,15 @@ putop (const char *template, int sizeflag)
 {
   const char *p;
   int alt = 0;
+  int cond = 1;
+  unsigned int l = 0, len = 1;
+  char last[4];
+
+#define SAVE_LAST(c)                   \
+  if (l < len && l < sizeof (last))    \
+    last[l++] = c;                     \
+  else                                 \
+    abort ();
 
   for (p = template; *p; p++)
     {
@@ -5927,6 +10848,12 @@ putop (const char *template, int sizeflag)
        default:
          *obufp++ = *p;
          break;
+       case '%':
+         len++;
+         break;
+       case '!':
+         cond = 0;
+         break;
        case '{':
          alt = 0;
          if (intel_syntax)
@@ -6060,12 +10987,23 @@ putop (const char *template, int sizeflag)
              break;
            }
          /* Fall through.  */
+         goto case_L;
        case 'L':
+         if (l != 0 || len != 1)
+           {
+             SAVE_LAST (*p);
+             break;
+           }
+case_L:
          if (intel_syntax)
            break;
          if (sizeflag & SUFFIX_ALWAYS)
            *obufp++ = 'l';
          break;
+       case 'M':
+         if (intel_mnemonic != cond)
+           *obufp++ = 'r';
+         break;
        case 'N':
          if ((prefixes & PREFIX_FWAIT) == 0)
            *obufp++ = 'n';
@@ -6122,22 +11060,45 @@ putop (const char *template, int sizeflag)
              break;
            }
          /* Fall through.  */
+         goto case_Q;
        case 'Q':
-         if (intel_syntax && !alt)
-           break;
-         USED_REX (REX_W);
-         if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
+         if (l == 0 && len == 1)
            {
-             if (rex & REX_W)
-               *obufp++ = 'q';
-             else
+case_Q:
+             if (intel_syntax && !alt)
+               break;
+             USED_REX (REX_W);
+             if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
                {
-                 if (sizeflag & DFLAG)
-                   *obufp++ = intel_syntax ? 'd' : 'l';
+                 if (rex & REX_W)
+                   *obufp++ = 'q';
                  else
-                   *obufp++ = 'w';
+                   {
+                     if (sizeflag & DFLAG)
+                       *obufp++ = intel_syntax ? 'd' : 'l';
+                     else
+                       *obufp++ = 'w';
+                   }
+                 used_prefixes |= (prefixes & PREFIX_DATA);
                }
-             used_prefixes |= (prefixes & PREFIX_DATA);
+           }
+         else
+           {
+             if (l != 1 || len != 2 || last[0] != 'L')
+               {
+                 SAVE_LAST (*p);
+                 break;
+               }
+             if (intel_syntax
+                 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
+               break;
+             if ((rex & REX_W))
+               {
+                 USED_REX (REX_W);
+                 *obufp++ = 'q';
+               }
+             else
+               *obufp++ = 'l';
            }
          break;
        case 'R':
@@ -6187,51 +11148,104 @@ putop (const char *template, int sizeflag)
            }
          break;
        case 'X':
-         if (prefixes & PREFIX_DATA)
+         if (l != 0 || len != 1)
+           {
+             SAVE_LAST (*p);
+             break;
+           }
+         if (need_vex && vex.prefix)
+           {
+             if (vex.prefix == DATA_PREFIX_OPCODE)
+               *obufp++ = 'd';
+             else
+               *obufp++ = 's';
+           }
+         else if (prefixes & PREFIX_DATA)
            *obufp++ = 'd';
          else
            *obufp++ = 's';
          used_prefixes |= (prefixes & PREFIX_DATA);
          break;
        case 'Y':
-         if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
-           break;
-         if (rex & REX_W)
+         if (l == 0 && len == 1)
            {
-             USED_REX (REX_W);
-             *obufp++ = 'q';
+             if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
+               break;
+             if (rex & REX_W)
+               {
+                 USED_REX (REX_W);
+                 *obufp++ = 'q';
+               }
+             break;
+           }
+         else
+           {
+             if (l != 1 || len != 2 || last[0] != 'X')
+               {
+                 SAVE_LAST (*p);
+                 break;
+               }
+             if (!need_vex)
+               abort ();
+             if (intel_syntax
+                 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
+               break;
+             switch (vex.length)
+               {
+               case 128:
+                 *obufp++ = 'x';
+                 break;
+               case 256:
+                 *obufp++ = 'y';
+                 break;
+               default:
+                 abort ();
+               }
            }
          break;
-         /* implicit operand size 'l' for i386 or 'q' for x86-64 */
        case 'W':
-         /* operand size flag for cwtl, cbtw */
-         USED_REX (REX_W);
-         if (rex & REX_W)
+         if (l == 0 && len == 1)
            {
-             if (intel_syntax)
-               *obufp++ = 'd';
+             /* operand size flag for cwtl, cbtw */
+             USED_REX (REX_W);
+             if (rex & REX_W)
+               {
+                 if (intel_syntax)
+                   *obufp++ = 'd';
+                 else
+                   *obufp++ = 'l';
+               }
+             else if (sizeflag & DFLAG)
+               *obufp++ = 'w';
              else
-               *obufp++ = 'l';
+               *obufp++ = 'b';
+             if (!(rex & REX_W))
+               used_prefixes |= (prefixes & PREFIX_DATA);
            }
-         else if (sizeflag & DFLAG)
-           *obufp++ = 'w';
          else
-           *obufp++ = 'b';
-         if (!(rex & REX_W))
-           used_prefixes |= (prefixes & PREFIX_DATA);
+           {
+             if (l != 1 || len != 2 || last[0] != 'X')
+               {
+                 SAVE_LAST (*p);
+                 break;
+               }
+             if (!need_vex)
+               abort ();
+             *obufp++ = vex.w ? 'd': 's';
+           }
          break;
        }
       alt = 0;
     }
   *obufp = 0;
+  mnemonicendp = obufp;
   return 0;
 }
 
 static void
 oappend (const char *s)
 {
-  strcpy (obufp, s);
-  obufp += strlen (s);
+  obufp = stpcpy (obufp, s);
 }
 
 static void
@@ -6370,7 +11384,7 @@ print_displacement (char *buf, bfd_vma disp)
   buf[j++] = '0';
   buf[j++] = 'x';
 
-  sprintf_vma (tmp, val);
+  sprintf_vma (tmp, (bfd_vma) val);
   for (i = 0; tmp[i] == '0'; i++)
     continue;
   if (tmp[i] == '\0')
@@ -6384,6 +11398,7 @@ intel_operand_size (int bytemode, int sizeflag)
   switch (bytemode)
     {
     case b_mode:
+    case b_swap_mode:
     case dqb_mode:
       oappend ("BYTE PTR ");
       break;
@@ -6400,6 +11415,7 @@ intel_operand_size (int bytemode, int sizeflag)
        }
       /* FALLTHRU */
     case v_mode:
+    case v_swap_mode:
     case dq_mode:
       USED_REX (REX_W);
       if (rex & REX_W)
@@ -6417,11 +11433,20 @@ intel_operand_size (int bytemode, int sizeflag)
       if (!(rex & REX_W))
        used_prefixes |= (prefixes & PREFIX_DATA);
       break;
+    case a_mode:
+      if (sizeflag & DFLAG)
+       oappend ("QWORD PTR ");
+      else
+       oappend ("DWORD PTR ");
+      used_prefixes |= (prefixes & PREFIX_DATA);
+      break;
     case d_mode:
+    case d_swap_mode:
     case dqd_mode:
       oappend ("DWORD PTR ");
       break;
     case q_mode:
+    case q_swap_mode:
       oappend ("QWORD PTR ");
       break;
     case m_mode:
@@ -6441,89 +11466,155 @@ intel_operand_size (int bytemode, int sizeflag)
       oappend ("TBYTE PTR ");
       break;
     case x_mode:
+    case x_swap_mode:
+      if (need_vex)
+       {
+         switch (vex.length)
+           {
+           case 128:
+             oappend ("XMMWORD PTR ");
+             break;
+           case 256:
+             oappend ("YMMWORD PTR ");
+             break;
+           default:
+             abort ();
+           }
+       }
+      else
+       oappend ("XMMWORD PTR ");
+      break;
+    case xmm_mode:
       oappend ("XMMWORD PTR ");
       break;
+    case xmmq_mode:
+      if (!need_vex)
+       abort ();
+
+      switch (vex.length)
+       {
+       case 128:
+         oappend ("QWORD PTR ");
+         break;
+       case 256:
+         oappend ("XMMWORD PTR ");
+         break;
+       default:
+         abort ();
+       }
+      break;
+    case ymmq_mode:
+      if (!need_vex)
+       abort ();
+
+      switch (vex.length)
+       {
+       case 128:
+         oappend ("QWORD PTR ");
+         break;
+       case 256:
+         oappend ("YMMWORD PTR ");
+         break;
+       default:
+         abort ();
+       }
+      break;
     case o_mode:
       oappend ("OWORD PTR ");
       break;
+    case vex_w_dq_mode:
+      if (!need_vex)
+       abort ();
+
+      if (vex.w)
+       oappend ("QWORD PTR ");
+      else
+       oappend ("DWORD PTR ");
+      break;
+    default:
+      break;
+    }
+}
+
+static void
+OP_E_register (int bytemode, int sizeflag)
+{
+  int reg = modrm.rm;
+  const char **names;
+
+  USED_REX (REX_B);
+  if ((rex & REX_B))
+    reg += 8;
+
+  if ((sizeflag & SUFFIX_ALWAYS)
+      && (bytemode == b_swap_mode || bytemode == v_swap_mode))
+    swap_operand ();
+
+  switch (bytemode)
+    {
+    case b_mode:
+    case b_swap_mode:
+      USED_REX (0);
+      if (rex)
+       names = names8rex;
+      else
+       names = names8;
+      break;
+    case w_mode:
+      names = names16;
+      break;
+    case d_mode:
+      names = names32;
+      break;
+    case q_mode:
+      names = names64;
+      break;
+    case m_mode:
+      names = address_mode == mode_64bit ? names64 : names32;
+      break;
+    case stack_v_mode:
+      if (address_mode == mode_64bit && (sizeflag & DFLAG))
+       {
+         names = names64;
+         used_prefixes |= (prefixes & PREFIX_DATA);
+         break;
+       }
+      bytemode = v_mode;
+      /* FALLTHRU */
+    case v_mode:
+    case v_swap_mode:
+    case dq_mode:
+    case dqb_mode:
+    case dqd_mode:
+    case dqw_mode:
+      USED_REX (REX_W);
+      if (rex & REX_W)
+       names = names64;
+      else if ((sizeflag & DFLAG) 
+              || (bytemode != v_mode
+                  && bytemode != v_swap_mode))
+       names = names32;
+      else
+       names = names16;
+      used_prefixes |= (prefixes & PREFIX_DATA);
+      break;
+    case 0:
+      return;
     default:
-      break;
+      oappend (INTERNAL_DISASSEMBLER_ERROR);
+      return;
     }
+  oappend (names[reg]);
 }
 
 static void
-OP_E_extended (int bytemode, int sizeflag, int has_drex)
+OP_E_memory (int bytemode, int sizeflag, int has_drex)
 {
-  bfd_vma disp;
-  int add = 0;
+  bfd_vma disp = 0;
+  int add = (rex & REX_B) ? 8 : 0;
   int riprel = 0;
-  USED_REX (REX_B);
-  if (rex & REX_B)
-    add += 8;
-
-  /* Skip mod/rm byte.  */
-  MODRM_CHECK;
-  codep++;
-
-  if (modrm.mod == 3)
-    {
-      switch (bytemode)
-       {
-       case b_mode:
-         USED_REX (0);
-         if (rex)
-           oappend (names8rex[modrm.rm + add]);
-         else
-           oappend (names8[modrm.rm + add]);
-         break;
-       case w_mode:
-         oappend (names16[modrm.rm + add]);
-         break;
-       case d_mode:
-         oappend (names32[modrm.rm + add]);
-         break;
-       case q_mode:
-         oappend (names64[modrm.rm + add]);
-         break;
-       case m_mode:
-         if (address_mode == mode_64bit)
-           oappend (names64[modrm.rm + add]);
-         else
-           oappend (names32[modrm.rm + add]);
-         break;
-       case stack_v_mode:
-         if (address_mode == mode_64bit && (sizeflag & DFLAG))
-           {
-             oappend (names64[modrm.rm + add]);
-             used_prefixes |= (prefixes & PREFIX_DATA);
-             break;
-           }
-         bytemode = v_mode;
-         /* FALLTHRU */
-       case v_mode:
-       case dq_mode:
-       case dqb_mode:
-       case dqd_mode:
-       case dqw_mode:
-         USED_REX (REX_W);
-         if (rex & REX_W)
-           oappend (names64[modrm.rm + add]);
-         else if ((sizeflag & DFLAG) || bytemode != v_mode)
-           oappend (names32[modrm.rm + add]);
-         else
-           oappend (names16[modrm.rm + add]);
-         used_prefixes |= (prefixes & PREFIX_DATA);
-         break;
-       case 0:
-         break;
-       default:
-         oappend (INTERNAL_DISASSEMBLER_ERROR);
-         break;
-       }
-      return;
-    }
 
-  disp = 0;
+  USED_REX (REX_B);
   if (intel_syntax)
     intel_operand_size (bytemode, sizeflag);
   append_seg ();
@@ -6536,7 +11627,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
       int havebase;
       int haveindex;
       int needindex;
-      int base;
+      int base, rbase;
       int index = 0;
       int scale = 0;
 
@@ -6558,7 +11649,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
          haveindex = index != 4;
          codep++;
        }
-      base += add;
+      rbase = base + add;
 
       /* If we have a DREX byte, skip it now 
         (it has already been handled) */
@@ -6571,7 +11662,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
       switch (modrm.mod)
        {
        case 0:
-         if ((base & 7) == 5)
+         if (base == 5)
            {
              havebase = 0;
              if (address_mode == mode_64bit && !havesib)
@@ -6601,7 +11692,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
                  || (havesib && (haveindex || scale != 0)));
 
       if (!intel_syntax)
-       if (modrm.mod != 0 || (base & 7) == 5)
+       if (modrm.mod != 0 || base == 5)
          {
            if (havedisp || riprel)
              print_displacement (scratchbuf, disp);
@@ -6629,7 +11720,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
          *obufp = '\0';
          if (havebase)
            oappend (address_mode == mode_64bit && (sizeflag & AFLAG)
-                    ? names64[base] : names32[base]);
+                    ? names64[rbase] : names32[rbase]);
          if (havesib)
            {
              /* ESP/RSP won't allow index.  If base isn't ESP/RSP,
@@ -6660,7 +11751,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
                }
            }
          if (intel_syntax
-             && (disp || modrm.mod != 0 || (base & 7) == 5))
+             && (disp || modrm.mod != 0 || base == 5))
            {
              if (!havedisp || (bfd_signed_vma) disp >= 0)
                {
@@ -6686,7 +11777,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
        }
       else if (intel_syntax)
        {
-         if (modrm.mod != 0 || (base & 7) == 5)
+         if (modrm.mod != 0 || base == 5)
            {
              if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
                              | PREFIX_ES | PREFIX_FS | PREFIX_GS))
@@ -6776,6 +11867,19 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
     }
 }
 
+static void
+OP_E_extended (int bytemode, int sizeflag, int has_drex)
+{
+  /* Skip mod/rm byte.  */
+  MODRM_CHECK;
+  codep++;
+
+  if (modrm.mod == 3)
+    OP_E_register (bytemode, sizeflag);
+  else
+    OP_E_memory (bytemode, sizeflag, has_drex);
+}
+
 static void
 OP_E (int bytemode, int sizeflag)
 {
@@ -7468,7 +12572,7 @@ OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 }
 
 static void
-OP_XMM (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
+OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
 {
   int add;
   USED_REX (REX_R);
@@ -7476,7 +12580,22 @@ OP_XMM (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
     add = 8;
   else
     add = 0;
-  sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
+  if (need_vex && bytemode != xmm_mode)
+    {
+      switch (vex.length)
+       {
+       case 128:
+         sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
+         break;
+       case 256:
+         sprintf (scratchbuf, "%%ymm%d", modrm.reg + add);
+         break;
+       default:
+         abort ();
+       }
+    }
+  else
+    sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
   oappend (scratchbuf + intel_syntax);
 }
 
@@ -7485,7 +12604,8 @@ OP_EM (int bytemode, int sizeflag)
 {
   if (modrm.mod != 3)
     {
-      if (intel_syntax && bytemode == v_mode)
+      if (intel_syntax
+         && (bytemode == v_mode || bytemode == v_swap_mode))
        {
          bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
          used_prefixes |= (prefixes & PREFIX_DATA);
@@ -7494,6 +12614,9 @@ OP_EM (int bytemode, int sizeflag)
       return;
     }
 
+  if ((sizeflag & SUFFIX_ALWAYS) && bytemode == v_swap_mode)
+    swap_operand ();
+
   /* Skip mod/rm byte.  */
   MODRM_CHECK;
   codep++;
@@ -7564,10 +12687,33 @@ OP_EX (int bytemode, int sizeflag)
   else
     add = 0;
 
+  if ((sizeflag & SUFFIX_ALWAYS)
+      && (bytemode == x_swap_mode
+         || bytemode == d_swap_mode
+         || bytemode == q_swap_mode))
+    swap_operand ();
+
   /* Skip mod/rm byte.  */
   MODRM_CHECK;
   codep++;
-  sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
+  if (need_vex
+      && bytemode != xmm_mode
+      && bytemode != xmmq_mode)
+    {
+      switch (vex.length)
+       {
+       case 128:
+         sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
+         break;
+       case 256:
+         sprintf (scratchbuf, "%%ymm%d", modrm.rm + add);
+         break;
+       default:
+         abort ();
+       }
+    }
+  else
+    sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
   oappend (scratchbuf + intel_syntax);
 }
 
@@ -7709,7 +12855,7 @@ OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
   /* AMD 3DNow! instructions are specified by an opcode suffix in the
      place where an 8-bit immediate would normally go.  ie. the last
      byte of the instruction.  */
-  obufp = obuf + strlen (obuf);
+  obufp = mnemonicendp;
   mnemonic = Suffix3DNow[*codep++ & 0xff];
   if (mnemonic)
     oappend (mnemonic);
@@ -7723,56 +12869,45 @@ OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
       op_out[1][0] = '\0';
       BadOp ();
     }
+  mnemonicendp = obufp;
 }
 
-static const char *simd_cmp_op[] = {
-  "eq",
-  "lt",
-  "le",
-  "unord",
-  "neq",
-  "nlt",
-  "nle",
-  "ord"
+static struct op simd_cmp_op[] =
+{
+  { STRING_COMMA_LEN ("eq") },
+  { STRING_COMMA_LEN ("lt") },
+  { STRING_COMMA_LEN ("le") },
+  { STRING_COMMA_LEN ("unord") },
+  { STRING_COMMA_LEN ("neq") },
+  { STRING_COMMA_LEN ("nlt") },
+  { STRING_COMMA_LEN ("nle") },
+  { STRING_COMMA_LEN ("ord") }
 };
 
 static void
-OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
+CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 {
   unsigned int cmp_type;
 
   FETCH_DATA (the_info, codep + 1);
-  obufp = obuf + strlen (obuf);
   cmp_type = *codep++ & 0xff;
-  if (cmp_type < 8)
+  if (cmp_type < ARRAY_SIZE (simd_cmp_op))
     {
-      char suffix1 = 'p', suffix2 = 's';
-      used_prefixes |= (prefixes & PREFIX_REPZ);
-      if (prefixes & PREFIX_REPZ)
-       suffix1 = 's';
-      else
-       {
-         used_prefixes |= (prefixes & PREFIX_DATA);
-         if (prefixes & PREFIX_DATA)
-           suffix2 = 'd';
-         else
-           {
-             used_prefixes |= (prefixes & PREFIX_REPNZ);
-             if (prefixes & PREFIX_REPNZ)
-               suffix1 = 's', suffix2 = 'd';
-           }
-       }
-      sprintf (scratchbuf, "cmp%s%c%c",
-              simd_cmp_op[cmp_type], suffix1, suffix2);
-      used_prefixes |= (prefixes & PREFIX_REPZ);
-      oappend (scratchbuf);
+      char suffix [3];
+      char *p = mnemonicendp - 2;
+      suffix[0] = p[0];
+      suffix[1] = p[1];
+      suffix[2] = '\0';
+      sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
+      mnemonicendp += simd_cmp_op[cmp_type].len;
     }
   else
     {
-      /* We have a bad extension byte.  Clean up.  */
-      op_out[0][0] = '\0';
-      op_out[1][0] = '\0';
-      BadOp ();
+      /* We have a reserved extension byte.  Output it directly.  */
+      scratchbuf[0] = '$';
+      print_operand_value (scratchbuf + 1, 1, cmp_type);
+      oappend (scratchbuf + intel_syntax);
+      scratchbuf[0] = '\0';
     }
 }
 
@@ -7868,8 +13003,8 @@ CMPXCHG8B_Fixup (int bytemode, int sizeflag)
   if (rex & REX_W)
     {
       /* Change cmpxchg8b to cmpxchg16b.  */
-      char *p = obuf + strlen (obuf) - 2;
-      strcpy (p, "16b");
+      char *p = mnemonicendp - 2;
+      mnemonicendp = stpcpy (p, "16b");
       bytemode = o_mode;
     }
   OP_M (bytemode, sizeflag);
@@ -7878,7 +13013,22 @@ CMPXCHG8B_Fixup (int bytemode, int sizeflag)
 static void
 XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
 {
-  sprintf (scratchbuf, "%%xmm%d", reg);
+  if (need_vex)
+    {
+      switch (vex.length)
+       {
+       case 128:
+         sprintf (scratchbuf, "%%xmm%d", reg);
+         break;
+       case 256:
+         sprintf (scratchbuf, "%%ymm%d", reg);
+         break;
+       default:
+         abort ();
+       }
+    }
+  else
+    sprintf (scratchbuf, "%%xmm%d", reg);
   oappend (scratchbuf + intel_syntax);
 }
 
@@ -7886,19 +13036,19 @@ static void
 CRC32_Fixup (int bytemode, int sizeflag)
 {
   /* Add proper suffix to "crc32".  */
-  char *p = obuf + strlen (obuf);
+  char *p = mnemonicendp;
 
   switch (bytemode)
     {
     case b_mode:
       if (intel_syntax)
-       break;
+       goto skip;
 
       *p++ = 'b';
       break;
     case v_mode:
       if (intel_syntax)
-       break;
+       goto skip;
 
       USED_REX (REX_W);
       if (rex & REX_W)
@@ -7913,8 +13063,10 @@ CRC32_Fixup (int bytemode, int sizeflag)
       oappend (INTERNAL_DISASSEMBLER_ERROR);
       break;
     }
+  mnemonicendp = p;
   *p = '\0';
 
+skip:
   if (modrm.mod == 3)
     {
       int add;
@@ -8242,7 +13394,7 @@ OP_DREX_FCMP (int bytemode ATTRIBUTE_UNUSED,
   else
     {
       sprintf (scratchbuf, "com%s%s", cmp_test[byte], obuf+3);
-      strcpy (obuf, scratchbuf);
+      mnemonicendp = stpcpy (obuf, scratchbuf);
       codep++;
     }
 }
@@ -8284,7 +13436,271 @@ OP_DREX_ICMP (int bytemode ATTRIBUTE_UNUSED,
   else
     {
       sprintf (scratchbuf, "pcom%s%s", cmp_test[byte], obuf+4);
-      strcpy (obuf, scratchbuf);
+      mnemonicendp = stpcpy (obuf, scratchbuf);
       codep++;
     }
 }
+
+/* Display the destination register operand for instructions with
+   VEX. */
+
+static void
+OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
+{
+  if (!need_vex)
+    abort ();
+
+  if (!need_vex_reg)
+    return;
+
+  switch (vex.length)
+    {
+    case 128:
+      switch (bytemode)
+       {
+       case vex_mode:
+       case vex128_mode:
+         break;
+       default:
+         abort ();
+         return;
+       }
+
+      sprintf (scratchbuf, "%%xmm%d", vex.register_specifier);
+      break;
+    case 256:
+      switch (bytemode)
+       {
+       case vex_mode:
+       case vex256_mode:
+         break;
+       default:
+         abort ();
+         return;
+       }
+
+      sprintf (scratchbuf, "%%ymm%d", vex.register_specifier);
+      break;
+    default:
+      abort ();
+      break;
+    }
+  oappend (scratchbuf + intel_syntax);
+}
+
+static void
+OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
+{
+  int reg;
+  FETCH_DATA (the_info, codep + 1);
+  reg = *codep++;
+
+  if (bytemode != x_mode)
+    abort ();
+
+  if (reg & 0xf)
+      BadOp ();
+
+  reg >>= 4;
+  if (reg > 7 && address_mode != mode_64bit)
+    BadOp ();
+
+  switch (vex.length)
+    {
+    case 128:
+      sprintf (scratchbuf, "%%xmm%d", reg);
+      break;
+    case 256:
+      sprintf (scratchbuf, "%%ymm%d", reg);
+      break;
+    default:
+      abort ();
+    }
+  oappend (scratchbuf + intel_syntax);
+}
+
+static void
+OP_EX_Vex (int bytemode, int sizeflag)
+{
+  if (modrm.mod != 3)
+    {
+      if (vex.register_specifier != 0)
+       BadOp ();
+      need_vex_reg = 0;
+    }
+  OP_EX (bytemode, sizeflag);
+}
+
+static void
+OP_XMM_Vex (int bytemode, int sizeflag)
+{
+  if (modrm.mod != 3)
+    {
+      if (vex.register_specifier != 0)
+       BadOp ();
+      need_vex_reg = 0;
+    }
+  OP_XMM (bytemode, sizeflag);
+}
+
+static void
+VZERO_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
+{
+  switch (vex.length)
+    {
+    case 128:
+      mnemonicendp = stpcpy (obuf, "vzeroupper");
+      break;
+    case 256:
+      mnemonicendp = stpcpy (obuf, "vzeroall");
+      break;
+    default:
+      abort ();
+    }
+}
+
+static struct op vex_cmp_op[] =
+{
+  { STRING_COMMA_LEN ("eq") },
+  { STRING_COMMA_LEN ("lt") },
+  { STRING_COMMA_LEN ("le") },
+  { STRING_COMMA_LEN ("unord") },
+  { STRING_COMMA_LEN ("neq") },
+  { STRING_COMMA_LEN ("nlt") },
+  { STRING_COMMA_LEN ("nle") },
+  { STRING_COMMA_LEN ("ord") },
+  { STRING_COMMA_LEN ("eq_uq") },
+  { STRING_COMMA_LEN ("nge") },
+  { STRING_COMMA_LEN ("ngt") },
+  { STRING_COMMA_LEN ("false") },
+  { STRING_COMMA_LEN ("neq_oq") },
+  { STRING_COMMA_LEN ("ge") },
+  { STRING_COMMA_LEN ("gt") },
+  { STRING_COMMA_LEN ("true") },
+  { STRING_COMMA_LEN ("eq_os") },
+  { STRING_COMMA_LEN ("lt_oq") },
+  { STRING_COMMA_LEN ("le_oq") },
+  { STRING_COMMA_LEN ("unord_s") },
+  { STRING_COMMA_LEN ("neq_us") },
+  { STRING_COMMA_LEN ("nlt_uq") },
+  { STRING_COMMA_LEN ("nle_uq") },
+  { STRING_COMMA_LEN ("ord_s") },
+  { STRING_COMMA_LEN ("eq_us") },
+  { STRING_COMMA_LEN ("nge_uq") },
+  { STRING_COMMA_LEN ("ngt_uq") },
+  { STRING_COMMA_LEN ("false_os") },
+  { STRING_COMMA_LEN ("neq_os") },
+  { STRING_COMMA_LEN ("ge_oq") },
+  { STRING_COMMA_LEN ("gt_oq") },
+  { STRING_COMMA_LEN ("true_us") },
+};
+
+static void
+VCMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
+{
+  unsigned int cmp_type;
+
+  FETCH_DATA (the_info, codep + 1);
+  cmp_type = *codep++ & 0xff;
+  if (cmp_type < ARRAY_SIZE (vex_cmp_op))
+    {
+      char suffix [3];
+      char *p = mnemonicendp - 2;
+      suffix[0] = p[0];
+      suffix[1] = p[1];
+      suffix[2] = '\0';
+      sprintf (p, "%s%s", vex_cmp_op[cmp_type].name, suffix);
+      mnemonicendp += vex_cmp_op[cmp_type].len;
+    }
+  else
+    {
+      /* We have a reserved extension byte.  Output it directly.  */
+      scratchbuf[0] = '$';
+      print_operand_value (scratchbuf + 1, 1, cmp_type);
+      oappend (scratchbuf + intel_syntax);
+      scratchbuf[0] = '\0';
+    }
+}
+
+static const struct op pclmul_op[] =
+{
+  { STRING_COMMA_LEN ("lql") },
+  { STRING_COMMA_LEN ("hql") },
+  { STRING_COMMA_LEN ("lqh") },
+  { STRING_COMMA_LEN ("hqh") }
+};
+
+static void
+PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED,
+             int sizeflag ATTRIBUTE_UNUSED)
+{
+  unsigned int pclmul_type;
+
+  FETCH_DATA (the_info, codep + 1);
+  pclmul_type = *codep++ & 0xff;
+  switch (pclmul_type)
+    {
+    case 0x10:
+      pclmul_type = 2;
+      break;
+    case 0x11:
+      pclmul_type = 3;
+      break;
+    default:
+      break;
+    } 
+  if (pclmul_type < ARRAY_SIZE (pclmul_op))
+    {
+      char suffix [4];
+      char *p = mnemonicendp - 3;
+      suffix[0] = p[0];
+      suffix[1] = p[1];
+      suffix[2] = p[2];
+      suffix[3] = '\0';
+      sprintf (p, "%s%s", pclmul_op[pclmul_type].name, suffix);
+      mnemonicendp += pclmul_op[pclmul_type].len;
+    }
+  else
+    {
+      /* We have a reserved extension byte.  Output it directly.  */
+      scratchbuf[0] = '$';
+      print_operand_value (scratchbuf + 1, 1, pclmul_type);
+      oappend (scratchbuf + intel_syntax);
+      scratchbuf[0] = '\0';
+    }
+}
+
+static void
+MOVBE_Fixup (int bytemode, int sizeflag)
+{
+  /* Add proper suffix to "movbe".  */
+  char *p = mnemonicendp;
+
+  switch (bytemode)
+    {
+    case v_mode:
+      if (intel_syntax)
+       goto skip;
+
+      USED_REX (REX_W);
+      if (sizeflag & SUFFIX_ALWAYS)
+       {
+         if (rex & REX_W)
+           *p++ = 'q';
+         else if (sizeflag & DFLAG)
+           *p++ = 'l';
+         else
+           *p++ = 'w';
+       }
+      used_prefixes |= (prefixes & PREFIX_DATA);
+      break;
+    default:
+      oappend (INTERNAL_DISASSEMBLER_ERROR);
+      break;
+    }
+  mnemonicendp = p;
+  *p = '\0';
+
+skip:
+  OP_M (bytemode, sizeflag);
+}
This page took 0.145952 seconds and 4 git commands to generate.