daily update
[deliverable/binutils-gdb.git] / opcodes / i386-dis.c
index 221584b6527ecdafae5a3686c54180420d08efe3..72e39a1cdbb572503c28935e73d5182fbd37b6b2 100644 (file)
@@ -42,9 +42,6 @@
 
 #include <setjmp.h>
 
-static int fetch_data (struct disassemble_info *, bfd_byte *);
-static void ckprefix (void);
-static const char *prefix_name (int, int);
 static int print_insn (bfd_vma, disassemble_info *);
 static void dofloat (int);
 static void OP_ST (int, int);
@@ -56,7 +53,6 @@ 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);
-static void OP_E_extended (int, int);
 static void print_displacement (char *, bfd_vma);
 static void OP_E (int, int);
 static void OP_G (int, int);
@@ -114,6 +110,12 @@ static void REP_Fixup (int, int);
 static void CMPXCHG8B_Fixup (int, int);
 static void XMM_Fixup (int, int);
 static void CRC32_Fixup (int, int);
+static void FXSAVE_Fixup (int, int);
+static void OP_LWPCB_E (int, int);
+static void OP_LWP_E (int, int);
+static void OP_LWP_I (int, int);
+static void OP_Vex_2src_1 (int, int);
+static void OP_Vex_2src_2 (int, int);
 
 static void MOVBE_Fixup (int, int);
 
@@ -142,10 +144,7 @@ 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.  */
+/* REX bits in original REX prefix 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
@@ -357,6 +356,9 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define OPSUF { OP_3DNowSuffix, 0 }
 #define CMP { CMP_Fixup, 0 }
 #define XMM0 { XMM_Fixup, 0 }
+#define FXSAVE { FXSAVE_Fixup, 0 }
+#define Vex_2src_1 { OP_Vex_2src_1, 0 }
+#define Vex_2src_2 { OP_Vex_2src_2, 0 }
 
 #define Vex { OP_VEX, vex_mode }
 #define Vex128 { OP_VEX, vex128_mode }
@@ -514,9 +516,11 @@ enum
   USE_PREFIX_TABLE,
   USE_X86_64_TABLE,
   USE_3BYTE_TABLE,
+  USE_XOP_8F_TABLE,
   USE_VEX_C4_TABLE,
   USE_VEX_C5_TABLE,
-  USE_VEX_LEN_TABLE
+  USE_VEX_LEN_TABLE,
+  USE_VEX_W_TABLE
 };
 
 #define FLOAT                  NULL, { { NULL, FLOATCODE } }
@@ -528,9 +532,11 @@ enum
 #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 XOP_8F_TABLE(I)                DIS386 (USE_XOP_8F_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 VEX_W_TABLE(I)         DIS386 (USE_VEX_W_TABLE, (I))
 
 enum
 {
@@ -565,7 +571,9 @@ enum
   REG_VEX_71,
   REG_VEX_72,
   REG_VEX_73,
-  REG_VEX_AE
+  REG_VEX_AE,
+  REG_XOP_LWPCB,
+  REG_XOP_LWP
 };
 
 enum
@@ -630,7 +638,7 @@ enum
   MOD_VEX_16_PREFIX_0,
   MOD_VEX_17,
   MOD_VEX_2B,
-  MOD_VEX_51,
+  MOD_VEX_50,
   MOD_VEX_71_REG_2,
   MOD_VEX_71_REG_4,
   MOD_VEX_71_REG_6,
@@ -1068,6 +1076,13 @@ enum
   THREE_BYTE_0F7A
 };
 
+enum
+{
+  XOP_08 = 0,
+  XOP_09,
+  XOP_0A
+};
+
 enum
 {
   VEX_0F = 0,
@@ -1278,7 +1293,266 @@ enum
   VEX_LEN_3A7B_P_2,
   VEX_LEN_3A7E_P_2,
   VEX_LEN_3A7F_P_2,
-  VEX_LEN_3ADF_P_2
+  VEX_LEN_3ADF_P_2,
+  VEX_LEN_XOP_09_80,
+  VEX_LEN_XOP_09_81
+};
+
+enum
+{
+  VEX_W_10_P_0 = 0,
+  VEX_W_10_P_1,
+  VEX_W_10_P_2,
+  VEX_W_10_P_3,
+  VEX_W_11_P_0,
+  VEX_W_11_P_1,
+  VEX_W_11_P_2,
+  VEX_W_11_P_3,
+  VEX_W_12_P_0_M_0,
+  VEX_W_12_P_0_M_1,
+  VEX_W_12_P_1,
+  VEX_W_12_P_2,
+  VEX_W_12_P_3,
+  VEX_W_13_M_0,
+  VEX_W_14,
+  VEX_W_15,
+  VEX_W_16_P_0_M_0,
+  VEX_W_16_P_0_M_1,
+  VEX_W_16_P_1,
+  VEX_W_16_P_2,
+  VEX_W_17_M_0,
+  VEX_W_28,
+  VEX_W_29,
+  VEX_W_2B_M_0,
+  VEX_W_2E_P_0,
+  VEX_W_2E_P_2,
+  VEX_W_2F_P_0,
+  VEX_W_2F_P_2,
+  VEX_W_50_M_0,
+  VEX_W_51_P_0,
+  VEX_W_51_P_1,
+  VEX_W_51_P_2,
+  VEX_W_51_P_3,
+  VEX_W_52_P_0,
+  VEX_W_52_P_1,
+  VEX_W_53_P_0,
+  VEX_W_53_P_1,
+  VEX_W_58_P_0,
+  VEX_W_58_P_1,
+  VEX_W_58_P_2,
+  VEX_W_58_P_3,
+  VEX_W_59_P_0,
+  VEX_W_59_P_1,
+  VEX_W_59_P_2,
+  VEX_W_59_P_3,
+  VEX_W_5A_P_0,
+  VEX_W_5A_P_1,
+  VEX_W_5A_P_3,
+  VEX_W_5B_P_0,
+  VEX_W_5B_P_1,
+  VEX_W_5B_P_2,
+  VEX_W_5C_P_0,
+  VEX_W_5C_P_1,
+  VEX_W_5C_P_2,
+  VEX_W_5C_P_3,
+  VEX_W_5D_P_0,
+  VEX_W_5D_P_1,
+  VEX_W_5D_P_2,
+  VEX_W_5D_P_3,
+  VEX_W_5E_P_0,
+  VEX_W_5E_P_1,
+  VEX_W_5E_P_2,
+  VEX_W_5E_P_3,
+  VEX_W_5F_P_0,
+  VEX_W_5F_P_1,
+  VEX_W_5F_P_2,
+  VEX_W_5F_P_3,
+  VEX_W_60_P_2,
+  VEX_W_61_P_2,
+  VEX_W_62_P_2,
+  VEX_W_63_P_2,
+  VEX_W_64_P_2,
+  VEX_W_65_P_2,
+  VEX_W_66_P_2,
+  VEX_W_67_P_2,
+  VEX_W_68_P_2,
+  VEX_W_69_P_2,
+  VEX_W_6A_P_2,
+  VEX_W_6B_P_2,
+  VEX_W_6C_P_2,
+  VEX_W_6D_P_2,
+  VEX_W_6F_P_1,
+  VEX_W_6F_P_2,
+  VEX_W_70_P_1,
+  VEX_W_70_P_2,
+  VEX_W_70_P_3,
+  VEX_W_71_R_2_P_2,
+  VEX_W_71_R_4_P_2,
+  VEX_W_71_R_6_P_2,
+  VEX_W_72_R_2_P_2,
+  VEX_W_72_R_4_P_2,
+  VEX_W_72_R_6_P_2,
+  VEX_W_73_R_2_P_2,
+  VEX_W_73_R_3_P_2,
+  VEX_W_73_R_6_P_2,
+  VEX_W_73_R_7_P_2,
+  VEX_W_74_P_2,
+  VEX_W_75_P_2,
+  VEX_W_76_P_2,
+  VEX_W_77_P_0,
+  VEX_W_7C_P_2,
+  VEX_W_7C_P_3,
+  VEX_W_7D_P_2,
+  VEX_W_7D_P_3,
+  VEX_W_7E_P_1,
+  VEX_W_7F_P_1,
+  VEX_W_7F_P_2,
+  VEX_W_AE_R_2_M_0,
+  VEX_W_AE_R_3_M_0,
+  VEX_W_C2_P_0,
+  VEX_W_C2_P_1,
+  VEX_W_C2_P_2,
+  VEX_W_C2_P_3,
+  VEX_W_C4_P_2,
+  VEX_W_C5_P_2,
+  VEX_W_D0_P_2,
+  VEX_W_D0_P_3,
+  VEX_W_D1_P_2,
+  VEX_W_D2_P_2,
+  VEX_W_D3_P_2,
+  VEX_W_D4_P_2,
+  VEX_W_D5_P_2,
+  VEX_W_D6_P_2,
+  VEX_W_D7_P_2_M_1,
+  VEX_W_D8_P_2,
+  VEX_W_D9_P_2,
+  VEX_W_DA_P_2,
+  VEX_W_DB_P_2,
+  VEX_W_DC_P_2,
+  VEX_W_DD_P_2,
+  VEX_W_DE_P_2,
+  VEX_W_DF_P_2,
+  VEX_W_E0_P_2,
+  VEX_W_E1_P_2,
+  VEX_W_E2_P_2,
+  VEX_W_E3_P_2,
+  VEX_W_E4_P_2,
+  VEX_W_E5_P_2,
+  VEX_W_E6_P_1,
+  VEX_W_E6_P_2,
+  VEX_W_E6_P_3,
+  VEX_W_E7_P_2_M_0,
+  VEX_W_E8_P_2,
+  VEX_W_E9_P_2,
+  VEX_W_EA_P_2,
+  VEX_W_EB_P_2,
+  VEX_W_EC_P_2,
+  VEX_W_ED_P_2,
+  VEX_W_EE_P_2,
+  VEX_W_EF_P_2,
+  VEX_W_F0_P_3_M_0,
+  VEX_W_F1_P_2,
+  VEX_W_F2_P_2,
+  VEX_W_F3_P_2,
+  VEX_W_F4_P_2,
+  VEX_W_F5_P_2,
+  VEX_W_F6_P_2,
+  VEX_W_F7_P_2,
+  VEX_W_F8_P_2,
+  VEX_W_F9_P_2,
+  VEX_W_FA_P_2,
+  VEX_W_FB_P_2,
+  VEX_W_FC_P_2,
+  VEX_W_FD_P_2,
+  VEX_W_FE_P_2,
+  VEX_W_3800_P_2,
+  VEX_W_3801_P_2,
+  VEX_W_3802_P_2,
+  VEX_W_3803_P_2,
+  VEX_W_3804_P_2,
+  VEX_W_3805_P_2,
+  VEX_W_3806_P_2,
+  VEX_W_3807_P_2,
+  VEX_W_3808_P_2,
+  VEX_W_3809_P_2,
+  VEX_W_380A_P_2,
+  VEX_W_380B_P_2,
+  VEX_W_380C_P_2,
+  VEX_W_380D_P_2,
+  VEX_W_380E_P_2,
+  VEX_W_380F_P_2,
+  VEX_W_3817_P_2,
+  VEX_W_3818_P_2_M_0,
+  VEX_W_3819_P_2_M_0,
+  VEX_W_381A_P_2_M_0,
+  VEX_W_381C_P_2,
+  VEX_W_381D_P_2,
+  VEX_W_381E_P_2,
+  VEX_W_3820_P_2,
+  VEX_W_3821_P_2,
+  VEX_W_3822_P_2,
+  VEX_W_3823_P_2,
+  VEX_W_3824_P_2,
+  VEX_W_3825_P_2,
+  VEX_W_3828_P_2,
+  VEX_W_3829_P_2,
+  VEX_W_382A_P_2_M_0,
+  VEX_W_382B_P_2,
+  VEX_W_382C_P_2_M_0,
+  VEX_W_382D_P_2_M_0,
+  VEX_W_382E_P_2_M_0,
+  VEX_W_382F_P_2_M_0,
+  VEX_W_3830_P_2,
+  VEX_W_3831_P_2,
+  VEX_W_3832_P_2,
+  VEX_W_3833_P_2,
+  VEX_W_3834_P_2,
+  VEX_W_3835_P_2,
+  VEX_W_3837_P_2,
+  VEX_W_3838_P_2,
+  VEX_W_3839_P_2,
+  VEX_W_383A_P_2,
+  VEX_W_383B_P_2,
+  VEX_W_383C_P_2,
+  VEX_W_383D_P_2,
+  VEX_W_383E_P_2,
+  VEX_W_383F_P_2,
+  VEX_W_3840_P_2,
+  VEX_W_3841_P_2,
+  VEX_W_38DB_P_2,
+  VEX_W_38DC_P_2,
+  VEX_W_38DD_P_2,
+  VEX_W_38DE_P_2,
+  VEX_W_38DF_P_2,
+  VEX_W_3A04_P_2,
+  VEX_W_3A05_P_2,
+  VEX_W_3A06_P_2,
+  VEX_W_3A08_P_2,
+  VEX_W_3A09_P_2,
+  VEX_W_3A0A_P_2,
+  VEX_W_3A0B_P_2,
+  VEX_W_3A0C_P_2,
+  VEX_W_3A0D_P_2,
+  VEX_W_3A0E_P_2,
+  VEX_W_3A0F_P_2,
+  VEX_W_3A14_P_2,
+  VEX_W_3A15_P_2,
+  VEX_W_3A18_P_2,
+  VEX_W_3A19_P_2,
+  VEX_W_3A20_P_2,
+  VEX_W_3A21_P_2,
+  VEX_W_3A40_P_2,
+  VEX_W_3A41_P_2,
+  VEX_W_3A42_P_2,
+  VEX_W_3A44_P_2,
+  VEX_W_3A4A_P_2,
+  VEX_W_3A4B_P_2,
+  VEX_W_3A4C_P_2,
+  VEX_W_3A60_P_2,
+  VEX_W_3A61_P_2,
+  VEX_W_3A62_P_2,
+  VEX_W_3A63_P_2,
+  VEX_W_3ADF_P_2
 };
 
 typedef void (*op_rtn) (int bytemode, int sizeflag);
@@ -1979,11 +2253,17 @@ static char scratchbuf[100];
 static unsigned char *start_codep;
 static unsigned char *insn_codep;
 static unsigned char *codep;
-static const char *lock_prefix;
-static const char *data_prefix;
-static const char *addr_prefix;
-static const char *repz_prefix;
-static const char *repnz_prefix;
+static int last_lock_prefix;
+static int last_repz_prefix;
+static int last_repnz_prefix;
+static int last_data_prefix;
+static int last_addr_prefix;
+static int last_rex_prefix;
+static int last_seg_prefix;
+#define MAX_CODE_LENGTH 15
+/* We can up to 14 prefixes since the maximum instruction length is
+   15bytes.  */
+static int all_prefixes[MAX_CODE_LENGTH - 1];
 static disassemble_info *the_info;
 static struct
   {
@@ -2082,6 +2362,44 @@ static const char *att_index16[] = {
   "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
 };
 
+static const char **names_mm;
+static const char *intel_names_mm[] = {
+  "mm0", "mm1", "mm2", "mm3",
+  "mm4", "mm5", "mm6", "mm7"
+};
+static const char *att_names_mm[] = {
+  "%mm0", "%mm1", "%mm2", "%mm3",
+  "%mm4", "%mm5", "%mm6", "%mm7"
+};
+
+static const char **names_xmm;
+static const char *intel_names_xmm[] = {
+  "xmm0", "xmm1", "xmm2", "xmm3",
+  "xmm4", "xmm5", "xmm6", "xmm7",
+  "xmm8", "xmm9", "xmm10", "xmm11",
+  "xmm12", "xmm13", "xmm14", "xmm15"
+};
+static const char *att_names_xmm[] = {
+  "%xmm0", "%xmm1", "%xmm2", "%xmm3",
+  "%xmm4", "%xmm5", "%xmm6", "%xmm7",
+  "%xmm8", "%xmm9", "%xmm10", "%xmm11",
+  "%xmm12", "%xmm13", "%xmm14", "%xmm15"
+};
+
+static const char **names_ymm;
+static const char *intel_names_ymm[] = {
+  "ymm0", "ymm1", "ymm2", "ymm3",
+  "ymm4", "ymm5", "ymm6", "ymm7",
+  "ymm8", "ymm9", "ymm10", "ymm11",
+  "ymm12", "ymm13", "ymm14", "ymm15"
+};
+static const char *att_names_ymm[] = {
+  "%ymm0", "%ymm1", "%ymm2", "%ymm3",
+  "%ymm4", "%ymm5", "%ymm6", "%ymm7",
+  "%ymm8", "%ymm9", "%ymm10", "%ymm11",
+  "%ymm12", "%ymm13", "%ymm14", "%ymm15"
+};
+
 static const struct dis386 reg_table[][8] = {
   /* REG_80 */
   {
@@ -2119,11 +2437,11 @@ static const struct dis386 reg_table[][8] = {
   /* REG_8F */
   {
     { "popU",  { stackEv } },
+    { XOP_8F_TABLE (XOP_09) },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { XOP_8F_TABLE (XOP_09) },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
   },
@@ -2435,6 +2753,28 @@ static const struct dis386 reg_table[][8] = {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
   },
+  /* REG_XOP_LWPCB */
+  {
+    { "llwpcb", { { OP_LWPCB_E, 0 } } },
+    { "slwpcb",        { { OP_LWPCB_E, 0 } } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+  },
+  /* REG_XOP_LWP */
+  {
+    { "lwpins", { { OP_LWP_E, 0 }, Ed, { OP_LWP_I, 0 } } },
+    { "lwpval",        { { OP_LWP_E, 0 }, Ed, { OP_LWP_I, 0 } } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+  },
 };
 
 static const struct dis386 prefix_table[][4] = {
@@ -3328,32 +3668,32 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_VEX_10 */
   {
-    { "vmovups", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_10_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_10_P_1) },
-    { "vmovupd", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_10_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_10_P_3) },
   },
 
   /* PREFIX_VEX_11 */
   {
-    { "vmovups", { EXxS, XM } },
+    { VEX_W_TABLE (VEX_W_11_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_11_P_1) },
-    { "vmovupd", { EXxS, XM } },
+    { VEX_W_TABLE (VEX_W_11_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_11_P_3) },
   },
 
   /* PREFIX_VEX_12 */
   {
     { MOD_TABLE (MOD_VEX_12_PREFIX_0) },
-    { "vmovsldup", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_12_P_1) },
     { VEX_LEN_TABLE (VEX_LEN_12_P_2) },
-    { "vmovddup", { XM, EXymmq } },
+    { VEX_W_TABLE (VEX_W_12_P_3) },
   },
 
   /* PREFIX_VEX_16 */
   {
     { MOD_TABLE (MOD_VEX_16_PREFIX_0) },
-    { "vmovshdup", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_16_P_1) },
     { VEX_LEN_TABLE (VEX_LEN_16_P_2) },
     { "(bad)", { XX } },
   },
@@ -3400,15 +3740,15 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_VEX_51 */
   {
-    { "vsqrtps", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_51_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_51_P_1) },
-    { "vsqrtpd", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_51_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_51_P_3) },
   },
 
   /* PREFIX_VEX_52 */
   {
-    { "vrsqrtps", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_52_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_52_P_1) },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -3416,7 +3756,7 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_VEX_53 */
   {
-    { "vrcpps",        { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_53_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_53_P_1) },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -3424,23 +3764,23 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_VEX_58 */
   {
-    { "vaddps",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_58_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_58_P_1) },
-    { "vaddpd",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_58_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_58_P_3) },
   },
 
   /* PREFIX_VEX_59 */
   {
-    { "vmulps",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_59_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_59_P_1) },
-    { "vmulpd",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_59_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_59_P_3) },
   },
 
   /* PREFIX_VEX_5A */
   {
-    { "vcvtps2pd", { XM, EXxmmq } },
+    { VEX_W_TABLE (VEX_W_5A_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_5A_P_1) },
     { "vcvtpd2ps%XY", { XMM, EXx } },
     { VEX_LEN_TABLE (VEX_LEN_5A_P_3) },
@@ -3448,41 +3788,41 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_VEX_5B */
   {
-    { "vcvtdq2ps", { XM, EXx } },
-    { "vcvttps2dq", { XM, EXx } },
-    { "vcvtps2dq", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_5B_P_0) },
+    { VEX_W_TABLE (VEX_W_5B_P_1) },
+    { VEX_W_TABLE (VEX_W_5B_P_2) },
     { "(bad)", { XX } },
   },
 
   /* PREFIX_VEX_5C */
   {
-    { "vsubps",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_5C_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_5C_P_1) },
-    { "vsubpd",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_5C_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_5C_P_3) },
   },
 
   /* PREFIX_VEX_5D */
   {
-    { "vminps",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_5D_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_5D_P_1) },
-    { "vminpd",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_5D_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_5D_P_3) },
   },
 
   /* PREFIX_VEX_5E */
   {
-    { "vdivps",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_5E_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_5E_P_1) },
-    { "vdivpd",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_5E_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_5E_P_3) },
   },
 
   /* PREFIX_VEX_5F */
   {
-    { "vmaxps",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_5F_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_5F_P_1) },
-    { "vmaxpd",        { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_5F_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_5F_P_3) },
   },
 
@@ -3609,8 +3949,8 @@ static const struct dis386 prefix_table[][4] = {
   /* PREFIX_VEX_6F */
   {
     { "(bad)", { XX } },
-    { "vmovdqu", { XM, EXx } },
-    { "vmovdqa", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_6F_P_1) },
+    { VEX_W_TABLE (VEX_W_6F_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -3728,7 +4068,7 @@ static const struct dis386 prefix_table[][4] = {
 
   /* PREFIX_VEX_77 */
   {
-    { "",      { VZERO } },
+    { VEX_W_TABLE (VEX_W_77_P_0) },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -3738,16 +4078,16 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vhaddpd", { XM, Vex, EXx } },
-    { "vhaddps", { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_7C_P_2) },
+    { VEX_W_TABLE (VEX_W_7C_P_3) },
   },
 
   /* PREFIX_VEX_7D */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vhsubpd", { XM, Vex, EXx } },
-    { "vhsubps", { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_7D_P_2) },
+    { VEX_W_TABLE (VEX_W_7D_P_3) },
   },
 
   /* PREFIX_VEX_7E */
@@ -3761,16 +4101,16 @@ static const struct dis386 prefix_table[][4] = {
   /* PREFIX_VEX_7F */
   {
     { "(bad)", { XX } },
-    { "vmovdqu", { EXxS, XM } },
-    { "vmovdqa", { EXxS, XM } },
+    { VEX_W_TABLE (VEX_W_7F_P_1) },
+    { VEX_W_TABLE (VEX_W_7F_P_2) },
     { "(bad)", { XX } },
   },
 
   /* PREFIX_VEX_C2 */
   {
-    { "vcmpps",        { XM, Vex, EXx, VCMP } },
+    { VEX_W_TABLE (VEX_W_C2_P_0) },
     { VEX_LEN_TABLE (VEX_LEN_C2_P_1) },
-    { "vcmppd",        { XM, Vex, EXx, VCMP } },
+    { VEX_W_TABLE (VEX_W_C2_P_2) },
     { VEX_LEN_TABLE (VEX_LEN_C2_P_3) },
   },
 
@@ -3794,8 +4134,8 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vaddsubpd", { XM, Vex, EXx } },
-    { "vaddsubps", { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_D0_P_2) },
+    { VEX_W_TABLE (VEX_W_D0_P_3) },
   },
 
   /* PREFIX_VEX_D1 */
@@ -3969,9 +4309,9 @@ static const struct dis386 prefix_table[][4] = {
   /* PREFIX_VEX_E6 */
   {
     { "(bad)", { XX } },
-    { "vcvtdq2pd", { XM, EXxmmq } },
-    { "vcvttpd2dq%XY", { XMM, EXx } },
-    { "vcvtpd2dq%XY", { XMM, EXx } },
+    { VEX_W_TABLE (VEX_W_E6_P_1) },
+    { VEX_W_TABLE (VEX_W_E6_P_2) },
+    { VEX_W_TABLE (VEX_W_E6_P_3) },
   },
 
   /* PREFIX_VEX_E7 */
@@ -4266,7 +4606,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vpermilps", { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_380C_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4274,7 +4614,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vpermilpd", { XM, Vex, EXx } },
+    { VEX_W_TABLE (VEX_W_380D_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4282,7 +4622,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vtestps", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_380E_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4290,7 +4630,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vtestpd", { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_380F_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4298,7 +4638,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vptest",        { XM, EXx } },
+    { VEX_W_TABLE (VEX_W_3817_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4882,7 +5222,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vpermilps", { XM, EXx, Ib } },
+    { VEX_W_TABLE (VEX_W_3A04_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4890,7 +5230,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vpermilpd", { XM, EXx, Ib } },
+    { VEX_W_TABLE (VEX_W_3A05_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4906,7 +5246,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vroundps", { XM, EXx, Ib } },
+    { VEX_W_TABLE (VEX_W_3A08_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4914,7 +5254,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vroundpd", { XM, EXx, Ib } },
+    { VEX_W_TABLE (VEX_W_3A09_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4938,7 +5278,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vblendps", { XM, Vex, EXx, Ib } },
+    { VEX_W_TABLE (VEX_W_3A0C_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -4946,7 +5286,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vblendpd", { XM, Vex, EXx, Ib } },
+    { VEX_W_TABLE (VEX_W_3A0D_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -5042,7 +5382,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vdpps", { XM, Vex, EXx, Ib } },
+    { VEX_W_TABLE (VEX_W_3A40_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -5074,7 +5414,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vblendvps", { XM, Vex, EXx, XMVexI4 } },
+    { VEX_W_TABLE (VEX_W_3A4A_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -5082,7 +5422,7 @@ static const struct dis386 prefix_table[][4] = {
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vblendvpd", { XM, Vex, EXx, XMVexI4 } },
+    { VEX_W_TABLE (VEX_W_3A4B_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -6343,9 +6683,8 @@ static const struct dis386 three_byte_table[][256] = {
   },
 };
 
-
-static const struct dis386 vex_table[][256] = {
-  /* VEX_0F */
+static const struct dis386 xop_table[][256] = {
+  /* XOP_08 */
   {
     /* 00 */
     { "(bad)",         { XX } },
@@ -6366,14 +6705,14 @@ static const struct dis386 vex_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) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 18 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6393,14 +6732,14 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 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) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 30 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6438,103 +6777,103 @@ static const struct dis386 vex_table[][256] = {
     { "(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 } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 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) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 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) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 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 } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 70 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 88 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 78 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 90 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 80 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 98 */
+    { "(bad)",         { XX } },
+    { "vpmacssww",     { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    { "vpmacsswd",     { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    { "vpmacssdql",    { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    /* 88 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "vpmacssdd",     { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    { "vpmacssdqh",    { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    /* 90 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "vpmacsww",      { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    { "vpmacswd",      { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    { "vpmacsdql",     { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    /* 98 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* a0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "vpmacsdd",      { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    { "vpmacsdqh",     { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    /* a0 */
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "vpcmov",        { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
+    { "vpperm",        { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "vpmadcsswd",    { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
     { "(bad)",         { XX } },
     /* a8 */
     { "(bad)",         { XX } },
@@ -6543,16 +6882,16 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { REG_TABLE (REG_VEX_AE) },
     { "(bad)",         { XX } },
-    /* b0 */
     { "(bad)",         { XX } },
+    /* b0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "vpmadcswd",     { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
     { "(bad)",         { XX } },
     /* b8 */
     { "(bad)",         { XX } },
@@ -6564,99 +6903,34 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* c0 */
+    { "vprotb",        { XM, Vex_2src_1, Ib } },
+    { "vprotw",        { XM, Vex_2src_1, Ib } },
+    { "vprotd",        { XM, Vex_2src_1, Ib } },
+    { "vprotq",        { XM, Vex_2src_1, Ib } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { 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 } },
+    { "vpcomb",        { XM, Vex128, EXx, Ib } },
+    { "vpcomw",        { XM, Vex128, EXx, Ib } },
+    { "vpcomd",        { XM, Vex128, EXx, Ib } },
+    { "vpcomq",        { XM, Vex128, EXx, Ib } },
+    /* d0 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(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 } },
@@ -6664,63 +6938,25 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(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) },
+    /* e0 */
     { "(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 } },
     { "(bad)",         { XX } },
+    /* e8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 48 */
     { "(bad)",         { XX } },
+    { "vpcomub",       { XM, Vex128, EXx, Ib } },
+    { "vpcomuw",       { XM, Vex128, EXx, Ib } },
+    { "vpcomud",       { XM, Vex128, EXx, Ib } },
+    { "vpcomuq",       { XM, Vex128, EXx, Ib } },
+    /* f0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6728,8 +6964,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 50 */
     { "(bad)",         { XX } },
+    /* f8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6737,8 +6973,11 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 58 */
     { "(bad)",         { XX } },
+  },
+  /* XOP_09 */
+  {
+    /* 00 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6746,8 +6985,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 60 */
     { "(bad)",         { XX } },
+    /* 08 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6755,16 +6994,17 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 68 */
     { "(bad)",         { XX } },
+    /* 10 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { REG_TABLE (REG_XOP_LWPCB) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 70 */
+    /* 18 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6773,7 +7013,7 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 78 */
+    /* 20 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6782,7 +7022,7 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 80 */
+    /* 28 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6791,7 +7031,7 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 88 */
+    /* 30 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6800,181 +7040,134 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 90 */
+    /* 38 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(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 } },
+    /* 40 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_VEX_38A6) },
-    { PREFIX_TABLE (PREFIX_VEX_38A7) },
-    /* a8 */
-    { 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 } },
+    /* 48 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_VEX_38B6) },
-    { PREFIX_TABLE (PREFIX_VEX_38B7) },
-    /* b8 */
-    { 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 } },
+    /* 50 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* c8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 58 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* d0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 60 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* d8 */
     { "(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 } },
+    /* 68 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* e8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 70 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* f0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 78 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* f8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 80 */
+    { VEX_LEN_TABLE (VEX_LEN_XOP_09_80) },
+    { VEX_LEN_TABLE (VEX_LEN_XOP_09_81) },
+    { "vfrczss",       { XM, EXd } },
+    { "vfrczsd",       { XM, EXq } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 88 */
     { "(bad)",         { XX } },
-  },
-  /* VEX_0F3A */
-  {
-    /* 00 */
     { "(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_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 } },
+    /* 90 */
+    { "vprotb",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vprotw",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vprotd",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vprotq",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vpshlb",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vpshlw",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vpshld",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vpshlq",                { XM, Vex_2src_1, Vex_2src_2 } },
+    /* 98 */
+    { "vpshab",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vpshaw",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vpshad",                { XM, Vex_2src_1, Vex_2src_2 } },
+    { "vpshaq",                { XM, Vex_2src_1, Vex_2src_2 } },
     { "(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 */
-    { PREFIX_TABLE (PREFIX_VEX_3A18) },
-    { PREFIX_TABLE (PREFIX_VEX_3A19) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* a0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 20 */
-    { PREFIX_TABLE (PREFIX_VEX_3A20) },
-    { PREFIX_TABLE (PREFIX_VEX_3A21) },
-    { PREFIX_TABLE (PREFIX_VEX_3A22) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* a8 */
     { "(bad)",         { XX } },
-    /* 28 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6982,8 +7175,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* b0 */
     { "(bad)",         { XX } },
-    /* 30 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6991,8 +7184,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* b8 */
     { "(bad)",         { XX } },
-    /* 38 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7000,62 +7193,53 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* c0 */
     { "(bad)",         { XX } },
-    /* 40 */
-    { PREFIX_TABLE (PREFIX_VEX_3A40) },
-    { PREFIX_TABLE (PREFIX_VEX_3A41) },
-    { PREFIX_TABLE (PREFIX_VEX_3A42) },
+    { "vphaddbw",      { XM, EXxmm } },
+    { "vphaddbd",      { XM, EXxmm } },
+    { "vphaddbq",      { XM, EXxmm } },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_VEX_3A44) },
     { "(bad)",         { XX } },
+    { "vphaddwd",      { XM, EXxmm } },
+    { "vphaddwq",      { XM, EXxmm } },
+    /* c8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 48 */
     { "(bad)",         { XX } },
+    { "vphadddq",      { XM, EXxmm } },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_VEX_3A4A) },
-    { PREFIX_TABLE (PREFIX_VEX_3A4B) },
-    { PREFIX_TABLE (PREFIX_VEX_3A4C) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 50 */
+    /* d0 */
     { "(bad)",         { XX } },
+    { "vphaddubw",     { XM, EXxmm } },
+    { "vphaddubd",     { XM, EXxmm } },
+    { "vphaddubq",     { XM, EXxmm } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "vphadduwd",     { XM, EXxmm } },
+    { "vphadduwq",     { XM, EXxmm } },
+    /* d8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "vphaddudq",     { XM, EXxmm } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 58 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* e0 */
     { "(bad)",         { XX } },
+    { "vphsubbw",      { XM, EXxmm } },
+    { "vphsubwd",      { XM, EXxmm } },
+    { "vphsubdq",      { XM, EXxmm } },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_VEX_3A5C) },
-    { PREFIX_TABLE (PREFIX_VEX_3A5D) },
-    { PREFIX_TABLE (PREFIX_VEX_3A5E) },
-    { PREFIX_TABLE (PREFIX_VEX_3A5F) },
-    /* 60 */
-    { 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 } },
+    /* e8 */
     { "(bad)",         { XX } },
-    /* 68 */
-    { PREFIX_TABLE (PREFIX_VEX_3A68) },
-    { PREFIX_TABLE (PREFIX_VEX_3A69) },
-    { PREFIX_TABLE (PREFIX_VEX_3A6A) },
-    { PREFIX_TABLE (PREFIX_VEX_3A6B) },
-    { PREFIX_TABLE (PREFIX_VEX_3A6C) },
-    { PREFIX_TABLE (PREFIX_VEX_3A6D) },
-    { PREFIX_TABLE (PREFIX_VEX_3A6E) },
-    { PREFIX_TABLE (PREFIX_VEX_3A6F) },
-    /* 70 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7063,17 +7247,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* f0 */
     { "(bad)",         { XX } },
-    /* 78 */
-    { PREFIX_TABLE (PREFIX_VEX_3A78) },
-    { PREFIX_TABLE (PREFIX_VEX_3A79) },
-    { PREFIX_TABLE (PREFIX_VEX_3A7A) },
-    { PREFIX_TABLE (PREFIX_VEX_3A7B) },
-    { PREFIX_TABLE (PREFIX_VEX_3A7C) },
-    { PREFIX_TABLE (PREFIX_VEX_3A7D) },
-    { PREFIX_TABLE (PREFIX_VEX_3A7E) },
-    { PREFIX_TABLE (PREFIX_VEX_3A7F) },
-    /* 80 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7081,8 +7256,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* f8 */
     { "(bad)",         { XX } },
-    /* 88 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7090,8 +7265,11 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+  },
+  /* XOP_0A */
+  {
+    /* 00 */
     { "(bad)",         { XX } },
-    /* 90 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7099,8 +7277,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 08 */
     { "(bad)",         { XX } },
-    /* 98 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7108,80 +7286,80 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 10 */
     { "(bad)",         { XX } },
-    /* a0 */
     { "(bad)",         { XX } },
+    { REG_TABLE (REG_XOP_LWP) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 18 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* a8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 20 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* b0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 28 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* b8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 30 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* c0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 38 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* c8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 40 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* d0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 48 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* d8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 50 */
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_VEX_3ADF) },
-    /* e0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7189,8 +7367,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 58 */
     { "(bad)",         { XX } },
-    /* e8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7198,8 +7376,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 60 */
     { "(bad)",         { XX } },
-    /* f0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7207,8 +7385,8 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 68 */
     { "(bad)",         { XX } },
-    /* f8 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7216,1219 +7394,3536 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 70 */
     { "(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 } },
-  },
-
+    { "(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 } },
+  },
+};
+
+static const struct dis386 vex_table[][256] = {
+  /* VEX_0F */
+  {
+    /* 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 */
+    { PREFIX_TABLE (PREFIX_VEX_10) },
+    { PREFIX_TABLE (PREFIX_VEX_11) },
+    { PREFIX_TABLE (PREFIX_VEX_12) },
+    { MOD_TABLE (MOD_VEX_13) },
+    { VEX_W_TABLE (VEX_W_14) },
+    { VEX_W_TABLE (VEX_W_15) },
+    { PREFIX_TABLE (PREFIX_VEX_16) },
+    { MOD_TABLE (MOD_VEX_17) },
+    /* 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 */
+    { VEX_W_TABLE (VEX_W_28) },
+    { VEX_W_TABLE (VEX_W_29) },
+    { 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 } },
+    { "(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 } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 50 */
+    { MOD_TABLE (MOD_VEX_50) },
+    { 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 } },
+    { "(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 } },
+    { REG_TABLE (REG_VEX_AE) },
+    { "(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 } },
+    { 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 } },
+    { "(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 } },
+    { "(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 } },
+    { "(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 } },
+    { 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 } },
+    { PREFIX_TABLE (PREFIX_VEX_38A6) },
+    { PREFIX_TABLE (PREFIX_VEX_38A7) },
+    /* a8 */
+    { 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 } },
+    { PREFIX_TABLE (PREFIX_VEX_38B6) },
+    { PREFIX_TABLE (PREFIX_VEX_38B7) },
+    /* b8 */
+    { 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 } },
+    /* 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_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 } },
+    /* 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_0F3A */
+  {
+    /* 00 */
+    { "(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_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_VEX_3A14) },
+    { PREFIX_TABLE (PREFIX_VEX_3A15) },
+    { PREFIX_TABLE (PREFIX_VEX_3A16) },
+    { PREFIX_TABLE (PREFIX_VEX_3A17) },
+    /* 18 */
+    { 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_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 } },
+    /* 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_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 } },
+    { 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 } },
+    /* 58 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A5C) },
+    { PREFIX_TABLE (PREFIX_VEX_3A5D) },
+    { PREFIX_TABLE (PREFIX_VEX_3A5E) },
+    { PREFIX_TABLE (PREFIX_VEX_3A5F) },
+    /* 60 */
+    { 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 */
+    { PREFIX_TABLE (PREFIX_VEX_3A68) },
+    { PREFIX_TABLE (PREFIX_VEX_3A69) },
+    { PREFIX_TABLE (PREFIX_VEX_3A6A) },
+    { PREFIX_TABLE (PREFIX_VEX_3A6B) },
+    { PREFIX_TABLE (PREFIX_VEX_3A6C) },
+    { PREFIX_TABLE (PREFIX_VEX_3A6D) },
+    { PREFIX_TABLE (PREFIX_VEX_3A6E) },
+    { PREFIX_TABLE (PREFIX_VEX_3A6F) },
+    /* 70 */
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 78 */
+    { PREFIX_TABLE (PREFIX_VEX_3A78) },
+    { PREFIX_TABLE (PREFIX_VEX_3A79) },
+    { PREFIX_TABLE (PREFIX_VEX_3A7A) },
+    { PREFIX_TABLE (PREFIX_VEX_3A7B) },
+    { PREFIX_TABLE (PREFIX_VEX_3A7C) },
+    { PREFIX_TABLE (PREFIX_VEX_3A7D) },
+    { PREFIX_TABLE (PREFIX_VEX_3A7E) },
+    { PREFIX_TABLE (PREFIX_VEX_3A7F) },
+    /* 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_VEX_3ADF) },
+    /* 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 } },
+  },
+};
+
+static const struct dis386 vex_len_table[][2] = {
+  /* VEX_LEN_10_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_10_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_10_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_10_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_11_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_11_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_11_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_11_P_3) },
+    { "(bad)",         { XX } },
+  },
+
   /* VEX_LEN_12_P_0_M_0 */
   {
-    { "vmovlps",       { XM, Vex128, EXq } },
+    { VEX_W_TABLE (VEX_W_12_P_0_M_0) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_12_P_0_M_1 */
+  {
+    { VEX_W_TABLE (VEX_W_12_P_0_M_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_12_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_12_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_13_M_0 */
+  {
+    { VEX_W_TABLE (VEX_W_13_M_0) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_16_P_0_M_0 */
+  {
+    { VEX_W_TABLE (VEX_W_16_P_0_M_0) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_16_P_0_M_1 */
+  {
+    { VEX_W_TABLE (VEX_W_16_P_0_M_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_16_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_16_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_17_M_0 */
+  {
+    { VEX_W_TABLE (VEX_W_17_M_0) },
+    { "(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 */
+  {
+    { VEX_W_TABLE (VEX_W_2E_P_0) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2E_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_2E_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2F_P_0 */
+  {
+    { VEX_W_TABLE (VEX_W_2F_P_0) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_2F_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_2F_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_51_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_51_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_51_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_51_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_52_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_52_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_53_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_53_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_58_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_58_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_58_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_58_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_59_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_59_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_59_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_59_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5A_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_5A_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5A_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_5A_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5C_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_5C_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5C_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_5C_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5D_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_5D_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5D_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_5D_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5E_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_5E_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5E_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_5E_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5F_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_5F_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_5F_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_5F_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_60_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_60_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_61_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_61_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_62_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_62_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_63_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_63_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_64_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_64_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_65_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_65_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_66_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_66_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_67_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_67_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_68_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_68_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_69_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_69_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6A_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_6A_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6B_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_6B_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6C_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_6C_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6D_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_6D_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_6E_P_2 */
+  {
+    { "vmovK",         { XM, Edq } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_70_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_70_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_70_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_70_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_70_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_70_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_71_R_2_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_71_R_2_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_71_R_4_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_71_R_4_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_71_R_6_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_71_R_6_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_72_R_2_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_72_R_2_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_72_R_4_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_72_R_4_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_72_R_6_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_72_R_6_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_73_R_2_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_73_R_2_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_73_R_3_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_73_R_3_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_73_R_6_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_73_R_6_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_73_R_7_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_73_R_7_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_74_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_74_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_75_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_75_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_76_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_76_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_7E_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_7E_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_7E_P_2 */
+  {
+    { "vmovK",         { Edq, XM } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_AE_R_2_M_0 */
+  {
+    { VEX_W_TABLE (VEX_W_AE_R_2_M_0) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_AE_R_3_M_0 */
+  {
+    { VEX_W_TABLE (VEX_W_AE_R_3_M_0) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_C2_P_1 */
+  {
+    { VEX_W_TABLE (VEX_W_C2_P_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_C2_P_3 */
+  {
+    { VEX_W_TABLE (VEX_W_C2_P_3) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_C4_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_C4_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_C5_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_C5_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D1_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_D1_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D2_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_D2_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D3_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_D3_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D4_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_D4_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D5_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_D5_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D6_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_D6_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D7_P_2_M_1 */
+  {
+    { VEX_W_TABLE (VEX_W_D7_P_2_M_1) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D8_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_D8_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_D9_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_D9_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DA_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_DA_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DB_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_DB_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DC_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_DC_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DD_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_DD_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DE_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_DE_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_DF_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_DF_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E0_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_E0_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E1_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_E1_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E2_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_E2_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E3_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_E3_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E4_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_E4_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E5_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_E5_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E8_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_E8_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_E9_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_E9_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EA_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_EA_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EB_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_EB_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EC_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_EC_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_ED_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_ED_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EE_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_EE_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_EF_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_EF_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F1_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_F1_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F2_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_F2_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F3_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_F3_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F4_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_F4_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F5_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_F5_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F6_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_F6_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F7_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_F7_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F8_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_F8_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_F9_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_F9_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_FA_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_FA_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_FB_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_FB_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_FC_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_FC_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_FD_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_FD_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_FE_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_FE_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3800_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3800_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3801_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3801_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3802_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3802_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3803_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3803_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3804_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3804_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3805_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3805_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3806_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3806_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3807_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3807_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3808_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3808_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3809_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3809_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_380A_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_380A_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_380B_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_380B_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3819_P_2_M_0 */
+  {
+    { "(bad)",         { XX } },
+    { VEX_W_TABLE (VEX_W_3819_P_2_M_0) },
+  },
+
+  /* VEX_LEN_381A_P_2_M_0 */
+  {
+    { "(bad)",         { XX } },
+    { VEX_W_TABLE (VEX_W_381A_P_2_M_0) },
+  },
+
+  /* VEX_LEN_381C_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_381C_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_381D_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_381D_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_381E_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_381E_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3820_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3820_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3821_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3821_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3822_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3822_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3823_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3823_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3824_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3824_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3825_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3825_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3828_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3828_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3829_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3829_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_382A_P_2_M_0 */
+  {
+    { VEX_W_TABLE (VEX_W_382A_P_2_M_0) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_382B_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_382B_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3830_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3830_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3831_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3831_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3832_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3832_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3833_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3833_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3834_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3834_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3835_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3835_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3837_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3837_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3838_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3838_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3839_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3839_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383A_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_383A_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383B_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_383B_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383C_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_383C_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383D_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_383D_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383E_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_383E_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_383F_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_383F_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3840_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3840_P_2) },
     { "(bad)",         { XX } },
   },
 
-  /* VEX_LEN_12_P_0_M_1 */
+  /* VEX_LEN_3841_P_2 */
   {
-    { "vmovhlps",      { XM, Vex128, EXq } },
+    { VEX_W_TABLE (VEX_W_3841_P_2) },
     { "(bad)",         { XX } },
   },
 
-  /* VEX_LEN_12_P_2 */
+  /* VEX_LEN_38DB_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_38DB_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_38DC_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_38DC_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_38DD_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_38DD_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_38DE_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_38DE_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_38DF_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_38DF_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A06_P_2 */
+  {
+    { "(bad)",         { XX } },
+    { VEX_W_TABLE (VEX_W_3A06_P_2) },
+  },
+
+  /* VEX_LEN_3A0A_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A0A_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A0B_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A0B_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A0E_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A0E_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A0F_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A0F_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A14_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A14_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A15_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A15_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A16_P_2  */
+  {
+    { "vpextrK",       { Edq, XM, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A17_P_2 */
+  {
+    { "vextractps",    { Edqd, XM, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A18_P_2 */
+  {
+    { "(bad)",         { XX } },
+    { VEX_W_TABLE (VEX_W_3A18_P_2) },
+  },
+
+  /* VEX_LEN_3A19_P_2 */
+  {
+    { "(bad)",         { XX } },
+    { VEX_W_TABLE (VEX_W_3A19_P_2) },
+  },
+
+  /* VEX_LEN_3A20_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A20_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A21_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A21_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A22_P_2 */
+  {
+    { "vpinsrK",       { XM, Vex128, Edq, Ib } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A41_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A41_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A42_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A42_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A44_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A44_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A4C_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A4C_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A60_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A60_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A61_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A61_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A62_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A62_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A63_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3A63_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A6A_P_2 */
+  {
+    { "vfmaddss",      { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A6B_P_2 */
+  {
+    { "vfmaddsd",      { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A6E_P_2 */
+  {
+    { "vfmsubss",      { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A6F_P_2 */
+  {
+    { "vfmsubsd",      { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A7A_P_2 */
+  {
+    { "vfnmaddss",     { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A7B_P_2 */
+  {
+    { "vfnmaddsd",     { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A7E_P_2 */
+  {
+    { "vfnmsubss",     { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3A7F_P_2 */
+  {
+    { "vfnmsubsd",     { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_3ADF_P_2 */
+  {
+    { VEX_W_TABLE (VEX_W_3ADF_P_2) },
+    { "(bad)",         { XX } },
+  },
+
+  /* VEX_LEN_XOP_09_80 */
+  {
+    { "vfrczps",       { XM, EXxmm } },
+    { "vfrczps",       { XM, EXymmq } },
+  },
+
+  /* VEX_LEN_XOP_09_81 */
+  {
+    { "vfrczpd",       { XM, EXxmm } },
+    { "vfrczpd",       { XM, EXymmq } },
+  },
+};
+
+static const struct dis386 vex_w_table[][2] = {
+  {
+    /* VEX_W_10_P_0 */
+    { "vmovups",       { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_10_P_1 */
+    { "vmovss",                { XMVex, Vex128, EXd } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_10_P_2 */
+    { "vmovupd",       { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_10_P_3 */
+    { "vmovsd",                { XMVex, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_11_P_0 */
+    { "vmovups",       { EXxS, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_11_P_1 */
+    { "vmovss",                { EXdVexS, Vex128, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_11_P_2 */
+    { "vmovupd",       { EXxS, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_11_P_3 */
+    { "vmovsd",                { EXqVexS, Vex128, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_12_P_0_M_0 */
+    { "vmovlps",       { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_12_P_0_M_1 */
+    { "vmovhlps",      { XM, Vex128, EXq } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_12_P_1 */
+    { "vmovsldup",     { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
   {
+    /* VEX_W_12_P_2 */
     { "vmovlpd",       { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_13_M_0 */
   {
-    { "vmovlpX",       { EXq, XM } },
+    /* VEX_W_12_P_3 */
+    { "vmovddup",      { XM, EXymmq } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_13_M_0 */
+    { "vmovlpX",       { EXq, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_14 */
+    { "vunpcklpX",     { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_15 */
+    { "vunpckhpX",     { XM, Vex, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_16_P_0_M_0 */
   {
+    /* VEX_W_16_P_0_M_0 */
     { "vmovhps",       { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_16_P_0_M_1 */
   {
+    /* VEX_W_16_P_0_M_1 */
     { "vmovlhps",      { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_16_P_2 */
   {
+    /* VEX_W_16_P_1 */
+    { "vmovshdup",     { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_16_P_2 */
     { "vmovhpd",       { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_17_M_0 */
   {
+    /* VEX_W_17_M_0 */
     { "vmovhpX",       { EXq, XM } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2A_P_1 */
   {
-    { "vcvtsi2ss%LQ",  { XM, Vex128, Ev } },
+    /* VEX_W_28 */
+    { "vmovapX",       { XM, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2A_P_3 */
   {
-    { "vcvtsi2sd%LQ",  { XM, Vex128, Ev } },
+    /* VEX_W_29 */
+    { "vmovapX",       { EXxS, XM } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2C_P_1 */
   {
-    { "vcvttss2siY",   { Gv, EXd } },
+    /* VEX_W_2B_M_0 */
+    { "vmovntpX",      { Mx, XM } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2C_P_3 */
   {
-    { "vcvttsd2siY",   { Gv, EXq } },
+    /* VEX_W_2E_P_0 */
+    { "vucomiss",      { XM, EXd } }, 
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2D_P_1 */
   {
-    { "vcvtss2siY",    { Gv, EXd } },
+    /* VEX_W_2E_P_2 */
+    { "vucomisd",      { XM, EXq } }, 
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2D_P_3 */
   {
-    { "vcvtsd2siY",    { Gv, EXq } },
+    /* VEX_W_2F_P_0 */
+    { "vcomiss",       { XM, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2E_P_0 */
   {
-    { "vucomiss",      { XM, EXd } }, 
+    /* VEX_W_2F_P_2 */
+    { "vcomisd",       { XM, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2E_P_2 */
   {
-    { "vucomisd",      { XM, EXq } }, 
+    /* VEX_W_50_M_0 */
+    { "vmovmskpX",     { Gdq, XS } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2F_P_0 */
   {
-    { "vcomiss",       { XM, EXd } },
+    /* VEX_W_51_P_0 */
+    { "vsqrtps",       { XM, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_2F_P_2 */
   {
-    { "vcomisd",       { XM, EXq } },
+    /* VEX_W_51_P_1 */
+    { "vsqrtss",       { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_51_P_1 */
   {
-    { "vsqrtss",       { XM, Vex128, EXd } },
+    /* VEX_W_51_P_2  */
+    { "vsqrtpd",       { XM, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_51_P_3 */
   {
+    /* VEX_W_51_P_3 */
     { "vsqrtsd",       { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_52_P_1 */
   {
+    /* VEX_W_52_P_0 */
+    { "vrsqrtps",      { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_52_P_1 */
     { "vrsqrtss",      { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_53_P_1 */
   {
+    /* VEX_W_53_P_0  */
+    { "vrcpps",                { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_53_P_1  */
     { "vrcpss",                { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_58_P_1 */
   {
+    /* VEX_W_58_P_0  */
+    { "vaddps",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_58_P_1  */
     { "vaddss",                { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_58_P_3 */
   {
+    /* VEX_W_58_P_2  */
+    { "vaddpd",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_58_P_3  */
     { "vaddsd",                { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_59_P_1 */
   {
+    /* VEX_W_59_P_0  */
+    { "vmulps",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_59_P_1  */
     { "vmulss",                { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_59_P_3 */
   {
+    /* VEX_W_59_P_2  */
+    { "vmulpd",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_59_P_3  */
     { "vmulsd",                { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5A_P_1 */
   {
+    /* VEX_W_5A_P_0  */
+    { "vcvtps2pd",     { XM, EXxmmq } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5A_P_1  */
     { "vcvtss2sd",     { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5A_P_3 */
   {
+    /* VEX_W_5A_P_3  */
     { "vcvtsd2ss",     { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5C_P_1 */
   {
+    /* VEX_W_5B_P_0  */
+    { "vcvtdq2ps",     { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5B_P_1  */
+    { "vcvttps2dq",    { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5B_P_2  */
+    { "vcvtps2dq",     { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5C_P_0  */
+    { "vsubps",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5C_P_1  */
     { "vsubss",                { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5C_P_3 */
   {
+    /* VEX_W_5C_P_2  */
+    { "vsubpd",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5C_P_3  */
     { "vsubsd",                { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5D_P_1 */
   {
+    /* VEX_W_5D_P_0  */
+    { "vminps",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5D_P_1  */
     { "vminss",                { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5D_P_3 */
   {
+    /* VEX_W_5D_P_2  */
+    { "vminpd",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5D_P_3  */
     { "vminsd",                { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5E_P_1 */
   {
+    /* VEX_W_5E_P_0  */
+    { "vdivps",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5E_P_1  */
     { "vdivss",                { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5E_P_3 */
   {
+    /* VEX_W_5E_P_2  */
+    { "vdivpd",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5E_P_3  */
     { "vdivsd",                { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5F_P_1 */
   {
+    /* VEX_W_5F_P_0  */
+    { "vmaxps",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5F_P_1  */
     { "vmaxss",                { XM, Vex128, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_5F_P_3 */
   {
+    /* VEX_W_5F_P_2  */
+    { "vmaxpd",                { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_5F_P_3  */
     { "vmaxsd",                { XM, Vex128, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_60_P_2 */
   {
+    /* VEX_W_60_P_2  */
     { "vpunpcklbw",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_61_P_2 */
   {
+    /* VEX_W_61_P_2  */
     { "vpunpcklwd",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_62_P_2 */
   {
+    /* VEX_W_62_P_2  */
     { "vpunpckldq",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_63_P_2 */
   {
+    /* VEX_W_63_P_2  */
     { "vpacksswb",     { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_64_P_2 */
   {
+    /* VEX_W_64_P_2  */
     { "vpcmpgtb",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_65_P_2 */
   {
+    /* VEX_W_65_P_2  */
     { "vpcmpgtw",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_66_P_2 */
   {
+    /* VEX_W_66_P_2  */
     { "vpcmpgtd",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_67_P_2 */
   {
+    /* VEX_W_67_P_2  */
     { "vpackuswb",     { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_68_P_2 */
   {
+    /* VEX_W_68_P_2  */
     { "vpunpckhbw",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_69_P_2 */
   {
+    /* VEX_W_69_P_2  */
     { "vpunpckhwd",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_6A_P_2 */
   {
+    /* VEX_W_6A_P_2  */
     { "vpunpckhdq",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_6B_P_2 */
   {
+    /* VEX_W_6B_P_2  */
     { "vpackssdw",     { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_6C_P_2 */
   {
+    /* VEX_W_6C_P_2  */
     { "vpunpcklqdq",   { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_6D_P_2 */
   {
+    /* VEX_W_6D_P_2  */
     { "vpunpckhqdq",   { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_6E_P_2 */
   {
-    { "vmovK",         { XM, Edq } },
+    /* VEX_W_6F_P_1  */
+    { "vmovdqu",       { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_6F_P_2  */
+    { "vmovdqa",       { XM, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_70_P_1 */
   {
+    /* VEX_W_70_P_1 */
     { "vpshufhw",      { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_70_P_2 */
   {
+    /* VEX_W_70_P_2 */
     { "vpshufd",       { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_70_P_3 */
   {
+    /* VEX_W_70_P_3 */
     { "vpshuflw",      { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_71_R_2_P_2 */
   {
+    /* VEX_W_71_R_2_P_2  */
     { "vpsrlw",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_71_R_4_P_2 */
   {
+    /* VEX_W_71_R_4_P_2  */
     { "vpsraw",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_71_R_6_P_2 */
   {
+    /* VEX_W_71_R_6_P_2  */
     { "vpsllw",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_72_R_2_P_2 */
   {
+    /* VEX_W_72_R_2_P_2  */
     { "vpsrld",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_72_R_4_P_2 */
   {
+    /* VEX_W_72_R_4_P_2  */
     { "vpsrad",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_72_R_6_P_2 */
   {
+    /* VEX_W_72_R_6_P_2  */
     { "vpslld",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_73_R_2_P_2 */
   {
+    /* VEX_W_73_R_2_P_2  */
     { "vpsrlq",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_73_R_3_P_2 */
   {
+    /* VEX_W_73_R_3_P_2  */
     { "vpsrldq",       { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_73_R_6_P_2 */
   {
+    /* VEX_W_73_R_6_P_2  */
     { "vpsllq",                { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_73_R_7_P_2 */
   {
+    /* VEX_W_73_R_7_P_2  */
     { "vpslldq",       { Vex128, XS, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_74_P_2 */
   {
+    /* VEX_W_74_P_2 */
     { "vpcmpeqb",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_75_P_2 */
   {
+    /* VEX_W_75_P_2 */
     { "vpcmpeqw",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_76_P_2 */
   {
+    /* VEX_W_76_P_2 */
     { "vpcmpeqd",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_7E_P_1 */
   {
+    /* VEX_W_77_P_0 */
+    { "",              { VZERO } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_7C_P_2 */
+    { "vhaddpd",       { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_7C_P_3 */
+    { "vhaddps",       { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_7D_P_2 */
+    { "vhsubpd",       { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_7D_P_3 */
+    { "vhsubps",       { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_7E_P_1 */
     { "vmovq",         { XM, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_7E_P_2 */
   {
-    { "vmovK",         { Edq, XM } },
+    /* VEX_W_7F_P_1 */
+    { "vmovdqu",       { EXxS, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_7F_P_2 */
+    { "vmovdqa",       { EXxS, XM } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_AE_R_2_M_0 */
   {
+    /* VEX_W_AE_R_2_M_0 */
     { "vldmxcsr",      { Md } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_AE_R_3_M_0 */
   {
+    /* VEX_W_AE_R_3_M_0 */
     { "vstmxcsr",      { Md } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_C2_P_1 */
   {
+    /* VEX_W_C2_P_0 */
+    { "vcmpps",                { XM, Vex, EXx, VCMP } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_C2_P_1 */
     { "vcmpss",                { XM, Vex128, EXd, VCMP } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_C2_P_3 */
   {
+    /* VEX_W_C2_P_2 */
+    { "vcmppd",                { XM, Vex, EXx, VCMP } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_C2_P_3 */
     { "vcmpsd",                { XM, Vex128, EXq, VCMP } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_C4_P_2 */
   {
-    { "vpinsrw",       { XM, Vex128, Edqw, Ib } },
+    /* VEX_W_C4_P_2 */
+    { "vpinsrw",       { XM, Vex128, Edqw, Ib } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_C5_P_2 */
+    { "vpextrw",       { Gdq, XS, Ib } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_D0_P_2 */
+    { "vaddsubpd",     { XM, Vex, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_C5_P_2 */
   {
-    { "vpextrw",       { Gdq, XS, Ib } },
+    /* VEX_W_D0_P_3 */
+    { "vaddsubps",     { XM, Vex, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_D1_P_2 */
   {
+    /* VEX_W_D1_P_2 */
     { "vpsrlw",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_D2_P_2 */
   {
+    /* VEX_W_D2_P_2 */
     { "vpsrld",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_D3_P_2 */
   {
+    /* VEX_W_D3_P_2 */
     { "vpsrlq",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_D4_P_2 */
   {
+    /* VEX_W_D4_P_2 */
     { "vpaddq",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_D5_P_2 */
   {
+    /* VEX_W_D5_P_2 */
     { "vpmullw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_D6_P_2 */
   {
+    /* VEX_W_D6_P_2 */
     { "vmovq",         { EXqS, XM } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_D7_P_2_M_1 */
   {
+    /* VEX_W_D7_P_2_M_1 */
     { "vpmovmskb",     { Gdq, XS } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_D8_P_2 */
   {
+    /* VEX_W_D8_P_2 */
     { "vpsubusb",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_D9_P_2 */
   {
+    /* VEX_W_D9_P_2 */
     { "vpsubusw",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_DA_P_2 */
   {
+    /* VEX_W_DA_P_2 */
     { "vpminub",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_DB_P_2 */
   {
+    /* VEX_W_DB_P_2 */
     { "vpand",         { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_DC_P_2 */
   {
+    /* VEX_W_DC_P_2 */
     { "vpaddusb",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_DD_P_2 */
   {
+    /* VEX_W_DD_P_2 */
     { "vpaddusw",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_DE_P_2 */
   {
+    /* VEX_W_DE_P_2 */
     { "vpmaxub",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_DF_P_2 */
   {
+    /* VEX_W_DF_P_2 */
     { "vpandn",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_E0_P_2 */
   {
+    /* VEX_W_E0_P_2  */
     { "vpavgb",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_E1_P_2 */
   {
+    /* VEX_W_E1_P_2  */
     { "vpsraw",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_E2_P_2 */
   {
+    /* VEX_W_E2_P_2  */
     { "vpsrad",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_E3_P_2 */
   {
+    /* VEX_W_E3_P_2  */
     { "vpavgw",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_E4_P_2 */
   {
+    /* VEX_W_E4_P_2  */
     { "vpmulhuw",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_E5_P_2 */
   {
+    /* VEX_W_E5_P_2  */
     { "vpmulhw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_E8_P_2 */
   {
+    /* VEX_W_E6_P_1  */
+    { "vcvtdq2pd",     { XM, EXxmmq } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_E6_P_2  */
+    { "vcvttpd2dq%XY", { XMM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_E6_P_3  */
+    { "vcvtpd2dq%XY",  { XMM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_E7_P_2_M_0 */
+    { "vmovntdq",      { Mx, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_E8_P_2  */
     { "vpsubsb",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_E9_P_2 */
   {
+    /* VEX_W_E9_P_2  */
     { "vpsubsw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_EA_P_2 */
   {
+    /* VEX_W_EA_P_2  */
     { "vpminsw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_EB_P_2 */
   {
+    /* VEX_W_EB_P_2  */
     { "vpor",          { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_EC_P_2 */
   {
+    /* VEX_W_EC_P_2  */
     { "vpaddsb",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_ED_P_2 */
   {
+    /* VEX_W_ED_P_2  */
     { "vpaddsw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_EE_P_2 */
   {
+    /* VEX_W_EE_P_2  */
     { "vpmaxsw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_EF_P_2 */
   {
+    /* VEX_W_EF_P_2  */
     { "vpxor",         { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_F1_P_2 */
   {
+    /* VEX_W_F0_P_3_M_0 */
+    { "vlddqu",                { XM, M } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_F1_P_2 */
     { "vpsllw",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_F2_P_2 */
   {
+    /* VEX_W_F2_P_2 */
     { "vpslld",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_F3_P_2 */
   {
+    /* VEX_W_F3_P_2 */
     { "vpsllq",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_F4_P_2 */
   {
+    /* VEX_W_F4_P_2 */
     { "vpmuludq",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_F5_P_2 */
   {
+    /* VEX_W_F5_P_2 */
     { "vpmaddwd",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_F6_P_2 */
   {
+    /* VEX_W_F6_P_2 */
     { "vpsadbw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_F7_P_2 */
   {
+    /* VEX_W_F7_P_2 */
     { "vmaskmovdqu",   { XM, XS } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_F8_P_2 */
   {
+    /* VEX_W_F8_P_2 */
     { "vpsubb",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_F9_P_2 */
   {
+    /* VEX_W_F9_P_2 */
     { "vpsubw",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_FA_P_2 */
   {
+    /* VEX_W_FA_P_2 */
     { "vpsubd",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_FB_P_2 */
   {
+    /* VEX_W_FB_P_2 */
     { "vpsubq",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_FC_P_2 */
   {
+    /* VEX_W_FC_P_2 */
     { "vpaddb",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_FD_P_2 */
   {
+    /* VEX_W_FD_P_2 */
     { "vpaddw",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_FE_P_2 */
   {
+    /* VEX_W_FE_P_2 */
     { "vpaddd",                { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3800_P_2 */
   {
+    /* VEX_W_3800_P_2  */
     { "vpshufb",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3801_P_2 */
   {
+    /* VEX_W_3801_P_2  */
     { "vphaddw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3802_P_2 */
   {
+    /* VEX_W_3802_P_2  */
     { "vphaddd",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3803_P_2 */
   {
+    /* VEX_W_3803_P_2  */
     { "vphaddsw",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3804_P_2 */
   {
+    /* VEX_W_3804_P_2  */
     { "vpmaddubsw",    { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3805_P_2 */
   {
+    /* VEX_W_3805_P_2  */
     { "vphsubw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3806_P_2 */
   {
+    /* VEX_W_3806_P_2  */
     { "vphsubd",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3807_P_2 */
   {
+    /* VEX_W_3807_P_2  */
     { "vphsubsw",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3808_P_2 */
   {
+    /* VEX_W_3808_P_2  */
     { "vpsignb",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3809_P_2 */
   {
+    /* VEX_W_3809_P_2  */
     { "vpsignw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_380A_P_2 */
   {
+    /* VEX_W_380A_P_2  */
     { "vpsignd",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_380B_P_2 */
   {
+    /* VEX_W_380B_P_2  */
     { "vpmulhrsw",     { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3819_P_2_M_0 */
   {
+    /* VEX_W_380C_P_2  */
+    { "vpermilps",     { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_380D_P_2  */
+    { "vpermilpd",     { XM, Vex, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_380E_P_2  */
+    { "vtestps",       { XM, EXx } },
     { "(bad)",         { XX } },
-    { "vbroadcastsd",  { XM, Mq } },
   },
-
-  /* VEX_LEN_381A_P_2_M_0 */
   {
+    /* VEX_W_380F_P_2  */
+    { "vtestpd",       { XM, EXx } },
     { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_3817_P_2 */
+    { "vptest",                { XM, EXx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_3818_P_2_M_0 */
+    { "vbroadcastss",  { XM, Md } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_3819_P_2_M_0 */
+    { "vbroadcastsd",  { XM, Mq } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_381A_P_2_M_0 */
     { "vbroadcastf128",        { XM, Mxmm } },
+    { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_381C_P_2 */
   {
+    /* VEX_W_381C_P_2 */
     { "vpabsb",                { XM, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_381D_P_2 */
   {
+    /* VEX_W_381D_P_2 */
     { "vpabsw",                { XM, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_381E_P_2 */
   {
+    /* VEX_W_381E_P_2 */
     { "vpabsd",                { XM, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3820_P_2 */
   {
+    /* VEX_W_3820_P_2 */
     { "vpmovsxbw",     { XM, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3821_P_2 */
   {
+    /* VEX_W_3821_P_2 */
     { "vpmovsxbd",     { XM, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3822_P_2 */
   {
+    /* VEX_W_3822_P_2 */
     { "vpmovsxbq",     { XM, EXw } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3823_P_2 */
   {
+    /* VEX_W_3823_P_2 */
     { "vpmovsxwd",     { XM, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3824_P_2 */
   {
+    /* VEX_W_3824_P_2 */
     { "vpmovsxwq",     { XM, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3825_P_2 */
   {
+    /* VEX_W_3825_P_2 */
     { "vpmovsxdq",     { XM, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3828_P_2 */
   {
+    /* VEX_W_3828_P_2 */
     { "vpmuldq",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3829_P_2 */
   {
+    /* VEX_W_3829_P_2 */
     { "vpcmpeqq",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_382A_P_2_M_0 */
   {
+    /* VEX_W_382A_P_2_M_0 */
     { "vmovntdqa",     { XM, Mx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_382B_P_2 */
   {
+    /* VEX_W_382B_P_2 */
     { "vpackusdw",     { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3830_P_2 */
   {
+    /* VEX_W_382C_P_2_M_0 */
+    { "vmaskmovps",    { XM, Vex, Mx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_382D_P_2_M_0 */
+    { "vmaskmovpd",    { XM, Vex, Mx } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_382E_P_2_M_0 */
+    { "vmaskmovps",    { Mx, Vex, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_382F_P_2_M_0 */
+    { "vmaskmovpd",    { Mx, Vex, XM } },
+    { "(bad)",         { XX } },
+  },
+  {
+    /* VEX_W_3830_P_2 */
     { "vpmovzxbw",     { XM, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3831_P_2 */
   {
+    /* VEX_W_3831_P_2 */
     { "vpmovzxbd",     { XM, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3832_P_2 */
   {
+    /* VEX_W_3832_P_2 */
     { "vpmovzxbq",     { XM, EXw } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3833_P_2 */
   {
+    /* VEX_W_3833_P_2 */
     { "vpmovzxwd",     { XM, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3834_P_2 */
   {
+    /* VEX_W_3834_P_2 */
     { "vpmovzxwq",     { XM, EXd } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3835_P_2 */
   {
+    /* VEX_W_3835_P_2 */
     { "vpmovzxdq",     { XM, EXq } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3837_P_2 */
   {
+    /* VEX_W_3837_P_2 */
     { "vpcmpgtq",      { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3838_P_2 */
   {
+    /* VEX_W_3838_P_2 */
     { "vpminsb",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3839_P_2 */
   {
+    /* VEX_W_3839_P_2 */
     { "vpminsd",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_383A_P_2 */
   {
+    /* VEX_W_383A_P_2 */
     { "vpminuw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_383B_P_2 */
   {
+    /* VEX_W_383B_P_2 */
     { "vpminud",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_383C_P_2 */
   {
+    /* VEX_W_383C_P_2 */
     { "vpmaxsb",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_383D_P_2 */
   {
+    /* VEX_W_383D_P_2 */
     { "vpmaxsd",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_383E_P_2 */
   {
+    /* VEX_W_383E_P_2 */
     { "vpmaxuw",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_383F_P_2 */
   {
+    /* VEX_W_383F_P_2 */
     { "vpmaxud",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3840_P_2 */
   {
+    /* VEX_W_3840_P_2 */
     { "vpmulld",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3841_P_2 */
   {
+    /* VEX_W_3841_P_2 */
     { "vphminposuw",   { XM, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_38DB_P_2 */
   {
+    /* VEX_W_38DB_P_2 */
     { "vaesimc",       { XM, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_38DC_P_2 */
   {
+    /* VEX_W_38DC_P_2 */
     { "vaesenc",       { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_38DD_P_2 */
   {
+    /* VEX_W_38DD_P_2 */
     { "vaesenclast",   { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_38DE_P_2 */
   {
+    /* VEX_W_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 } },
+    /* VEX_W_38DF_P_2 */
+    { "vaesdeclast",   { XM, Vex128, EXx } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A0B_P_2 */
   {
-    { "vroundsd",      { XM, Vex128, EXq, Ib } },
+    /* VEX_W_3A04_P_2 */
+    { "vpermilps",     { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A0E_P_2 */
   {
-    { "vpblendw",      { XM, Vex128, EXx, Ib } },
+    /* VEX_W_3A05_P_2 */
+    { "vpermilpd",     { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A0F_P_2 */
   {
-    { "vpalignr",      { XM, Vex128, EXx, Ib } },
+    /* VEX_W_3A06_P_2 */
+    { "vperm2f128",    { XM, Vex256, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A14_P_2 */
   {
-    { "vpextrb",       { Edqb, XM, Ib } },
+    /* VEX_W_3A08_P_2 */
+    { "vroundps",      { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A15_P_2 */
   {
-    { "vpextrw",       { Edqw, XM, Ib } },
+    /* VEX_W_3A09_P_2 */
+    { "vroundpd",      { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A16_P_2  */
   {
-    { "vpextrK",       { Edq, XM, Ib } },
+    /* VEX_W_3A0A_P_2 */
+    { "vroundss",      { XM, Vex128, EXd, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A17_P_2 */
   {
-    { "vextractps",    { Edqd, XM, Ib } },
+    /* VEX_W_3A0B_P_2 */
+    { "vroundsd",      { XM, Vex128, EXq, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A18_P_2 */
   {
+    /* VEX_W_3A0C_P_2 */
+    { "vblendps",      { XM, Vex, EXx, Ib } },
     { "(bad)",         { XX } },
-    { "vinsertf128",   { XM, Vex256, EXxmm, Ib } },
   },
-
-  /* VEX_LEN_3A19_P_2 */
   {
+    /* VEX_W_3A0D_P_2 */
+    { "vblendpd",      { XM, Vex, EXx, Ib } },
     { "(bad)",         { XX } },
-    { "vextractf128",  { EXxmm, XM, Ib } },
   },
-
-  /* VEX_LEN_3A20_P_2 */
   {
-    { "vpinsrb",       { XM, Vex128, Edqb, Ib } },
+    /* VEX_W_3A0E_P_2 */
+    { "vpblendw",      { XM, Vex128, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A21_P_2 */
   {
-    { "vinsertps",     { XM, Vex128, EXd, Ib } },
+    /* VEX_W_3A0F_P_2 */
+    { "vpalignr",      { XM, Vex128, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A22_P_2 */
   {
-    { "vpinsrK",       { XM, Vex128, Edq, Ib } },
+    /* VEX_W_3A14_P_2 */
+    { "vpextrb",       { Edqb, XM, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A41_P_2 */
   {
-    { "vdppd",         { XM, Vex128, EXx, Ib } },
+    /* VEX_W_3A15_P_2 */
+    { "vpextrw",       { Edqw, XM, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A42_P_2 */
   {
-    { "vmpsadbw",      { XM, Vex128, EXx, Ib } },
+    /* VEX_W_3A18_P_2 */
+    { "vinsertf128",   { XM, Vex256, EXxmm, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A44_P_2 */
   {
-    { "vpclmulqdq",    { XM, Vex128, EXx, PCLMUL } },
+    /* VEX_W_3A19_P_2 */
+    { "vextractf128",  { EXxmm, XM, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A4C_P_2 */
   {
-    { "vpblendvb",     { XM, Vex128, EXx, XMVexI4 } },
+    /* VEX_W_3A20_P_2 */
+    { "vpinsrb",       { XM, Vex128, Edqb, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A60_P_2 */
   {
-    { "vpcmpestrm",    { XM, EXx, Ib } },
+    /* VEX_W_3A21_P_2 */
+    { "vinsertps",     { XM, Vex128, EXd, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A61_P_2 */
   {
-    { "vpcmpestri",    { XM, EXx, Ib } },
+    /* VEX_W_3A40_P_2 */
+    { "vdpps",         { XM, Vex, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A62_P_2 */
   {
-    { "vpcmpistrm",    { XM, EXx, Ib } },
+    /* VEX_W_3A41_P_2 */
+    { "vdppd",         { XM, Vex128, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A63_P_2 */
   {
-    { "vpcmpistri",    { XM, EXx, Ib } },
+    /* VEX_W_3A42_P_2 */
+    { "vmpsadbw",      { XM, Vex128, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A6A_P_2 */
   {
-    { "vfmaddss",      { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
+    /* VEX_W_3A44_P_2 */
+    { "vpclmulqdq",    { XM, Vex128, EXx, PCLMUL } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A6B_P_2 */
   {
-    { "vfmaddsd",      { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
+    /* VEX_W_3A4A_P_2 */
+    { "vblendvps",     { XM, Vex, EXx, XMVexI4 } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A6E_P_2 */
   {
-    { "vfmsubss",      { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
+    /* VEX_W_3A4B_P_2 */
+    { "vblendvpd",     { XM, Vex, EXx, XMVexI4 } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A6F_P_2 */
   {
-    { "vfmsubsd",      { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
+    /* VEX_W_3A4C_P_2 */
+    { "vpblendvb",     { XM, Vex128, EXx, XMVexI4 } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A7A_P_2 */
   {
-    { "vfnmaddss",     { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
+    /* VEX_W_3A60_P_2 */
+    { "vpcmpestrm",    { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A7B_P_2 */
   {
-    { "vfnmaddsd",     { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
+    /* VEX_W_3A61_P_2 */
+    { "vpcmpestri",    { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A7E_P_2 */
   {
-    { "vfnmsubss",     { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
+    /* VEX_W_3A62_P_2 */
+    { "vpcmpistrm",    { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3A7F_P_2 */
   {
-    { "vfnmsubsd",     { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
+    /* VEX_W_3A63_P_2 */
+    { "vpcmpistri",    { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
-
-  /* VEX_LEN_3ADF_P_2 */
   {
+    /* VEX_W_3ADF_P_2 */
     { "vaeskeygenassist", { XM, EXx, Ib } },
     { "(bad)",         { XX } },
   },
@@ -8612,12 +11107,12 @@ static const struct dis386 mod_table[][2] = {
   },
   {
     /* MOD_0FAE_REG_0 */
-    { "fxsave",                { M } },
+    { "fxsave",                { FXSAVE } },
     { "(bad)",         { XX } },
   },
   {
     /* MOD_0FAE_REG_1 */
-    { "fxrstor",       { M } },
+    { "fxrstor",       { FXSAVE } },
     { "(bad)",         { XX } },
   },
   {
@@ -8732,13 +11227,13 @@ static const struct dis386 mod_table[][2] = {
   },
   {
     /* MOD_VEX_2B */
-    { "vmovntpX",      { Mx, XM } },
+    { VEX_W_TABLE (VEX_W_2B_M_0) },
     { "(bad)",         { XX } },
   },
   {
-    /* MOD_VEX_51 */
+    /* MOD_VEX_50 */
     { "(bad)",         { XX } },
-    { "vmovmskpX",     { Gdq, XS } },
+    { VEX_W_TABLE (VEX_W_50_M_0) },
   },
   {
     /* MOD_VEX_71_REG_2 */
@@ -8807,17 +11302,17 @@ static const struct dis386 mod_table[][2] = {
   },
   {
     /* MOD_VEX_E7_PREFIX_2 */
-    { "vmovntdq",      { Mx, XM } },
+    { VEX_W_TABLE (VEX_W_E7_P_2_M_0) },
     { "(bad)",         { XX } },
   },
   {
     /* MOD_VEX_F0_PREFIX_3 */
-    { "vlddqu",                { XM, M } },
+    { VEX_W_TABLE (VEX_W_F0_P_3_M_0) },
     { "(bad)",         { XX } },
   },
   {
     /* MOD_VEX_3818_PREFIX_2 */
-    { "vbroadcastss",  { XM, Md } },
+    { VEX_W_TABLE (VEX_W_3818_P_2_M_0) },
     { "(bad)",         { XX } },
   },
   {
@@ -8837,22 +11332,22 @@ static const struct dis386 mod_table[][2] = {
   },
   {
     /* MOD_VEX_382C_PREFIX_2 */
-    { "vmaskmovps",    { XM, Vex, Mx } },
+    { VEX_W_TABLE (VEX_W_382C_P_2_M_0) },
     { "(bad)",         { XX } },
   },
   {
     /* MOD_VEX_382D_PREFIX_2 */
-    { "vmaskmovpd",    { XM, Vex, Mx } },
+    { VEX_W_TABLE (VEX_W_382D_P_2_M_0) },
     { "(bad)",         { XX } },
   },
   {
     /* MOD_VEX_382E_PREFIX_2 */
-    { "vmaskmovps",    { Mx, Vex, XM } },
+    { VEX_W_TABLE (VEX_W_382E_P_2_M_0) },
     { "(bad)",         { XX } },
   },
   {
     /* MOD_VEX_382F_PREFIX_2 */
-    { "vmaskmovpd",    { Mx, Vex, XM } },
+    { VEX_W_TABLE (VEX_W_382F_P_2_M_0) },
     { "(bad)",         { XX } },
   },
 };
@@ -8950,17 +11445,36 @@ static const struct dis386 rm_table[][8] = {
 
 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
 
-static void
+/* We use the high bit to indicate different name for the same
+   prefix.  */
+#define ADDR16_PREFIX  (0x67 | 0x100)
+#define ADDR32_PREFIX  (0x67 | 0x200)
+#define DATA16_PREFIX  (0x66 | 0x100)
+#define DATA32_PREFIX  (0x66 | 0x200)
+#define REP_PREFIX     (0xf3 | 0x100)
+
+static int
 ckprefix (void)
 {
-  int newrex;
+  int newrex, i, length;
   rex = 0;
-  rex_original = 0;
   rex_ignored = 0;
   prefixes = 0;
   used_prefixes = 0;
   rex_used = 0;
-  while (1)
+  last_lock_prefix = -1;
+  last_repz_prefix = -1;
+  last_repnz_prefix = -1;
+  last_data_prefix = -1;
+  last_addr_prefix = -1;
+  last_rex_prefix = -1;
+  last_seg_prefix = -1;
+  for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
+    all_prefixes[i] = 0;
+  i = 0;
+  length = 0;
+  /* The maximum instruction length is 15bytes.  */
+  while (length < MAX_CODE_LENGTH - 1)
     {
       FETCH_DATA (the_info, codep + 1);
       newrex = 0;
@@ -8983,43 +11497,55 @@ ckprefix (void)
        case 0x4d:
        case 0x4e:
        case 0x4f:
-           if (address_mode == mode_64bit)
-             newrex = *codep;
-           else
-             return;
+         if (address_mode == mode_64bit)
+           newrex = *codep;
+         else
+           return 1;
+         last_rex_prefix = i;
          break;
        case 0xf3:
          prefixes |= PREFIX_REPZ;
+         last_repz_prefix = i;
          break;
        case 0xf2:
          prefixes |= PREFIX_REPNZ;
+         last_repnz_prefix = i;
          break;
        case 0xf0:
          prefixes |= PREFIX_LOCK;
+         last_lock_prefix = i;
          break;
        case 0x2e:
          prefixes |= PREFIX_CS;
+         last_seg_prefix = i;
          break;
        case 0x36:
          prefixes |= PREFIX_SS;
+         last_seg_prefix = i;
          break;
        case 0x3e:
          prefixes |= PREFIX_DS;
+         last_seg_prefix = i;
          break;
        case 0x26:
          prefixes |= PREFIX_ES;
+         last_seg_prefix = i;
          break;
        case 0x64:
          prefixes |= PREFIX_FS;
+         last_seg_prefix = i;
          break;
        case 0x65:
          prefixes |= PREFIX_GS;
+         last_seg_prefix = i;
          break;
        case 0x66:
          prefixes |= PREFIX_DATA;
+         last_data_prefix = i;
          break;
        case 0x67:
          prefixes |= PREFIX_ADDR;
+         last_addr_prefix = i;
          break;
        case FWAIT_OPCODE:
          /* fwait is really an instruction.  If there are prefixes
@@ -9029,22 +11555,47 @@ ckprefix (void)
            {
              prefixes |= PREFIX_FWAIT;
              codep++;
-             return;
+             return 1;
            }
          prefixes = PREFIX_FWAIT;
          break;
        default:
-         return;
+         return 1;
        }
       /* Rex is ignored when followed by another prefix.  */
       if (rex)
        {
          rex_used = rex;
-         return;
+         return 1;
        }
+      if (*codep != FWAIT_OPCODE)
+       all_prefixes[i++] = *codep;
       rex = newrex;
-      rex_original = rex;
       codep++;
+      length++;
+    }
+  return 0;
+}
+
+static int
+seg_prefix (int pref)
+{
+  switch (pref)
+    {
+    case 0x2e:
+      return PREFIX_CS;
+    case 0x36:
+      return PREFIX_SS;
+    case 0x3e:
+      return PREFIX_DS;
+    case 0x26:
+      return PREFIX_ES;
+    case 0x64:
+      return PREFIX_FS;
+    case 0x65:
+      return PREFIX_GS;
+    default:
+      return 0;
     }
 }
 
@@ -9121,6 +11672,16 @@ prefix_name (int pref, int sizeflag)
        return (sizeflag & AFLAG) ? "addr16" : "addr32";
     case FWAIT_OPCODE:
       return "fwait";
+    case ADDR16_PREFIX:
+      return "addr16";
+    case ADDR32_PREFIX:
+      return "addr32";
+    case DATA16_PREFIX:
+      return "data16";
+    case DATA32_PREFIX:
+      return "data32";
+    case REP_PREFIX:
+      return "rep";
     default:
       return NULL;
     }
@@ -9205,7 +11766,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, vex_table_index;
+  int vindex, vex_table_index;
 
   if (dp->name != NULL)
     return dp;
@@ -9217,8 +11778,8 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       break;
 
     case USE_MOD_TABLE:
-      index = modrm.mod == 0x3 ? 1 : 0;
-      dp = &mod_table[dp->op[1].bytemode][index];
+      vindex = modrm.mod == 0x3 ? 1 : 0;
+      dp = &mod_table[dp->op[1].bytemode][vindex];
       break;
 
     case USE_RM_TABLE:
@@ -9232,16 +11793,16 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
          switch (vex.prefix)
            {
            case 0:
-             index = 0;
+             vindex = 0;
              break;
            case REPE_PREFIX_OPCODE:
-             index = 1;
+             vindex = 1;
              break;
            case DATA_PREFIX_OPCODE:
-             index = 2;
+             vindex = 2;
              break;
            case REPNE_PREFIX_OPCODE:
-             index = 3;
+             vindex = 3;
              break;
            default:
              abort ();
@@ -9250,12 +11811,12 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
        }
       else 
        {
-         index = 0;
+         vindex = 0;
          used_prefixes |= (prefixes & PREFIX_REPZ);
          if (prefixes & PREFIX_REPZ)
            {
-             index = 1;
-             repz_prefix = NULL;
+             vindex = 1;
+             all_prefixes[last_repz_prefix] = 0;
            }
          else
            {
@@ -9264,32 +11825,32 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
              used_prefixes |= (prefixes & PREFIX_REPNZ);
              if (prefixes & PREFIX_REPNZ)
                {
-                 index = 3;
-                 repnz_prefix = NULL;
+                 vindex = 3;
+                 all_prefixes[last_repnz_prefix] = 0;
                }
              else
                {
                  used_prefixes |= (prefixes & PREFIX_DATA);
                  if (prefixes & PREFIX_DATA)
                    {
-                     index = 2;
-                     data_prefix = NULL;
+                     vindex = 2;
+                     all_prefixes[last_data_prefix] = 0;
                    }
                }
            }
        }
-      dp = &prefix_table[dp->op[1].bytemode][index];
+      dp = &prefix_table[dp->op[1].bytemode][vindex];
       break;
 
     case USE_X86_64_TABLE:
-      index = address_mode == mode_64bit ? 1 : 0;
-      dp = &x86_64_table[dp->op[1].bytemode][index];
+      vindex = address_mode == mode_64bit ? 1 : 0;
+      dp = &x86_64_table[dp->op[1].bytemode][vindex];
       break;
 
     case USE_3BYTE_TABLE:
       FETCH_DATA (info, codep + 2);
-      index = *codep++;
-      dp = &three_byte_table[dp->op[1].bytemode][index];
+      vindex = *codep++;
+      dp = &three_byte_table[dp->op[1].bytemode][vindex];
       modrm.mod = (*codep >> 6) & 3;
       modrm.reg = (*codep >> 3) & 7;
       modrm.rm = *codep & 7;
@@ -9302,17 +11863,76 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       switch (vex.length)
        {
        case 128:
-         index = 0;
+         vindex = 0;
          break;
        case 256:
-         index = 1;
+         vindex = 1;
          break;
        default:
          abort ();
          break;
        }
 
-      dp = &vex_len_table[dp->op[1].bytemode][index];
+      dp = &vex_len_table[dp->op[1].bytemode][vindex];
+      break;
+
+    case USE_XOP_8F_TABLE:
+      FETCH_DATA (info, codep + 3);
+      /* All bits in the REX prefix are ignored.  */
+      rex_ignored = rex;
+      rex = ~(*codep >> 5) & 0x7;
+
+      /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm".  */
+      switch ((*codep & 0x1f))
+       {
+       default:
+         BadOp ();
+       case 0x8:
+         vex_table_index = XOP_08;
+         break;
+       case 0x9:
+         vex_table_index = XOP_09;
+         break;
+       case 0xa:
+         vex_table_index = XOP_0A;
+         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++;
+      vindex = *codep++;
+      dp = &xop_table[vex_table_index][vindex];
+
+      FETCH_DATA (info, codep + 1);
+      modrm.mod = (*codep >> 6) & 3;
+      modrm.reg = (*codep >> 3) & 7;
+      modrm.rm = *codep & 7;
       break;
 
     case USE_VEX_C4_TABLE:
@@ -9325,13 +11945,13 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
        default:
          BadOp ();
        case 0x1:
-         vex_table_index = 0;
+         vex_table_index = VEX_0F;
          break;
        case 0x2:
-         vex_table_index = 1;
+         vex_table_index = VEX_0F38;
          break;
        case 0x3:
-         vex_table_index = 2;
+         vex_table_index = VEX_0F3A;
          break;
        }
       codep++;
@@ -9363,10 +11983,10 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       need_vex = 1;
       need_vex_reg = 1;
       codep++;
-      index = *codep++;
-      dp = &vex_table[vex_table_index][index];
+      vindex = *codep++;
+      dp = &vex_table[vex_table_index][vindex];
       /* There is no MODRM byte for VEX [82|77].  */
-      if (index != 0x77 && index != 0x82)
+      if (vindex != 0x77 && vindex != 0x82)
        {
          FETCH_DATA (info, codep + 1);
          modrm.mod = (*codep >> 6) & 3;
@@ -9386,6 +12006,8 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
          && vex.register_specifier > 0x7)
        BadOp ();
 
+      vex.w = 0;
+
       vex.length = (*codep & 0x4) ? 256 : 128;
       switch ((*codep & 0x3))
        {
@@ -9405,10 +12027,10 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       need_vex = 1;
       need_vex_reg = 1;
       codep++;
-      index = *codep++;
-      dp = &vex_table[dp->op[1].bytemode][index];
+      vindex = *codep++;
+      dp = &vex_table[dp->op[1].bytemode][vindex];
       /* There is no MODRM byte for VEX [82|77].  */
-      if (index != 0x77 && index != 0x82)
+      if (vindex != 0x77 && vindex != 0x82)
        {
          FETCH_DATA (info, codep + 1);
          modrm.mod = (*codep >> 6) & 3;
@@ -9417,6 +12039,13 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
        }
       break;
 
+    case USE_VEX_W_TABLE:
+      if (!need_vex)
+       abort ();
+
+      dp = &vex_w_table[dp->op[1].bytemode][vex.w ? 1 : 0];
+      break;
+
     default:
       abort ();
     }
@@ -9438,8 +12067,8 @@ print_insn (bfd_vma pc, disassemble_info *info)
   const char *p;
   struct dis_private priv;
   unsigned char op;
-  char prefix_obuf[32];
-  char *prefix_obufp;
+  int prefix_length;
+  int default_prefixes;
 
   if (info->mach == bfd_mach_x86_64_intel_syntax
       || info->mach == bfd_mach_x86_64
@@ -9535,6 +12164,9 @@ print_insn (bfd_vma pc, disassemble_info *info)
       names8 = intel_names8;
       names8rex = intel_names8rex;
       names_seg = intel_names_seg;
+      names_mm = intel_names_mm;
+      names_xmm = intel_names_xmm;
+      names_ymm = intel_names_ymm;
       index64 = intel_index64;
       index32 = intel_index32;
       index16 = intel_index16;
@@ -9551,6 +12183,9 @@ print_insn (bfd_vma pc, disassemble_info *info)
       names8 = att_names8;
       names8rex = att_names8rex;
       names_seg = att_names_seg;
+      names_mm = att_names_mm;
+      names_xmm = att_names_xmm;
+      names_ymm = att_names_ymm;
       index64 = att_index64;
       index32 = att_index32;
       index16 = att_index16;
@@ -9611,26 +12246,28 @@ print_insn (bfd_vma pc, disassemble_info *info)
     }
 
   obufp = obuf;
-  ckprefix ();
+  sizeflag = priv.orig_sizeflag;
+
+  if (!ckprefix () || rex_used)
+    {
+      /* Too many prefixes or unused REX prefixes.  */
+      for (i = 0;
+          all_prefixes[i] && i < (int) ARRAY_SIZE (all_prefixes);
+          i++)
+       (*info->fprintf_func) (info->stream, "%s",
+                              prefix_name (all_prefixes[i], sizeflag));
+      return 1;
+    }
 
   insn_codep = codep;
-  sizeflag = priv.orig_sizeflag;
 
   FETCH_DATA (info, codep + 1);
   two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
 
   if (((prefixes & PREFIX_FWAIT)
-       && ((*codep < 0xd8) || (*codep > 0xdf)))
-      || (rex && rex_used))
+       && ((*codep < 0xd8) || (*codep > 0xdf))))
     {
-      const char *name;
-
-      /* fwait not followed by floating point instruction, or rex followed
-        by other prefixes.  Print the first prefix.  */
-      name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
-      if (name == NULL)
-       name = INTERNAL_DISASSEMBLER_ERROR;
-      (*info->fprintf_func) (info->stream, "%s", name);
+      (*info->fprintf_func) (info->stream, "fwait");
       return 1;
     }
 
@@ -9653,44 +12290,26 @@ print_insn (bfd_vma pc, disassemble_info *info)
     }
 
   if ((prefixes & PREFIX_REPZ))
-    {
-      repz_prefix = "repz ";
-      used_prefixes |= PREFIX_REPZ;
-    }
-  else
-    repz_prefix = NULL;
-
+    used_prefixes |= PREFIX_REPZ;
   if ((prefixes & PREFIX_REPNZ))
-    {
-      repnz_prefix = "repnz ";
-      used_prefixes |= PREFIX_REPNZ;
-    }
-  else
-    repnz_prefix = NULL;
-
+    used_prefixes |= PREFIX_REPNZ;
   if ((prefixes & PREFIX_LOCK))
-    {
-      lock_prefix = "lock ";
-      used_prefixes |= PREFIX_LOCK;
-    }
-  else
-    lock_prefix = NULL;
+    used_prefixes |= PREFIX_LOCK;
 
-  addr_prefix = NULL;
+  default_prefixes = 0;
   if (prefixes & PREFIX_ADDR)
     {
       sizeflag ^= AFLAG;
       if (dp->op[2].bytemode != loop_jcxz_mode || intel_syntax)
        {
          if ((sizeflag & AFLAG) || address_mode == mode_64bit)
-           addr_prefix = "addr32 ";
+           all_prefixes[last_addr_prefix] = ADDR32_PREFIX;
          else
-           addr_prefix = "addr16 ";
-         used_prefixes |= PREFIX_ADDR;
+           all_prefixes[last_addr_prefix] = ADDR16_PREFIX;
+         default_prefixes |= PREFIX_ADDR;
        }
     }
 
-  data_prefix = NULL;
   if ((prefixes & PREFIX_DATA))
     {
       sizeflag ^= DFLAG;
@@ -9699,10 +12318,15 @@ print_insn (bfd_vma pc, disassemble_info *info)
          && !intel_syntax)
        {
          if (sizeflag & DFLAG)
-           data_prefix = "data32 ";
+           all_prefixes[last_data_prefix] = DATA32_PREFIX;
          else
-           data_prefix = "data16 ";
-         used_prefixes |= PREFIX_DATA;
+           all_prefixes[last_data_prefix] = DATA16_PREFIX;
+         default_prefixes |= PREFIX_DATA;
+       }
+      else if (rex & REX_W)
+       {
+         /* REX_W will override PREFIX_DATA.  */
+         default_prefixes |= PREFIX_DATA;
        }
     }
 
@@ -9741,43 +12365,62 @@ print_insn (bfd_vma pc, disassemble_info *info)
      separately.  If we don't do this, we'll wind up printing an
      instruction stream which does not precisely correspond to the
      bytes we are disassembling.  */
-  if ((prefixes & ~used_prefixes) != 0)
+  if ((prefixes & ~(used_prefixes | default_prefixes)) != 0)
     {
-      const char *name;
-
-      name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
-      if (name == NULL)
-       name = INTERNAL_DISASSEMBLER_ERROR;
-      (*info->fprintf_func) (info->stream, "%s", name);
-      return 1;
+      for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
+       if (all_prefixes[i])
+         {
+           const char *name;
+           name = prefix_name (all_prefixes[i], priv.orig_sizeflag);
+           if (name == NULL)
+             name = INTERNAL_DISASSEMBLER_ERROR;
+           (*info->fprintf_func) (info->stream, "%s", name);
+           return 1;
+         }
     }
-  if ((rex_original & ~rex_used) || rex_ignored)
+
+  /* Check if the REX prefix is used.  */
+  if (rex_ignored == 0 && (rex ^ rex_used) == 0)
+    all_prefixes[last_rex_prefix] = 0;
+
+  /* Check if the SEG prefix is used.  */
+  if ((prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES
+                  | PREFIX_FS | PREFIX_GS)) != 0
+      && (used_prefixes
+         & seg_prefix (all_prefixes[last_seg_prefix])) != 0)
+    all_prefixes[last_seg_prefix] = 0;
+
+  /* Check if the ADDR prefix is used.  */
+  if ((prefixes & PREFIX_ADDR) != 0
+      && (used_prefixes & PREFIX_ADDR) != 0)
+    all_prefixes[last_addr_prefix] = 0;
+
+  /* Check if the DATA prefix is used.  */
+  if ((prefixes & PREFIX_DATA) != 0
+      && (used_prefixes & PREFIX_DATA) != 0)
+    all_prefixes[last_data_prefix] = 0;
+
+  prefix_length = 0;
+  for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
+    if (all_prefixes[i])
+      {
+       const char *name;
+       name = prefix_name (all_prefixes[i], sizeflag);
+       if (name == NULL)
+         abort ();
+       prefix_length += strlen (name) + 1;
+       (*info->fprintf_func) (info->stream, "%s ", name);
+      }
+
+  /* Check maximum code length.  */
+  if ((codep - start_codep) > MAX_CODE_LENGTH)
     {
-      const char *name;
-      name = prefix_name (rex_original, priv.orig_sizeflag);
-      if (name == NULL)
-       name = INTERNAL_DISASSEMBLER_ERROR;
-      (*info->fprintf_func) (info->stream, "%s ", name);
+      (*info->fprintf_func) (info->stream, "(bad)");
+      return MAX_CODE_LENGTH;
     }
 
-  prefix_obuf[0] = 0;
-  prefix_obufp = prefix_obuf;
-  if (lock_prefix)
-    prefix_obufp = stpcpy (prefix_obufp, lock_prefix);
-  if (repz_prefix)
-    prefix_obufp = stpcpy (prefix_obufp, repz_prefix);
-  if (repnz_prefix)
-    prefix_obufp = stpcpy (prefix_obufp, repnz_prefix);
-  if (addr_prefix)
-    prefix_obufp = stpcpy (prefix_obufp, addr_prefix);
-  if (data_prefix)
-    prefix_obufp = stpcpy (prefix_obufp, data_prefix);
-
-  if (prefix_obuf[0] != 0)
-    (*info->fprintf_func) (info->stream, "%s", prefix_obuf);
-
   obufp = mnemonicendp;
-  for (i = strlen (obuf) + strlen (prefix_obuf); i < 6; i++)
+  for (i = strlen (obuf) + prefix_length; i < 6; i++)
     oappend (" ");
   oappend (" ");
   (*info->fprintf_func) (info->stream, "%s", obuf);
@@ -10316,11 +12959,14 @@ case_B:
            {
              if (rex & REX_W)
                *obufp++ = 'q';
-             else if (sizeflag & DFLAG)
-               *obufp++ = intel_syntax ? 'd' : 'l';
              else
-               *obufp++ = 'w';
-             used_prefixes |= (prefixes & PREFIX_DATA);
+               {
+                 if (sizeflag & DFLAG)
+                   *obufp++ = intel_syntax ? 'd' : 'l';
+                 else
+                   *obufp++ = 'w';
+                 used_prefixes |= (prefixes & PREFIX_DATA);
+               }
            }
          else
            *obufp++ = 'w';
@@ -10455,8 +13101,8 @@ case_L:
                      *obufp++ = 'l';
                   else
                     *obufp++ = 'w';
+                  used_prefixes |= (prefixes & PREFIX_DATA);
                }
-             used_prefixes |= (prefixes & PREFIX_DATA);
            }
          break;
        case 'U':
@@ -10487,8 +13133,8 @@ case_Q:
                        *obufp++ = intel_syntax ? 'd' : 'l';
                      else
                        *obufp++ = 'w';
+                     used_prefixes |= (prefixes & PREFIX_DATA);
                    }
-                 used_prefixes |= (prefixes & PREFIX_DATA);
                }
            }
          else
@@ -10609,16 +13255,19 @@ case_S:
            }
          if (need_vex && vex.prefix)
            {
-             if (vex.prefix == DATA_PREFIX_OPCODE)
+             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);
            }
-         else if (prefixes & PREFIX_DATA)
-           *obufp++ = 'd';
-         else
-           *obufp++ = 's';
-         used_prefixes |= (prefixes & PREFIX_DATA);
          break;
        case 'Y':
          if (l == 0 && len == 1)
@@ -10864,7 +13513,6 @@ intel_operand_size (int bytemode, int sizeflag)
       if (address_mode == mode_64bit && (sizeflag & DFLAG))
        {
          oappend ("QWORD PTR ");
-         used_prefixes |= (prefixes & PREFIX_DATA);
          break;
        }
       /* FALLTHRU */
@@ -10874,11 +13522,14 @@ intel_operand_size (int bytemode, int sizeflag)
       USED_REX (REX_W);
       if (rex & REX_W)
        oappend ("QWORD PTR ");
-      else if ((sizeflag & DFLAG) || bytemode == dq_mode)
-       oappend ("DWORD PTR ");
       else
-       oappend ("WORD PTR ");
-      used_prefixes |= (prefixes & PREFIX_DATA);
+       {
+         if ((sizeflag & DFLAG) || bytemode == dq_mode)
+           oappend ("DWORD PTR ");
+         else
+           oappend ("WORD PTR ");
+         used_prefixes |= (prefixes & PREFIX_DATA);
+       }
       break;
     case z_mode:
       if ((rex & REX_W) || (sizeflag & DFLAG))
@@ -11030,7 +13681,6 @@ OP_E_register (int bytemode, int sizeflag)
       if (address_mode == mode_64bit && (sizeflag & DFLAG))
        {
          names = names64;
-         used_prefixes |= (prefixes & PREFIX_DATA);
          break;
        }
       bytemode = v_mode;
@@ -11044,13 +13694,16 @@ OP_E_register (int bytemode, int sizeflag)
       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);
+       {
+         if ((sizeflag & DFLAG) 
+             || (bytemode != v_mode
+                 && bytemode != v_swap_mode))
+           names = names32;
+         else
+           names = names16;
+         used_prefixes |= (prefixes & PREFIX_DATA);
+       }
       break;
     case 0:
       return;
@@ -11082,7 +13735,7 @@ OP_E_memory (int bytemode, int sizeflag)
       int haveindex;
       int needindex;
       int base, rbase;
-      int index = 0;
+      int vindex = 0;
       int scale = 0;
 
       havesib = 0;
@@ -11094,13 +13747,13 @@ OP_E_memory (int bytemode, int sizeflag)
        {
          havesib = 1;
          FETCH_DATA (the_info, codep + 1);
-         index = (*codep >> 3) & 7;
+         vindex = (*codep >> 3) & 7;
          scale = (*codep >> 6) & 3;
          base = *codep & 7;
          USED_REX (REX_X);
          if (rex & REX_X)
-           index += 8;
-         haveindex = index != 4;
+           vindex += 8;
+         haveindex = vindex != 4;
          codep++;
        }
       rbase = base + add;
@@ -11184,7 +13837,7 @@ OP_E_memory (int bytemode, int sizeflag)
                  if (haveindex)
                    oappend (address_mode == mode_64bit 
                             && (sizeflag & AFLAG)
-                            ? names64[index] : names32[index]);
+                            ? names64[vindex] : names32[vindex]);
                  else
                    oappend (address_mode == mode_64bit 
                             && (sizeflag & AFLAG)
@@ -11239,7 +13892,9 @@ OP_E_memory (int bytemode, int sizeflag)
        }
     }
   else
-    { /* 16 bit address mode */
+    {
+      /* 16 bit address mode */
+      used_prefixes |= prefixes & PREFIX_ADDR;
       switch (modrm.mod)
        {
        case 0:
@@ -11314,7 +13969,7 @@ OP_E_memory (int bytemode, int sizeflag)
 }
 
 static void
-OP_E_extended (int bytemode, int sizeflag)
+OP_E (int bytemode, int sizeflag)
 {
   /* Skip mod/rm byte.  */
   MODRM_CHECK;
@@ -11326,13 +13981,6 @@ OP_E_extended (int bytemode, int sizeflag)
     OP_E_memory (bytemode, sizeflag);
 }
 
-static void
-OP_E (int bytemode, int sizeflag)
-{
-  OP_E_extended (bytemode, sizeflag);
-}
-
-
 static void
 OP_G (int bytemode, int sizeflag)
 {
@@ -11366,11 +14014,14 @@ OP_G (int bytemode, int sizeflag)
       USED_REX (REX_W);
       if (rex & REX_W)
        oappend (names64[modrm.reg + add]);
-      else if ((sizeflag & DFLAG) || bytemode != v_mode)
-       oappend (names32[modrm.reg + add]);
       else
-       oappend (names16[modrm.reg + add]);
-      used_prefixes |= (prefixes & PREFIX_DATA);
+       {
+         if ((sizeflag & DFLAG) || bytemode != v_mode)
+           oappend (names32[modrm.reg + add]);
+         else
+           oappend (names16[modrm.reg + add]);
+         used_prefixes |= (prefixes & PREFIX_DATA);
+       }
       break;
     case m_mode:
       if (address_mode == mode_64bit)
@@ -11509,11 +14160,14 @@ OP_REG (int code, int sizeflag)
       USED_REX (REX_W);
       if (rex & REX_W)
        s = names64[code - eAX_reg + add];
-      else if (sizeflag & DFLAG)
-       s = names32[code - eAX_reg + add];
       else
-       s = names16[code - eAX_reg + add];
-      used_prefixes |= (prefixes & PREFIX_DATA);
+       {
+         if (sizeflag & DFLAG)
+           s = names32[code - eAX_reg + add];
+         else
+           s = names16[code - eAX_reg + add];
+         used_prefixes |= (prefixes & PREFIX_DATA);
+       }
       break;
     default:
       s = INTERNAL_DISASSEMBLER_ERROR;
@@ -11556,11 +14210,14 @@ OP_IMREG (int code, int sizeflag)
       USED_REX (REX_W);
       if (rex & REX_W)
        s = names64[code - eAX_reg];
-      else if (sizeflag & DFLAG)
-       s = names32[code - eAX_reg];
       else
-       s = names16[code - eAX_reg];
-      used_prefixes |= (prefixes & PREFIX_DATA);
+       {
+         if (sizeflag & DFLAG)
+           s = names32[code - eAX_reg];
+         else
+           s = names16[code - eAX_reg];
+         used_prefixes |= (prefixes & PREFIX_DATA);
+       }
       break;
     case z_mode_ax_reg:
       if ((rex & REX_W) || (sizeflag & DFLAG))
@@ -11601,17 +14258,20 @@ OP_I (int bytemode, int sizeflag)
       USED_REX (REX_W);
       if (rex & REX_W)
        op = get32s ();
-      else if (sizeflag & DFLAG)
-       {
-         op = get32 ();
-         mask = 0xffffffff;
-       }
       else
        {
-         op = get16 ();
-         mask = 0xfffff;
+         if (sizeflag & DFLAG)
+           {
+             op = get32 ();
+             mask = 0xffffffff;
+           }
+         else
+           {
+             op = get16 ();
+             mask = 0xfffff;
+           }
+         used_prefixes |= (prefixes & PREFIX_DATA);
        }
-      used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     case w_mode:
       mask = 0xfffff;
@@ -11656,17 +14316,20 @@ OP_I64 (int bytemode, int sizeflag)
       USED_REX (REX_W);
       if (rex & REX_W)
        op = get64 ();
-      else if (sizeflag & DFLAG)
-       {
-         op = get32 ();
-         mask = 0xffffffff;
-       }
       else
        {
-         op = get16 ();
-         mask = 0xfffff;
+         if (sizeflag & DFLAG)
+           {
+             op = get32 ();
+             mask = 0xffffffff;
+           }
+         else
+           {
+             op = get16 ();
+             mask = 0xfffff;
+           }
+         used_prefixes |= (prefixes & PREFIX_DATA);
        }
-      used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     case w_mode:
       mask = 0xfffff;
@@ -11703,19 +14366,22 @@ OP_sI (int bytemode, int sizeflag)
       USED_REX (REX_W);
       if (rex & REX_W)
        op = get32s ();
-      else if (sizeflag & DFLAG)
-       {
-         op = get32s ();
-         mask = 0xffffffff;
-       }
       else
        {
-         mask = 0xffffffff;
-         op = get16 ();
-         if ((op & 0x8000) != 0)
-           op -= 0x10000;
+         if (sizeflag & DFLAG)
+           {
+             op = get32s ();
+             mask = 0xffffffff;
+           }
+         else
+           {
+             mask = 0xffffffff;
+             op = get16 ();
+             if ((op & 0x8000) != 0)
+               op -= 0x10000;
+           }
+         used_prefixes |= (prefixes & PREFIX_DATA);
        }
-      used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     case w_mode:
       op = get16 ();
@@ -11749,6 +14415,7 @@ OP_J (int bytemode, int sizeflag)
        disp -= 0x100;
       break;
     case v_mode:
+      USED_REX (REX_W);
       if ((sizeflag & DFLAG) || (rex & REX_W))
        disp = get32s ();
       else
@@ -11765,7 +14432,8 @@ OP_J (int bytemode, int sizeflag)
            segment = ((start_pc + codep - start_codep)
                       & ~((bfd_vma) 0xffff));
        }
-      used_prefixes |= (prefixes & PREFIX_DATA);
+      if (!(rex & REX_W))
+       used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     default:
       oappend (INTERNAL_DISASSEMBLER_ERROR);
@@ -11956,7 +14624,7 @@ OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
     }
   else if (address_mode != mode_64bit && (prefixes & PREFIX_LOCK))
     {
-      lock_prefix = NULL;
+      all_prefixes[last_lock_prefix] = 0;
       used_prefixes |= PREFIX_LOCK;
       add = 8;
     }
@@ -12001,53 +14669,56 @@ OP_R (int bytemode, int sizeflag)
 static void
 OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 {
+  int reg = modrm.reg;
+  const char **names;
+
   used_prefixes |= (prefixes & PREFIX_DATA);
   if (prefixes & PREFIX_DATA)
     {
-      int add;
+      names = names_xmm;
       USED_REX (REX_R);
       if (rex & REX_R)
-       add = 8;
-      else
-       add = 0;
-      sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
+       reg += 8;
     }
   else
-    sprintf (scratchbuf, "%%mm%d", modrm.reg);
-  oappend (scratchbuf + intel_syntax);
+    names = names_mm;
+  oappend (names[reg]);
 }
 
 static void
 OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
 {
-  int add;
+  int reg = modrm.reg;
+  const char **names;
+
   USED_REX (REX_R);
   if (rex & REX_R)
-    add = 8;
-  else
-    add = 0;
+    reg += 8;
   if (need_vex && bytemode != xmm_mode)
     {
       switch (vex.length)
        {
        case 128:
-         sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
+         names = names_xmm;
          break;
        case 256:
-         sprintf (scratchbuf, "%%ymm%d", modrm.reg + add);
+         names = names_ymm;
          break;
        default:
          abort ();
        }
     }
   else
-    sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
-  oappend (scratchbuf + intel_syntax);
+    names = names_xmm;
+  oappend (names[reg]);
 }
 
 static void
 OP_EM (int bytemode, int sizeflag)
 {
+  int reg;
+  const char **names;
+
   if (modrm.mod != 3)
     {
       if (intel_syntax
@@ -12067,20 +14738,17 @@ OP_EM (int bytemode, int sizeflag)
   MODRM_CHECK;
   codep++;
   used_prefixes |= (prefixes & PREFIX_DATA);
+  reg = modrm.rm;
   if (prefixes & PREFIX_DATA)
     {
-      int add;
-
+      names = names_xmm;
       USED_REX (REX_B);
       if (rex & REX_B)
-       add = 8;
-      else
-       add = 0;
-      sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
+       reg += 8;
     }
   else
-    sprintf (scratchbuf, "%%mm%d", modrm.rm);
-  oappend (scratchbuf + intel_syntax);
+    names = names_mm;
+  oappend (names[reg]);
 }
 
 /* cvt* are the only instructions in sse2 which have
@@ -12106,22 +14774,21 @@ OP_EMC (int bytemode, int sizeflag)
   MODRM_CHECK;
   codep++;
   used_prefixes |= (prefixes & PREFIX_DATA);
-  sprintf (scratchbuf, "%%mm%d", modrm.rm);
-  oappend (scratchbuf + intel_syntax);
+  oappend (names_mm[modrm.rm]);
 }
 
 static void
 OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
 {
   used_prefixes |= (prefixes & PREFIX_DATA);
-  sprintf (scratchbuf, "%%mm%d", modrm.reg);
-  oappend (scratchbuf + intel_syntax);
+  oappend (names_mm[modrm.reg]);
 }
 
 static void
 OP_EX (int bytemode, int sizeflag)
 {
-  int add;
+  int reg;
+  const char **names;
 
   /* Skip mod/rm byte.  */
   MODRM_CHECK;
@@ -12133,11 +14800,10 @@ OP_EX (int bytemode, int sizeflag)
       return;
     }
 
+  reg = modrm.rm;
   USED_REX (REX_B);
   if (rex & REX_B)
-    add = 8;
-  else
-    add = 0;
+    reg += 8;
 
   if ((sizeflag & SUFFIX_ALWAYS)
       && (bytemode == x_swap_mode
@@ -12152,18 +14818,18 @@ OP_EX (int bytemode, int sizeflag)
       switch (vex.length)
        {
        case 128:
-         sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
+         names = names_xmm;
          break;
        case 256:
-         sprintf (scratchbuf, "%%ymm%d", modrm.rm + add);
+         names = names_ymm;
          break;
        default:
          abort ();
        }
     }
   else
-    sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
-  oappend (scratchbuf + intel_syntax);
+    names = names_xmm;
+  oappend (names[reg]);
 }
 
 static void
@@ -12395,7 +15061,7 @@ OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
       else
        {
          /* Remove "addr16/addr32".  */
-         addr_prefix = NULL;
+         all_prefixes[last_addr_prefix] = 0;
          op1_names = (address_mode != mode_32bit
                       ? names32 : names16);
          used_prefixes |= PREFIX_ADDR;
@@ -12424,7 +15090,7 @@ REP_Fixup (int bytemode, int sizeflag)
   /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
      lods and stos.  */
   if (prefixes & PREFIX_REPZ)
-    repz_prefix = "rep ";
+    all_prefixes[last_repz_prefix] = REP_PREFIX;
 
   switch (bytemode)
     {
@@ -12462,23 +15128,25 @@ CMPXCHG8B_Fixup (int bytemode, int sizeflag)
 static void
 XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
 {
+  const char **names;
+
   if (need_vex)
     {
       switch (vex.length)
        {
        case 128:
-         sprintf (scratchbuf, "%%xmm%d", reg);
+         names = names_xmm;
          break;
        case 256:
-         sprintf (scratchbuf, "%%ymm%d", reg);
+         names = names_ymm;
          break;
        default:
          abort ();
        }
     }
   else
-    sprintf (scratchbuf, "%%xmm%d", reg);
-  oappend (scratchbuf + intel_syntax);
+    names = names_xmm;
+  oappend (names[reg]);
 }
 
 static void
@@ -12502,11 +15170,14 @@ CRC32_Fixup (int bytemode, int sizeflag)
       USED_REX (REX_W);
       if (rex & REX_W)
        *p++ = 'q';
-      else if (sizeflag & DFLAG)
-       *p++ = 'l';
-      else
-       *p++ = 'w';
-      used_prefixes |= (prefixes & PREFIX_DATA);
+      else 
+       {
+         if (sizeflag & DFLAG)
+           *p++ = 'l';
+         else
+           *p++ = 'w';
+         used_prefixes |= (prefixes & PREFIX_DATA);
+       }
       break;
     default:
       oappend (INTERNAL_DISASSEMBLER_ERROR);
@@ -12549,12 +15220,30 @@ skip:
     OP_E (bytemode, sizeflag);
 }
 
+static void
+FXSAVE_Fixup (int bytemode, int sizeflag)
+{
+  /* Add proper suffix to "fxsave" and "fxrstor".  */
+  USED_REX (REX_W);
+  if (rex & REX_W)
+    {
+      char *p = mnemonicendp;
+      *p++ = '6';
+      *p++ = '4';
+      *p = '\0';
+      mnemonicendp = p;
+    }
+  OP_M (bytemode, sizeflag);
+}
+
 /* Display the destination register operand for instructions with
    VEX. */
 
 static void
 OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
 {
+  const char **names;
+
   if (!need_vex)
     abort ();
 
@@ -12574,7 +15263,7 @@ OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
          return;
        }
 
-      sprintf (scratchbuf, "%%xmm%d", vex.register_specifier);
+      names = names_xmm;
       break;
     case 256:
       switch (bytemode)
@@ -12587,77 +15276,96 @@ OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
          return;
        }
 
-      sprintf (scratchbuf, "%%ymm%d", vex.register_specifier);
+      names = names_ymm;
       break;
     default:
       abort ();
       break;
     }
-  oappend (scratchbuf + intel_syntax);
+  oappend (names[vex.register_specifier]);
 }
 
 /* Get the VEX immediate byte without moving codep.  */
 
 static unsigned char
-get_vex_imm8 (int sizeflag)
+get_vex_imm8 (int sizeflag, int opnum)
 {
   int bytes_before_imm = 0;
 
-  /* Skip mod/rm byte.   */
-  MODRM_CHECK;
-  codep++;
-
   if (modrm.mod != 3)
     {
       /* There are SIB/displacement bytes.  */
       if ((sizeflag & AFLAG) || address_mode == mode_64bit)
-       {
+        {
          /* 32/64 bit address mode */
-         int base = modrm.rm;
+          int base = modrm.rm;
 
          /* Check SIB byte.  */
-         if (base == 4)
-           {
-             FETCH_DATA (the_info, codep + 1);
-             base = *codep & 7;
-             bytes_before_imm++;
-           }
-
-         switch (modrm.mod)
-           {
-           case 0:
-             /* When modrm.rm == 5 or modrm.rm == 4 and base in
-                SIB == 5, there is a 4 byte displacement.  */
-             if (base != 5)
-               /* No displacement. */
-               break;
-           case 2:
-             /* 4 byte displacement.  */
-             bytes_before_imm += 4;
-             break;
-           case 1:
-             /* 1 byte displacement.  */
-             bytes_before_imm++;
-             break;
-           }
-       }
+          if (base == 4)
+            {
+              FETCH_DATA (the_info, codep + 1);
+              base = *codep & 7;
+              /* When decoding the third source, don't increase
+                 bytes_before_imm as this has already been incremented
+                 by one in OP_E_memory while decoding the second
+                 source operand.  */
+              if (opnum == 0)
+                bytes_before_imm++;
+            }
+
+          /* Don't increase bytes_before_imm when decoding the third source,
+             it has already been incremented by OP_E_memory while decoding
+             the second source operand.  */
+          if (opnum == 0)
+            {
+              switch (modrm.mod)
+                {
+                  case 0:
+                    /* When modrm.rm == 5 or modrm.rm == 4 and base in
+                       SIB == 5, there is a 4 byte displacement.  */
+                    if (base != 5)
+                      /* No displacement. */
+                      break;
+                  case 2:
+                    /* 4 byte displacement.  */
+                    bytes_before_imm += 4;
+                    break;
+                  case 1:
+                    /* 1 byte displacement.  */
+                    bytes_before_imm++;
+                    break;
+                }
+            }
+        }
       else
-       { /* 16 bit address mode */
-         switch (modrm.mod)
-           {
-           case 0:
-             /* When modrm.rm == 6, there is a 2 byte displacement.  */
-             if (modrm.rm != 6)
-               /* No displacement. */
-               break;
-           case 2:
-             /* 2 byte displacement.  */
-             bytes_before_imm += 2;
-             break;
-           case 1:
-             /* 1 byte displacement.  */
-             bytes_before_imm++;
-             break;
+       {
+         /* 16 bit address mode */
+          /* Don't increase bytes_before_imm when decoding the third source,
+             it has already been incremented by OP_E_memory while decoding
+             the second source operand.  */
+          if (opnum == 0)
+            {
+             switch (modrm.mod)
+               {
+               case 0:
+                 /* When modrm.rm == 6, there is a 2 byte displacement.  */
+                 if (modrm.rm != 6)
+                   /* No displacement. */
+                   break;
+               case 2:
+                 /* 2 byte displacement.  */
+                 bytes_before_imm += 2;
+                 break;
+               case 1:
+                 /* 1 byte displacement: when decoding the third source,
+                    don't increase bytes_before_imm as this has already
+                    been incremented by one in OP_E_memory while decoding
+                    the second source operand.  */
+                 if (opnum == 0)
+                   bytes_before_imm++;
+
+                 break;
+               }
            }
        }
     }
@@ -12669,6 +15377,8 @@ get_vex_imm8 (int sizeflag)
 static void
 OP_EX_VexReg (int bytemode, int sizeflag, int reg)
 {
+  const char **names;
+
   if (reg == -1 && modrm.mod != 3)
     {
       OP_E_memory (bytemode, sizeflag);
@@ -12690,15 +15400,63 @@ OP_EX_VexReg (int bytemode, int sizeflag, int reg)
   switch (vex.length)
     {
     case 128:
-      sprintf (scratchbuf, "%%xmm%d", reg);
+      names = names_xmm;
       break;
     case 256:
-      sprintf (scratchbuf, "%%ymm%d", reg);
+      names = names_ymm;
       break;
     default:
       abort ();
     }
-  oappend (scratchbuf + intel_syntax);
+  oappend (names[reg]);
+}
+
+static void
+OP_Vex_2src (int bytemode, int sizeflag)
+{
+  if (modrm.mod == 3)
+    {
+      int reg = modrm.rm;
+      USED_REX (REX_B);
+      if (rex & REX_B)
+       reg += 8;
+      oappend (names_xmm[reg]);
+    }
+  else
+    {
+      if (intel_syntax
+         && (bytemode == v_mode || bytemode == v_swap_mode))
+       {
+         bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
+         used_prefixes |= (prefixes & PREFIX_DATA);
+       }
+      OP_E (bytemode, sizeflag);
+    }
+}
+
+static void
+OP_Vex_2src_1 (int bytemode, int sizeflag)
+{
+  if (modrm.mod == 3)
+    {
+      /* Skip mod/rm byte.   */
+      MODRM_CHECK;
+      codep++;
+    }
+
+  if (vex.w)
+    oappend (names_xmm[vex.register_specifier]);
+  else
+    OP_Vex_2src (bytemode, sizeflag);
+}
+
+static void
+OP_Vex_2src_2 (int bytemode, int sizeflag)
+{
+  if (vex.w)
+    OP_Vex_2src (bytemode, sizeflag);
+  else
+    oappend (names_xmm[vex.register_specifier]);
 }
 
 static void
@@ -12709,13 +15467,18 @@ OP_EX_VexW (int bytemode, int sizeflag)
   if (!vex_w_done)
     {
       vex_w_done = 1;
+
+      /* Skip mod/rm byte.  */
+      MODRM_CHECK;
+      codep++;
+
       if (vex.w)
-       reg = get_vex_imm8 (sizeflag) >> 4;
+       reg = get_vex_imm8 (sizeflag, 0) >> 4;
     }
   else
     {
       if (!vex.w)
-       reg = get_vex_imm8 (sizeflag) >> 4;
+       reg = get_vex_imm8 (sizeflag, 1) >> 4;
     }
 
   OP_EX_VexReg (bytemode, sizeflag, reg);
@@ -12735,6 +15498,8 @@ static void
 OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
 {
   int reg;
+  const char **names;
+
   FETCH_DATA (the_info, codep + 1);
   reg = *codep++;
 
@@ -12751,15 +15516,15 @@ OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
   switch (vex.length)
     {
     case 128:
-      sprintf (scratchbuf, "%%xmm%d", reg);
+      names = names_xmm;
       break;
     case 256:
-      sprintf (scratchbuf, "%%ymm%d", reg);
+      names = names_ymm;
       break;
     default:
       abort ();
     }
-  oappend (scratchbuf + intel_syntax);
+  oappend (names[reg]);
 }
 
 static void
@@ -12939,12 +15704,15 @@ MOVBE_Fixup (int bytemode, int sizeflag)
        {
          if (rex & REX_W)
            *p++ = 'q';
-         else if (sizeflag & DFLAG)
-           *p++ = 'l';
          else
-           *p++ = 'w';
+           {
+             if (sizeflag & DFLAG)
+               *p++ = 'l';
+             else
+               *p++ = 'w';
+             used_prefixes |= (prefixes & PREFIX_DATA);
+           }
        }
-      used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     default:
       oappend (INTERNAL_DISASSEMBLER_ERROR);
@@ -12956,3 +15724,53 @@ MOVBE_Fixup (int bytemode, int sizeflag)
 skip:
   OP_M (bytemode, sizeflag);
 }
+
+static void
+OP_LWPCB_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
+{
+  int reg;
+  const char **names;
+
+  /* Skip mod/rm byte.  */
+  MODRM_CHECK;
+  codep++;
+
+  if (vex.w)
+    names = names64;
+  else if (vex.length == 256)
+    names = names32;
+  else
+    names = names16;
+
+  reg = modrm.rm;
+  USED_REX (REX_B);
+  if (rex & REX_B)
+    reg += 8;
+
+  oappend (names[reg]);
+}
+
+static void
+OP_LWP_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
+{
+  const char **names;
+
+  if (vex.w)
+    names = names64;
+  else if (vex.length == 256)
+    names = names32;
+  else
+    names = names16;
+
+  oappend (names[vex.register_specifier]);
+}
+
+static void
+OP_LWP_I (int bytemode ATTRIBUTE_UNUSED, int sizeflag)
+{
+  if (vex.w || vex.length == 256)
+    OP_I (q_mode, sizeflag);
+  else
+    OP_I (w_mode, sizeflag);
+}
+
This page took 0.108318 seconds and 4 git commands to generate.