*** empty log message ***
[deliverable/binutils-gdb.git] / opcodes / i386-dis.c
index 50088d08678ea003746b9e5a669844b69ccf3291..d69078cd75e779fb90315b36932d94a72e53958f 100644 (file)
@@ -1,6 +1,6 @@
 /* Print i386 instructions for GDB, the GNU debugger.
    Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    This file is part of the GNU opcodes library.
@@ -55,8 +55,8 @@ static void append_seg (void);
 static void OP_indirE (int, int);
 static void print_operand_value (char *, int, bfd_vma);
 static void OP_E_register (int, int);
-static void OP_E_memory (int, int, int);
-static void OP_E_extended (int, int, int);
+static void 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);
@@ -93,18 +93,12 @@ static void OP_MS (int, int);
 static void OP_XS (int, int);
 static void OP_M (int, int);
 static void OP_VEX (int, int);
-static void OP_VEX_FMA (int, int);
 static void OP_EX_Vex (int, int);
-static void OP_EX_VexW (int, int);
-static void OP_EX_VexImmW (int, int);
 static void OP_XMM_Vex (int, int);
-static void OP_XMM_VexW (int, int);
 static void OP_REG_VexI4 (int, int);
 static void PCLMUL_Fixup (int, int);
-static void VEXI4_Fixup (int, int);
 static void VZERO_Fixup (int, int);
 static void VCMP_Fixup (int, int);
-static void VPERMIL2_Fixup (int, int);
 static void OP_0f07 (int, int);
 static void OP_Monitor (int, int);
 static void OP_Mwait (int, int);
@@ -117,11 +111,7 @@ 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 print_drex_arg (unsigned int, int, int);
-static void OP_DREX4 (int, int);
-static void OP_DREX3 (int, int);
-static void OP_DREX_ICMP (int, int);
-static void OP_DREX_FCMP (int, int);
+
 static void MOVBE_Fixup (int, int);
 
 struct dis_private {
@@ -169,20 +159,6 @@ static int rex_ignored;
       rex_used |= REX_OPCODE;                          \
   }
 
-/* Special 'registers' for DREX handling */
-#define DREX_REG_UNKNOWN       1000    /* not initialized */
-#define DREX_REG_MEMORY         1001   /* use MODRM/SIB/OFFSET memory */
-
-/* The DREX byte has the following fields:
-   Bits 7-4 -- DREX.Dest, xmm destination register
-   Bit 3    -- DREX.OC0, operand config bit defines operand order
-   Bit 2    -- DREX.R, equivalent to REX_R bit, to extend ModRM register
-   Bit 1    -- DREX.X, equivalent to REX_X bit, to extend SIB index field
-   Bit 0    -- DREX.W, equivalent to REX_B bit, to extend ModRM r/m field,
-              SIB base field, or opcode reg field.  */
-#define DREX_XMM(drex) ((drex >> 4) & 0xf)
-#define DREX_OC0(drex) ((drex >> 3) & 0x1)
-
 /* Flags for prefixes which we somehow handled when printing the
    current instruction.  */
 static int used_prefixes;
@@ -362,6 +338,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define EMx { OP_EM, x_mode }
 #define EXw { OP_EX, w_mode }
 #define EXd { OP_EX, d_mode }
+#define EXdS { OP_EX, d_swap_mode }
 #define EXq { OP_EX, q_mode }
 #define EXqS { OP_EX, q_swap_mode }
 #define EXx { OP_EX, x_mode }
@@ -369,6 +346,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define EXxmm { OP_EX, xmm_mode }
 #define EXxmmq { OP_EX, xmmq_mode }
 #define EXymmq { OP_EX, ymmq_mode }
+#define EXVexWdq { OP_EX, vex_w_dq_mode }
 #define MS { OP_MS, v_mode }
 #define XS { OP_XS, v_mode }
 #define EMCq { OP_EMC, q_mode }
@@ -380,22 +358,15 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define Vex { OP_VEX, vex_mode }
 #define Vex128 { OP_VEX, vex128_mode }
 #define Vex256 { OP_VEX, vex256_mode }
-#define VexI4 { VEXI4_Fixup, 0}
-#define VexFMA { OP_VEX_FMA, vex_mode }
-#define Vex128FMA { OP_VEX_FMA, vex128_mode }
 #define EXdVex { OP_EX_Vex, d_mode }
+#define EXdVexS { OP_EX_Vex, d_swap_mode }
 #define EXqVex { OP_EX_Vex, q_mode }
-#define EXVexW { OP_EX_VexW, x_mode }
-#define EXdVexW { OP_EX_VexW, d_mode }
-#define EXqVexW { OP_EX_VexW, q_mode }
-#define EXVexImmW { OP_EX_VexImmW, x_mode }
+#define EXqVexS { OP_EX_Vex, q_swap_mode }
 #define XMVex { OP_XMM_Vex, 0 }
-#define XMVexW { OP_XMM_VexW, 0 }
 #define XMVexI4 { OP_REG_VexI4, x_mode }
 #define PCLMUL { PCLMUL_Fixup, 0 }
 #define VZERO { VZERO_Fixup, 0 }
 #define VCMP { VCMP_Fixup, 0 }
-#define VPERMIL2 { VPERMIL2_Fixup, 0 }
 
 /* Used handle "rep" prefix for string instructions.  */
 #define Xbr { REP_Fixup, eSI_reg }
@@ -427,8 +398,10 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define w_mode                 (v_swap_mode + 1)
 /* double word operand  */
 #define d_mode                 (w_mode + 1)
+/* double word operand with operand swapped */
+#define d_swap_mode            (d_mode + 1)
 /* quad word operand */
-#define q_mode                 (d_mode + 1)
+#define q_mode                 (d_swap_mode + 1)
 /* quad word operand with operand swapped */
 #define q_swap_mode            (q_mode + 1)
 /* ten-byte operand */
@@ -472,8 +445,10 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define vex128_mode            (vex_mode + 1)
 /* 256bit vex mode */
 #define vex256_mode            (vex128_mode + 1)
+/* operand size depends on the VEX.W bit.  */
+#define vex_w_dq_mode          (vex256_mode + 1)
 
-#define es_reg                 (vex256_mode + 1)
+#define es_reg                 (vex_w_dq_mode + 1)
 #define cs_reg                 (es_reg + 1)
 #define ss_reg                 (cs_reg + 1)
 #define ds_reg                 (ss_reg + 1)
@@ -521,15 +496,6 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 
 #define MAX_BYTEMODE   indir_dx_reg
 
-/* Flags that are OR'ed into the bytemode field to pass extra
-   information.  */
-#define DREX_OC1               0x10000 /* OC1 bit set */
-#define DREX_NO_OC0            0x20000 /* OC0 bit not used */
-#define DREX_MASK              0x40000 /* mask to delete */
-
-#if MAX_BYTEMODE >= DREX_OC1
-#error MAX_BYTEMODE must be less than DREX_OC1
-#endif
 
 #define FLOATCODE              1
 #define USE_REG_TABLE          (FLOATCODE + 1)
@@ -952,7 +918,37 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define PREFIX_VEX_383F                (PREFIX_VEX_383E + 1)
 #define PREFIX_VEX_3840                (PREFIX_VEX_383F + 1)
 #define PREFIX_VEX_3841                (PREFIX_VEX_3840 + 1)
-#define PREFIX_VEX_38DB                (PREFIX_VEX_3841 + 1)
+#define PREFIX_VEX_3896                (PREFIX_VEX_3841 + 1)
+#define PREFIX_VEX_3897                (PREFIX_VEX_3896 + 1)
+#define PREFIX_VEX_3898                (PREFIX_VEX_3897 + 1)
+#define PREFIX_VEX_3899                (PREFIX_VEX_3898 + 1)
+#define PREFIX_VEX_389A                (PREFIX_VEX_3899 + 1)
+#define PREFIX_VEX_389B                (PREFIX_VEX_389A + 1)
+#define PREFIX_VEX_389C                (PREFIX_VEX_389B + 1)
+#define PREFIX_VEX_389D                (PREFIX_VEX_389C + 1)
+#define PREFIX_VEX_389E                (PREFIX_VEX_389D + 1)
+#define PREFIX_VEX_389F                (PREFIX_VEX_389E + 1)
+#define PREFIX_VEX_38A6                (PREFIX_VEX_389F + 1)
+#define PREFIX_VEX_38A7                (PREFIX_VEX_38A6 + 1)
+#define PREFIX_VEX_38A8                (PREFIX_VEX_38A7 + 1)
+#define PREFIX_VEX_38A9                (PREFIX_VEX_38A8 + 1)
+#define PREFIX_VEX_38AA                (PREFIX_VEX_38A9 + 1)
+#define PREFIX_VEX_38AB                (PREFIX_VEX_38AA + 1)
+#define PREFIX_VEX_38AC                (PREFIX_VEX_38AB + 1)
+#define PREFIX_VEX_38AD                (PREFIX_VEX_38AC + 1)
+#define PREFIX_VEX_38AE                (PREFIX_VEX_38AD + 1)
+#define PREFIX_VEX_38AF                (PREFIX_VEX_38AE + 1)
+#define PREFIX_VEX_38B6                (PREFIX_VEX_38AF + 1)
+#define PREFIX_VEX_38B7                (PREFIX_VEX_38B6 + 1)
+#define PREFIX_VEX_38B8                (PREFIX_VEX_38B7 + 1)
+#define PREFIX_VEX_38B9                (PREFIX_VEX_38B8 + 1)
+#define PREFIX_VEX_38BA                (PREFIX_VEX_38B9 + 1)
+#define PREFIX_VEX_38BB                (PREFIX_VEX_38BA + 1)
+#define PREFIX_VEX_38BC                (PREFIX_VEX_38BB + 1)
+#define PREFIX_VEX_38BD                (PREFIX_VEX_38BC + 1)
+#define PREFIX_VEX_38BE                (PREFIX_VEX_38BD + 1)
+#define PREFIX_VEX_38BF                (PREFIX_VEX_38BE + 1)
+#define PREFIX_VEX_38DB                (PREFIX_VEX_38BF + 1)
 #define PREFIX_VEX_38DC                (PREFIX_VEX_38DB + 1)
 #define PREFIX_VEX_38DD                (PREFIX_VEX_38DC + 1)
 #define PREFIX_VEX_38DE                (PREFIX_VEX_38DD + 1)
@@ -980,36 +976,15 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define PREFIX_VEX_3A40                (PREFIX_VEX_3A22 + 1)
 #define PREFIX_VEX_3A41                (PREFIX_VEX_3A40 + 1)
 #define PREFIX_VEX_3A42                (PREFIX_VEX_3A41 + 1)
-#define PREFIX_VEX_3A48                (PREFIX_VEX_3A42 + 1)
-#define PREFIX_VEX_3A49                (PREFIX_VEX_3A48 + 1)
-#define PREFIX_VEX_3A4A                (PREFIX_VEX_3A49 + 1)
+#define PREFIX_VEX_3A44                (PREFIX_VEX_3A42 + 1)
+#define PREFIX_VEX_3A4A                (PREFIX_VEX_3A44 + 1)
 #define PREFIX_VEX_3A4B                (PREFIX_VEX_3A4A + 1)
 #define PREFIX_VEX_3A4C                (PREFIX_VEX_3A4B + 1)
-#define PREFIX_VEX_3A5C                (PREFIX_VEX_3A4C + 1)
-#define PREFIX_VEX_3A5D                (PREFIX_VEX_3A5C + 1)
-#define PREFIX_VEX_3A5E                (PREFIX_VEX_3A5D + 1)
-#define PREFIX_VEX_3A5F                (PREFIX_VEX_3A5E + 1)
-#define PREFIX_VEX_3A60                (PREFIX_VEX_3A5F + 1)
+#define PREFIX_VEX_3A60                (PREFIX_VEX_3A4C + 1)
 #define PREFIX_VEX_3A61                (PREFIX_VEX_3A60 + 1)
 #define PREFIX_VEX_3A62                (PREFIX_VEX_3A61 + 1)
 #define PREFIX_VEX_3A63                (PREFIX_VEX_3A62 + 1)
-#define PREFIX_VEX_3A68                (PREFIX_VEX_3A63 + 1)
-#define PREFIX_VEX_3A69                (PREFIX_VEX_3A68 + 1)
-#define PREFIX_VEX_3A6A                (PREFIX_VEX_3A69 + 1)
-#define PREFIX_VEX_3A6B                (PREFIX_VEX_3A6A + 1)
-#define PREFIX_VEX_3A6C                (PREFIX_VEX_3A6B + 1)
-#define PREFIX_VEX_3A6D                (PREFIX_VEX_3A6C + 1)
-#define PREFIX_VEX_3A6E                (PREFIX_VEX_3A6D + 1)
-#define PREFIX_VEX_3A6F                (PREFIX_VEX_3A6E + 1)
-#define PREFIX_VEX_3A78                (PREFIX_VEX_3A6F + 1)
-#define PREFIX_VEX_3A79                (PREFIX_VEX_3A78 + 1)
-#define PREFIX_VEX_3A7A                (PREFIX_VEX_3A79 + 1)
-#define PREFIX_VEX_3A7B                (PREFIX_VEX_3A7A + 1)
-#define PREFIX_VEX_3A7C                (PREFIX_VEX_3A7B + 1)
-#define PREFIX_VEX_3A7D                (PREFIX_VEX_3A7C + 1)
-#define PREFIX_VEX_3A7E                (PREFIX_VEX_3A7D + 1)
-#define PREFIX_VEX_3A7F                (PREFIX_VEX_3A7E + 1)
-#define PREFIX_VEX_3ADF                (PREFIX_VEX_3A7F + 1)
+#define PREFIX_VEX_3ADF                (PREFIX_VEX_3A63 + 1)
 
 #define X86_64_06              0
 #define X86_64_07              (X86_64_06 + 1)
@@ -1040,12 +1015,9 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define X86_64_0F01_REG_2      (X86_64_0F01_REG_1 + 1)
 #define X86_64_0F01_REG_3      (X86_64_0F01_REG_2 + 1)
 
-#define THREE_BYTE_0F24                0
-#define THREE_BYTE_0F25                (THREE_BYTE_0F24 + 1)
-#define THREE_BYTE_0F38                (THREE_BYTE_0F25 + 1)
+#define THREE_BYTE_0F38                0
 #define THREE_BYTE_0F3A                (THREE_BYTE_0F38 + 1)
 #define THREE_BYTE_0F7A                (THREE_BYTE_0F3A + 1)
-#define THREE_BYTE_0F7B                (THREE_BYTE_0F7A + 1)
 
 #define VEX_0F                 0
 #define VEX_0F38               (VEX_0F + 1)
@@ -1065,8 +1037,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define VEX_LEN_17_M_0 (VEX_LEN_16_P_2 + 1)
 #define VEX_LEN_2A_P_1 (VEX_LEN_17_M_0 + 1)
 #define VEX_LEN_2A_P_3 (VEX_LEN_2A_P_1 + 1)
-#define VEX_LEN_2B_M_0 (VEX_LEN_2A_P_3 + 1)
-#define VEX_LEN_2C_P_1 (VEX_LEN_2B_M_0 + 1)
+#define VEX_LEN_2C_P_1 (VEX_LEN_2A_P_3 + 1)
 #define VEX_LEN_2C_P_3 (VEX_LEN_2C_P_1 + 1)
 #define VEX_LEN_2D_P_1 (VEX_LEN_2C_P_3 + 1)
 #define VEX_LEN_2D_P_3 (VEX_LEN_2D_P_1 + 1)
@@ -1152,8 +1123,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define VEX_LEN_E3_P_2 (VEX_LEN_E2_P_2 + 1)
 #define VEX_LEN_E4_P_2 (VEX_LEN_E3_P_2 + 1)
 #define VEX_LEN_E5_P_2 (VEX_LEN_E4_P_2 + 1)
-#define VEX_LEN_E7_P_2_M_0     (VEX_LEN_E5_P_2 + 1)
-#define VEX_LEN_E8_P_2 (VEX_LEN_E7_P_2_M_0 + 1)
+#define VEX_LEN_E8_P_2 (VEX_LEN_E5_P_2 + 1)
 #define VEX_LEN_E9_P_2 (VEX_LEN_E8_P_2 + 1)
 #define VEX_LEN_EA_P_2 (VEX_LEN_E9_P_2 + 1)
 #define VEX_LEN_EB_P_2 (VEX_LEN_EA_P_2 + 1)
@@ -1240,20 +1210,13 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define VEX_LEN_3A22_P_2       (VEX_LEN_3A21_P_2 + 1)
 #define VEX_LEN_3A41_P_2       (VEX_LEN_3A22_P_2 + 1)
 #define VEX_LEN_3A42_P_2       (VEX_LEN_3A41_P_2 + 1)
-#define VEX_LEN_3A4C_P_2       (VEX_LEN_3A42_P_2 + 1)
+#define VEX_LEN_3A44_P_2       (VEX_LEN_3A42_P_2 + 1)
+#define VEX_LEN_3A4C_P_2       (VEX_LEN_3A44_P_2 + 1)
 #define VEX_LEN_3A60_P_2       (VEX_LEN_3A4C_P_2 + 1)
 #define VEX_LEN_3A61_P_2       (VEX_LEN_3A60_P_2 + 1)
 #define VEX_LEN_3A62_P_2       (VEX_LEN_3A61_P_2 + 1)
 #define VEX_LEN_3A63_P_2       (VEX_LEN_3A62_P_2 + 1)
-#define VEX_LEN_3A6A_P_2       (VEX_LEN_3A63_P_2 + 1)
-#define VEX_LEN_3A6B_P_2       (VEX_LEN_3A6A_P_2 + 1)
-#define VEX_LEN_3A6E_P_2       (VEX_LEN_3A6B_P_2 + 1)
-#define VEX_LEN_3A6F_P_2       (VEX_LEN_3A6E_P_2 + 1)
-#define VEX_LEN_3A7A_P_2       (VEX_LEN_3A6F_P_2 + 1)
-#define VEX_LEN_3A7B_P_2       (VEX_LEN_3A7A_P_2 + 1)
-#define VEX_LEN_3A7E_P_2       (VEX_LEN_3A7B_P_2 + 1)
-#define VEX_LEN_3A7F_P_2       (VEX_LEN_3A7E_P_2 + 1)
-#define VEX_LEN_3ADF_P_2       (VEX_LEN_3A7F_P_2 + 1)
+#define VEX_LEN_3ADF_P_2       (VEX_LEN_3A63_P_2 + 1)
 
 typedef void (*op_rtn) (int bytemode, int sizeflag);
 
@@ -1305,6 +1268,7 @@ struct dis386 {
    2 upper case letter macros:
    "XY" => print 'x' or 'y' if no register operands or suffix_always
           is true.
+   'XW' => print 's', 'd' depending on the VEX.W bit (for FMA)
    'LQ' => print 'l' ('d' in Intel mode) or 'q' for memory operand
           or suffix_always is true
 
@@ -1318,8 +1282,8 @@ static const struct dis386 dis386[] = {
   /* 00 */
   { "addB",            { Eb, Gb } },
   { "addS",            { Ev, Gv } },
-  { "addB",            { Gb, Eb } },
-  { "addS",            { Gv, Ev } },
+  { "addB",            { Gb, EbS } },
+  { "addS",            { Gv, EvS } },
   { "addB",            { AL, Ib } },
   { "addS",            { eAX, Iv } },
   { X86_64_TABLE (X86_64_06) },
@@ -1327,8 +1291,8 @@ static const struct dis386 dis386[] = {
   /* 08 */
   { "orB",             { Eb, Gb } },
   { "orS",             { Ev, Gv } },
-  { "orB",             { Gb, Eb } },
-  { "orS",             { Gv, Ev } },
+  { "orB",             { Gb, EbS } },
+  { "orS",             { Gv, EvS } },
   { "orB",             { AL, Ib } },
   { "orS",             { eAX, Iv } },
   { X86_64_TABLE (X86_64_0D) },
@@ -1336,8 +1300,8 @@ static const struct dis386 dis386[] = {
   /* 10 */
   { "adcB",            { Eb, Gb } },
   { "adcS",            { Ev, Gv } },
-  { "adcB",            { Gb, Eb } },
-  { "adcS",            { Gv, Ev } },
+  { "adcB",            { Gb, EbS } },
+  { "adcS",            { Gv, EvS } },
   { "adcB",            { AL, Ib } },
   { "adcS",            { eAX, Iv } },
   { X86_64_TABLE (X86_64_16) },
@@ -1345,8 +1309,8 @@ static const struct dis386 dis386[] = {
   /* 18 */
   { "sbbB",            { Eb, Gb } },
   { "sbbS",            { Ev, Gv } },
-  { "sbbB",            { Gb, Eb } },
-  { "sbbS",            { Gv, Ev } },
+  { "sbbB",            { Gb, EbS } },
+  { "sbbS",            { Gv, EvS } },
   { "sbbB",            { AL, Ib } },
   { "sbbS",            { eAX, Iv } },
   { X86_64_TABLE (X86_64_1E) },
@@ -1354,8 +1318,8 @@ static const struct dis386 dis386[] = {
   /* 20 */
   { "andB",            { Eb, Gb } },
   { "andS",            { Ev, Gv } },
-  { "andB",            { Gb, Eb } },
-  { "andS",            { Gv, Ev } },
+  { "andB",            { Gb, EbS } },
+  { "andS",            { Gv, EvS } },
   { "andB",            { AL, Ib } },
   { "andS",            { eAX, Iv } },
   { "(bad)",           { XX } },       /* SEG ES prefix */
@@ -1363,8 +1327,8 @@ static const struct dis386 dis386[] = {
   /* 28 */
   { "subB",            { Eb, Gb } },
   { "subS",            { Ev, Gv } },
-  { "subB",            { Gb, Eb } },
-  { "subS",            { Gv, Ev } },
+  { "subB",            { Gb, EbS } },
+  { "subS",            { Gv, EvS } },
   { "subB",            { AL, Ib } },
   { "subS",            { eAX, Iv } },
   { "(bad)",           { XX } },       /* SEG CS prefix */
@@ -1372,8 +1336,8 @@ static const struct dis386 dis386[] = {
   /* 30 */
   { "xorB",            { Eb, Gb } },
   { "xorS",            { Ev, Gv } },
-  { "xorB",            { Gb, Eb } },
-  { "xorS",            { Gv, Ev } },
+  { "xorB",            { Gb, EbS } },
+  { "xorS",            { Gv, EvS } },
   { "xorB",            { AL, Ib } },
   { "xorS",            { eAX, Iv } },
   { "(bad)",           { XX } },       /* SEG SS prefix */
@@ -1381,8 +1345,8 @@ static const struct dis386 dis386[] = {
   /* 38 */
   { "cmpB",            { Eb, Gb } },
   { "cmpS",            { Ev, Gv } },
-  { "cmpB",            { Gb, Eb } },
-  { "cmpS",            { Gv, Ev } },
+  { "cmpB",            { Gb, EbS } },
+  { "cmpS",            { Gv, EvS } },
   { "cmpB",            { AL, Ib } },
   { "cmpS",            { eAX, Iv } },
   { "(bad)",           { XX } },       /* SEG DS prefix */
@@ -1648,7 +1612,7 @@ static const struct dis386 dis386_twobyte[] = {
   { MOD_TABLE (MOD_0F22) },
   { MOD_TABLE (MOD_0F23) },
   { MOD_TABLE (MOD_0F24) },
-  { THREE_BYTE_TABLE (THREE_BYTE_0F25) },
+  { "(bad)",           { XX } },
   { MOD_TABLE (MOD_0F26) },
   { "(bad)",           { XX } },
   /* 28 */
@@ -1745,7 +1709,7 @@ static const struct dis386 dis386_twobyte[] = {
   { PREFIX_TABLE (PREFIX_0F78) },
   { PREFIX_TABLE (PREFIX_0F79) },
   { THREE_BYTE_TABLE (THREE_BYTE_0F7A) },
-  { THREE_BYTE_TABLE (THREE_BYTE_0F7B) },
+  { "(bad)",           { XX } },
   { PREFIX_TABLE (PREFIX_0F7C) },
   { PREFIX_TABLE (PREFIX_0F7D) },
   { PREFIX_TABLE (PREFIX_0F7E) },
@@ -2427,9 +2391,9 @@ static const struct dis386 prefix_table[][4] = {
   /* PREFIX_0F11 */
   {
     { "movups",        { EXxS, XM } },
-    { "movss", { EXd, XM } },
+    { "movss", { EXdS, XM } },
     { "movupd",        { EXxS, XM } },
-    { "movsd", { EXq, XM } },
+    { "movsd", { EXqS, XM } },
   },
 
   /* PREFIX_0F12 */
@@ -4568,459 +4532,531 @@ static const struct dis386 prefix_table[][4] = {
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_38DB */
+  /* PREFIX_VEX_3896 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_38DB_P_2) },
+    { "vfmaddsub132p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_38DC */
+  /* PREFIX_VEX_3897 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_38DC_P_2) },
+    { "vfmsubadd132p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_38DD */
+  /* PREFIX_VEX_3898 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_38DD_P_2) },
+    { "vfmadd132p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_38DE */
+  /* PREFIX_VEX_3899 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_38DE_P_2) },
+    { "vfmadd132s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_38DF */
+  /* PREFIX_VEX_389A */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_38DF_P_2) },
+    { "vfmsub132p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A04 */
+  /* PREFIX_VEX_389B */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vpermilps", { XM, EXx, Ib } },
+    { "vfmsub132s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A05 */
+  /* PREFIX_VEX_389C */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vpermilpd", { XM, EXx, Ib } },
+    { "vfnmadd132p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A06 */
+  /* PREFIX_VEX_389D */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A06_P_2) },
+    { "vfnmadd132s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A08 */
+  /* PREFIX_VEX_389E */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vroundps", { XM, EXx, Ib } },
+    { "vfnmsub132p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A09 */
+  /* PREFIX_VEX_389F */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vroundpd", { XM, EXx, Ib } },
+    { "vfnmsub132s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A0A */
+  /* PREFIX_VEX_38A6 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A0A_P_2) },
+    { "vfmaddsub213p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A0B */
+  /* PREFIX_VEX_38A7 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A0B_P_2) },
+    { "vfmsubadd213p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A0C */
+  /* PREFIX_VEX_38A8 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vblendps", { XM, Vex, EXx, Ib } },
+    { "vfmadd213p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A0D */
+  /* PREFIX_VEX_38A9 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vblendpd", { XM, Vex, EXx, Ib } },
+    { "vfmadd213s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A0E */
+  /* PREFIX_VEX_38AA */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A0E_P_2) },
+    { "vfmsub213p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A0F */
+  /* PREFIX_VEX_38AB */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A0F_P_2) },
+    { "vfmsub213s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A14 */
+  /* PREFIX_VEX_38AC */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A14_P_2) },
+    { "vfnmadd213p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A15 */
+  /* PREFIX_VEX_38AD */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A15_P_2) },
+    { "vfnmadd213s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A16 */
+  /* PREFIX_VEX_38AE */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A16_P_2) },
+    { "vfnmsub213p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A17 */
+  /* PREFIX_VEX_38AF */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A17_P_2) },
+    { "vfnmsub213s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A18 */
+  /* PREFIX_VEX_38B6 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A18_P_2) },
+    { "vfmaddsub231p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A19 */
+  /* PREFIX_VEX_38B7 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A19_P_2) },
+    { "vfmsubadd231p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A20 */
+  /* PREFIX_VEX_38B8 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A20_P_2) },
+    { "vfmadd231p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A21 */
+  /* PREFIX_VEX_38B9 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A21_P_2) },
+    { "vfmadd231s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A22 */
+  /* PREFIX_VEX_38BA */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A22_P_2) },
+    { "vfmsub231p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A40 */
+  /* PREFIX_VEX_38BB */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vdpps", { XM, Vex, EXx, Ib } },
+    { "vfmsub231s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A41 */
+  /* PREFIX_VEX_38BC */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A41_P_2) },
+    { "vfnmadd231p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A42 */
+  /* PREFIX_VEX_38BD */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A42_P_2) },
+    { "vfnmadd231s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A48 */
+  /* PREFIX_VEX_38BE */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, VPERMIL2 } },
+    { "vfnmsub231p%XW", { XM, Vex, EXx } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A49 */
+  /* PREFIX_VEX_38BF */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, VPERMIL2 } },
+    { "vfnmsub231s%XW", { XM, Vex, EXVexWdq } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A4A */
+  /* PREFIX_VEX_38DB */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vblendvps", { XM, Vex, EXx, XMVexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_38DB_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A4B */
+  /* PREFIX_VEX_38DC */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vblendvpd", { XM, Vex, EXx, XMVexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_38DC_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A4C */
+  /* PREFIX_VEX_38DD */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A4C_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_38DD_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A5C */
+  /* PREFIX_VEX_38DE */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfmaddsubps", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_38DE_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A5D */
+  /* PREFIX_VEX_38DF */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfmaddsubpd", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_38DF_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A5E */
+  /* PREFIX_VEX_3A04 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfmsubaddps", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { "vpermilps", { XM, EXx, Ib } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A5F */
+  /* PREFIX_VEX_3A05 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfmsubaddpd", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { "vpermilpd", { XM, EXx, Ib } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A60 */
+  /* PREFIX_VEX_3A06 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A60_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_3A06_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A61 */
+  /* PREFIX_VEX_3A08 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A61_P_2) },
+    { "vroundps", { XM, EXx, Ib } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A62 */
+  /* PREFIX_VEX_3A09 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A62_P_2) },
+    { "vroundpd", { XM, EXx, Ib } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A63 */
+  /* PREFIX_VEX_3A0A */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A63_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_3A0A_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0B */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A0B_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0C */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vblendps", { XM, Vex, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0D */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "vblendpd", { XM, Vex, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0E */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A0E_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A0F */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A0F_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A14 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A14_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A15 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A15_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A16 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A16_P_2) },
+    { "(bad)", { XX } },
+  },
+
+  /* PREFIX_VEX_3A17 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { VEX_LEN_TABLE (VEX_LEN_3A17_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A68 */
+  /* PREFIX_VEX_3A18 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfmaddps", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_3A18_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A69 */
+  /* PREFIX_VEX_3A19 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfmaddpd", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_3A19_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A6A */
+  /* PREFIX_VEX_3A20 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A6A_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_3A20_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A6B */
+  /* PREFIX_VEX_3A21 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A6B_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_3A21_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A6C */
+  /* PREFIX_VEX_3A22 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfmsubps", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_3A22_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A6D */
+  /* PREFIX_VEX_3A40 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfmsubpd", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { "vdpps", { XM, Vex, EXx, Ib } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A6E */
+  /* PREFIX_VEX_3A41 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A6E_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_3A41_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A6F */
+  /* PREFIX_VEX_3A42 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A6F_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_3A42_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A78 */
+  /* PREFIX_VEX_3A44 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfnmaddps", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_3A44_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A79 */
+  /* PREFIX_VEX_3A4A */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfnmaddpd", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { "vblendvps", { XM, Vex, EXx, XMVexI4 } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A7A */
+  /* PREFIX_VEX_3A4B */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A7A_P_2) },
+    { "vblendvpd", { XM, Vex, EXx, XMVexI4 } },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A7B */
+  /* PREFIX_VEX_3A4C */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A7B_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_3A4C_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A7C */
+  /* PREFIX_VEX_3A60 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfnmsubps", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_3A60_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A7D */
+  /* PREFIX_VEX_3A61 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "vfnmsubpd", { XMVexW, VexFMA, EXVexW, EXVexW, VexI4 } },
+    { VEX_LEN_TABLE (VEX_LEN_3A61_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A7E */
+  /* PREFIX_VEX_3A62 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A7E_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_3A62_P_2) },
     { "(bad)", { XX } },
   },
 
-  /* PREFIX_VEX_3A7F */
+  /* PREFIX_VEX_3A63 */
   {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { VEX_LEN_TABLE (VEX_LEN_3A7F_P_2) },
+    { VEX_LEN_TABLE (VEX_LEN_3A63_P_2) },
     { "(bad)", { XX } },
   },
 
@@ -5204,94 +5240,95 @@ static const struct dis386 x86_64_table[][2] = {
 };
 
 static const struct dis386 three_byte_table[][256] = {
-  /* THREE_BYTE_0F24 */
+
+  /* THREE_BYTE_0F38 */
   {
     /* 00 */
-    { "fmaddps",       { { OP_DREX4, q_mode } } },
-    { "fmaddpd",       { { OP_DREX4, q_mode } } },
-    { "fmaddss",       { { OP_DREX4, w_mode } } },
-    { "fmaddsd",       { { OP_DREX4, d_mode } } },
-    { "fmaddps",       { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fmaddpd",       { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fmaddss",       { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "fmaddsd",       { { OP_DREX4, DREX_OC1 + d_mode } } },
+    { "pshufb",                { MX, EM } },
+    { "phaddw",                { MX, EM } },
+    { "phaddd",                { MX, EM } },
+    { "phaddsw",       { MX, EM } },
+    { "pmaddubsw",     { MX, EM } },
+    { "phsubw",                { MX, EM } },
+    { "phsubd",                { MX, EM } },
+    { "phsubsw",       { MX, EM } },
     /* 08 */
-    { "fmsubps",       { { OP_DREX4, q_mode } } },
-    { "fmsubpd",       { { OP_DREX4, q_mode } } },
-    { "fmsubss",       { { OP_DREX4, w_mode } } },
-    { "fmsubsd",       { { OP_DREX4, d_mode } } },
-    { "fmsubps",       { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fmsubpd",       { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fmsubss",       { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "fmsubsd",       { { OP_DREX4, DREX_OC1 + d_mode } } },
-    /* 10 */
-    { "fnmaddps",      { { OP_DREX4, q_mode } } },
-    { "fnmaddpd",      { { OP_DREX4, q_mode } } },
-    { "fnmaddss",      { { OP_DREX4, w_mode } } },
-    { "fnmaddsd",      { { OP_DREX4, d_mode } } },
-    { "fnmaddps",      { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fnmaddpd",      { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fnmaddss",      { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "fnmaddsd",      { { OP_DREX4, DREX_OC1 + d_mode } } },
-    /* 18 */
-    { "fnmsubps",      { { OP_DREX4, q_mode } } },
-    { "fnmsubpd",      { { OP_DREX4, q_mode } } },
-    { "fnmsubss",      { { OP_DREX4, w_mode } } },
-    { "fnmsubsd",      { { OP_DREX4, d_mode } } },
-    { "fnmsubps",      { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fnmsubpd",      { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "fnmsubss",      { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "fnmsubsd",      { { OP_DREX4, DREX_OC1 + d_mode } } },
-    /* 20 */
-    { "permps",                { { OP_DREX4, q_mode } } },
-    { "permpd",                { { OP_DREX4, q_mode } } },
-    { "pcmov",         { { OP_DREX4, q_mode } } },
-    { "pperm",         { { OP_DREX4, q_mode } } },
-    { "permps",                { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "permpd",                { { OP_DREX4, DREX_OC1 + q_mode } } },
-    { "pcmov",         { { OP_DREX4, DREX_OC1 + w_mode } } },
-    { "pperm",         { { OP_DREX4, DREX_OC1 + d_mode } } },
-    /* 28 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { "psignb",                { MX, EM } },
+    { "psignw",                { MX, EM } },
+    { "psignd",                { MX, EM } },
+    { "pmulhrsw",      { MX, EM } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 30 */
     { "(bad)",         { XX } },
+    /* 10 */
+    { PREFIX_TABLE (PREFIX_0F3810) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3814) },
+    { PREFIX_TABLE (PREFIX_0F3815) },
     { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3817) },
+    /* 18 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 38 */
     { "(bad)",         { XX } },
+    { "pabsb",         { MX, EM } },
+    { "pabsw",         { MX, EM } },
+    { "pabsd",         { MX, EM } },
     { "(bad)",         { XX } },
+    /* 20 */
+    { PREFIX_TABLE (PREFIX_0F3820) },
+    { PREFIX_TABLE (PREFIX_0F3821) },
+    { PREFIX_TABLE (PREFIX_0F3822) },
+    { PREFIX_TABLE (PREFIX_0F3823) },
+    { PREFIX_TABLE (PREFIX_0F3824) },
+    { PREFIX_TABLE (PREFIX_0F3825) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 28 */
+    { PREFIX_TABLE (PREFIX_0F3828) },
+    { PREFIX_TABLE (PREFIX_0F3829) },
+    { PREFIX_TABLE (PREFIX_0F382A) },
+    { PREFIX_TABLE (PREFIX_0F382B) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 30 */
+    { PREFIX_TABLE (PREFIX_0F3830) },
+    { PREFIX_TABLE (PREFIX_0F3831) },
+    { PREFIX_TABLE (PREFIX_0F3832) },
+    { PREFIX_TABLE (PREFIX_0F3833) },
+    { PREFIX_TABLE (PREFIX_0F3834) },
+    { PREFIX_TABLE (PREFIX_0F3835) },
+    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3837) },
+    /* 38 */
+    { PREFIX_TABLE (PREFIX_0F3838) },
+    { PREFIX_TABLE (PREFIX_0F3839) },
+    { PREFIX_TABLE (PREFIX_0F383A) },
+    { PREFIX_TABLE (PREFIX_0F383B) },
+    { PREFIX_TABLE (PREFIX_0F383C) },
+    { PREFIX_TABLE (PREFIX_0F383D) },
+    { PREFIX_TABLE (PREFIX_0F383E) },
+    { PREFIX_TABLE (PREFIX_0F383F) },
+    /* 40 */
+    { PREFIX_TABLE (PREFIX_0F3840) },
+    { PREFIX_TABLE (PREFIX_0F3841) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    /* 48 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 40 */
-    { "protb",         { { OP_DREX3, q_mode } } },
-    { "protw",         { { OP_DREX3, q_mode } } },
-    { "protd",         { { OP_DREX3, q_mode } } },
-    { "protq",         { { OP_DREX3, q_mode } } },
-    { "pshlb",         { { OP_DREX3, q_mode } } },
-    { "pshlw",         { { OP_DREX3, q_mode } } },
-    { "pshld",         { { OP_DREX3, q_mode } } },
-    { "pshlq",         { { OP_DREX3, q_mode } } },
-    /* 48 */
-    { "pshab",         { { OP_DREX3, q_mode } } },
-    { "pshaw",         { { OP_DREX3, q_mode } } },
-    { "pshad",         { { OP_DREX3, q_mode } } },
-    { "pshaq",         { { OP_DREX3, q_mode } } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5351,14 +5388,14 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 80 */
+    { PREFIX_TABLE (PREFIX_0F3880) },
+    { PREFIX_TABLE (PREFIX_0F3881) },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pmacssww",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacsswd",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacssdql",     { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
     /* 88 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5366,17 +5403,17 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pmacssdd",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacssdqh",     { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 90 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pmacsww",       { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacswd",       { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacsdql",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 98 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5384,8 +5421,8 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pmacsdd",       { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
-    { "pmacsdqh",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* a0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5393,7 +5430,7 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pmadcsswd",     { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* a8 */
     { "(bad)",         { XX } },
@@ -5411,7 +5448,7 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pmadcswd",      { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* b8 */
     { "(bad)",         { XX } },
@@ -5453,11 +5490,11 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F38DB) },
+    { PREFIX_TABLE (PREFIX_0F38DC) },
+    { PREFIX_TABLE (PREFIX_0F38DD) },
+    { PREFIX_TABLE (PREFIX_0F38DE) },
+    { PREFIX_TABLE (PREFIX_0F38DF) },
     /* e0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5477,8 +5514,8 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* f0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F38F0) },
+    { PREFIX_TABLE (PREFIX_0F38F1) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5495,7 +5532,7 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
   },
-  /* THREE_BYTE_0F25 */
+  /* THREE_BYTE_0F3A */
   {
     /* 00 */
     { "(bad)",         { XX } },
@@ -5507,23 +5544,23 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 08 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3A08) },
+    { PREFIX_TABLE (PREFIX_0F3A09) },
+    { PREFIX_TABLE (PREFIX_0F3A0A) },
+    { PREFIX_TABLE (PREFIX_0F3A0B) },
+    { PREFIX_TABLE (PREFIX_0F3A0C) },
+    { PREFIX_TABLE (PREFIX_0F3A0D) },
+    { PREFIX_TABLE (PREFIX_0F3A0E) },
+    { "palignr",       { MX, EM, Ib } },
     /* 10 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3A14) },
+    { PREFIX_TABLE (PREFIX_0F3A15) },
+    { PREFIX_TABLE (PREFIX_0F3A16) },
+    { PREFIX_TABLE (PREFIX_0F3A17) },
     /* 18 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5534,23 +5571,23 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 20 */
+    { PREFIX_TABLE (PREFIX_0F3A20) },
+    { PREFIX_TABLE (PREFIX_0F3A21) },
+    { PREFIX_TABLE (PREFIX_0F3A22) },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 28 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 28 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "comps",         { { OP_DREX3, q_mode }, { OP_DREX_FCMP, b_mode } } },
-    { "compd",         { { OP_DREX3, q_mode }, { OP_DREX_FCMP, b_mode } } },
-    { "comss",         { { OP_DREX3, w_mode }, { OP_DREX_FCMP, b_mode } } },
-    { "comsd",         { { OP_DREX3, d_mode }, { OP_DREX_FCMP, b_mode } } },
     /* 30 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5570,23 +5607,23 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 40 */
+    { PREFIX_TABLE (PREFIX_0F3A40) },
+    { PREFIX_TABLE (PREFIX_0F3A41) },
+    { PREFIX_TABLE (PREFIX_0F3A42) },
     { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3A44) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 48 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 48 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pcomb",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomw",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomd",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomq",         { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
     /* 50 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5606,23 +5643,23 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 60 */
+    { PREFIX_TABLE (PREFIX_0F3A60) },
+    { PREFIX_TABLE (PREFIX_0F3A61) },
+    { PREFIX_TABLE (PREFIX_0F3A62) },
+    { PREFIX_TABLE (PREFIX_0F3A63) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 68 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 68 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pcomub",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomuw",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomud",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
-    { "pcomuq",                { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
     /* 70 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5748,7 +5785,7 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_0F3ADF) },
     /* e0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5786,90 +5823,73 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
   },
-  /* THREE_BYTE_0F38 */
+
+  /* THREE_BYTE_0F7A */
   {
     /* 00 */
-    { "pshufb",                { MX, EM } },
-    { "phaddw",                { MX, EM } },
-    { "phaddd",                { MX, EM } },
-    { "phaddsw",       { MX, EM } },
-    { "pmaddubsw",     { MX, EM } },
-    { "phsubw",                { MX, EM } },
-    { "phsubd",                { MX, EM } },
-    { "phsubsw",       { MX, EM } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 08 */
-    { "psignb",                { MX, EM } },
-    { "psignw",                { MX, EM } },
-    { "psignd",                { MX, EM } },
-    { "pmulhrsw",      { MX, EM } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 10 */
-    { PREFIX_TABLE (PREFIX_0F3810) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_0F3814) },
-    { PREFIX_TABLE (PREFIX_0F3815) },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_0F3817) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 18 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "pabsb",         { MX, EM } },
-    { "pabsw",         { MX, EM } },
-    { "pabsd",         { MX, EM } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 20 */
-    { PREFIX_TABLE (PREFIX_0F3820) },
-    { PREFIX_TABLE (PREFIX_0F3821) },
-    { PREFIX_TABLE (PREFIX_0F3822) },
-    { PREFIX_TABLE (PREFIX_0F3823) },
-    { PREFIX_TABLE (PREFIX_0F3824) },
-    { PREFIX_TABLE (PREFIX_0F3825) },
+    { "ptest",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 28 */
-    { PREFIX_TABLE (PREFIX_0F3828) },
-    { PREFIX_TABLE (PREFIX_0F3829) },
-    { PREFIX_TABLE (PREFIX_0F382A) },
-    { PREFIX_TABLE (PREFIX_0F382B) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 30 */
-    { PREFIX_TABLE (PREFIX_0F3830) },
-    { PREFIX_TABLE (PREFIX_0F3831) },
-    { PREFIX_TABLE (PREFIX_0F3832) },
-    { PREFIX_TABLE (PREFIX_0F3833) },
-    { PREFIX_TABLE (PREFIX_0F3834) },
-    { PREFIX_TABLE (PREFIX_0F3835) },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_0F3837) },
-    /* 38 */
-    { PREFIX_TABLE (PREFIX_0F3838) },
-    { PREFIX_TABLE (PREFIX_0F3839) },
-    { PREFIX_TABLE (PREFIX_0F383A) },
-    { PREFIX_TABLE (PREFIX_0F383B) },
-    { PREFIX_TABLE (PREFIX_0F383C) },
-    { PREFIX_TABLE (PREFIX_0F383D) },
-    { PREFIX_TABLE (PREFIX_0F383E) },
-    { PREFIX_TABLE (PREFIX_0F383F) },
-    /* 40 */
-    { PREFIX_TABLE (PREFIX_0F3840) },
-    { PREFIX_TABLE (PREFIX_0F3841) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 48 */
+    { "(bad)",         { XX } },
+    /* 38 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5878,29 +5898,47 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 50 */
+    /* 40 */
+    { "(bad)",         { XX } },
+    { "phaddbw",       { XM, EXq } },
+    { "phaddbd",       { XM, EXq } },
+    { "phaddbq",       { XM, EXq } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "phaddwd",       { XM, EXq } },
+    { "phaddwq",       { XM, EXq } },
+    /* 48 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "phadddq",       { XM, EXq } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    /* 58 */
     { "(bad)",         { XX } },
+    /* 50 */
     { "(bad)",         { XX } },
+    { "phaddubw",      { XM, EXq } },
+    { "phaddubd",      { XM, EXq } },
+    { "phaddubq",      { XM, EXq } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "phadduwd",      { XM, EXq } },
+    { "phadduwq",      { XM, EXq } },
+    /* 58 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    { "phaddudq",      { XM, EXq } },
     { "(bad)",         { XX } },
-    /* 60 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
+    /* 60 */
     { "(bad)",         { XX } },
+    { "phsubbw",       { XM, EXq } },
+    { "phsubbd",       { XM, EXq } },
+    { "phsubbq",       { XM, EXq } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -5933,8 +5971,8 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 80 */
-    { PREFIX_TABLE (PREFIX_0F3880) },
-    { PREFIX_TABLE (PREFIX_0F3881) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6035,11 +6073,11 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_0F38DB) },
-    { PREFIX_TABLE (PREFIX_0F38DC) },
-    { PREFIX_TABLE (PREFIX_0F38DD) },
-    { PREFIX_TABLE (PREFIX_0F38DE) },
-    { PREFIX_TABLE (PREFIX_0F38DF) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* e0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6059,8 +6097,8 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* f0 */
-    { PREFIX_TABLE (PREFIX_0F38F0) },
-    { PREFIX_TABLE (PREFIX_0F38F1) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -6077,7 +6115,11 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
   },
-  /* THREE_BYTE_0F3A */
+};
+
+
+static const struct dis386 vex_table[][256] = {
+  /* VEX_0F */
   {
     /* 00 */
     { "(bad)",         { XX } },
@@ -6089,899 +6131,23 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 08 */
-    { PREFIX_TABLE (PREFIX_0F3A08) },
-    { PREFIX_TABLE (PREFIX_0F3A09) },
-    { PREFIX_TABLE (PREFIX_0F3A0A) },
-    { PREFIX_TABLE (PREFIX_0F3A0B) },
-    { PREFIX_TABLE (PREFIX_0F3A0C) },
-    { PREFIX_TABLE (PREFIX_0F3A0D) },
-    { PREFIX_TABLE (PREFIX_0F3A0E) },
-    { "palignr",       { MX, EM, Ib } },
-    /* 10 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_0F3A14) },
-    { PREFIX_TABLE (PREFIX_0F3A15) },
-    { PREFIX_TABLE (PREFIX_0F3A16) },
-    { PREFIX_TABLE (PREFIX_0F3A17) },
-    /* 18 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 20 */
-    { PREFIX_TABLE (PREFIX_0F3A20) },
-    { PREFIX_TABLE (PREFIX_0F3A21) },
-    { PREFIX_TABLE (PREFIX_0F3A22) },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 28 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 30 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 38 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 40 */
-    { PREFIX_TABLE (PREFIX_0F3A40) },
-    { PREFIX_TABLE (PREFIX_0F3A41) },
-    { PREFIX_TABLE (PREFIX_0F3A42) },
-    { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_0F3A44) },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 48 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 50 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 58 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 60 */
-    { PREFIX_TABLE (PREFIX_0F3A60) },
-    { PREFIX_TABLE (PREFIX_0F3A61) },
-    { PREFIX_TABLE (PREFIX_0F3A62) },
-    { PREFIX_TABLE (PREFIX_0F3A63) },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 68 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 70 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 78 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 80 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 88 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 90 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 98 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* a0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* a8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* b0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* b8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* c0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* c8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* d0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* d8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { PREFIX_TABLE (PREFIX_0F3ADF) },
-    /* e0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* e8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* f0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* f8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-  },
-  /* THREE_BYTE_0F7A */
-  {
-    /* 00 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 08 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 10 */
-    { "frczps",                { XM, EXq } },
-    { "frczpd",                { XM, EXq } },
-    { "frczss",                { XM, EXq } },
-    { "frczsd",                { XM, EXq } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 18 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 20 */
-    { "ptest",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 28 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 30 */
-    { "cvtph2ps",      { XM, EXd } },
-    { "cvtps2ph",      { EXd, XM } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 38 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 40 */
-    { "(bad)",         { XX } },
-    { "phaddbw",       { XM, EXq } },
-    { "phaddbd",       { XM, EXq } },
-    { "phaddbq",       { XM, EXq } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "phaddwd",       { XM, EXq } },
-    { "phaddwq",       { XM, EXq } },
-    /* 48 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "phadddq",       { XM, EXq } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 50 */
-    { "(bad)",         { XX } },
-    { "phaddubw",      { XM, EXq } },
-    { "phaddubd",      { XM, EXq } },
-    { "phaddubq",      { XM, EXq } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "phadduwd",      { XM, EXq } },
-    { "phadduwq",      { XM, EXq } },
-    /* 58 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "phaddudq",      { XM, EXq } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 60 */
-    { "(bad)",         { XX } },
-    { "phsubbw",       { XM, EXq } },
-    { "phsubbd",       { XM, EXq } },
-    { "phsubbq",       { XM, EXq } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 68 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 70 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 78 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 80 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 88 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 90 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 98 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* a0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* a8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* b0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* b8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* c0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* c8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* d0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* d8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* e0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* e8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* f0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* f8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-  },
-  /* THREE_BYTE_0F7B */
-  {
-    /* 00 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 08 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 10 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 18 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 20 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 28 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 30 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 38 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 40 */
-    { "protb",         { XM, EXq, Ib } },
-    { "protw",         { XM, EXq, Ib } },
-    { "protd",         { XM, EXq, Ib } },
-    { "protq",         { XM, EXq, Ib } },
-    { "pshlb",         { XM, EXq, Ib } },
-    { "pshlw",         { XM, EXq, Ib } },
-    { "pshld",         { XM, EXq, Ib } },
-    { "pshlq",         { XM, EXq, Ib } },
-    /* 48 */
-    { "pshab",         { XM, EXq, Ib } },
-    { "pshaw",         { XM, EXq, Ib } },
-    { "pshad",         { XM, EXq, Ib } },
-    { "pshaq",         { XM, EXq, Ib } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 50 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 58 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 60 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 68 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 70 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 78 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 80 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 88 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 90 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* 98 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* a0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* a8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* b0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* b8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    /* c0 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(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) },
-    { "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 } },
+    /* 10 */
+    { PREFIX_TABLE (PREFIX_VEX_10) },
+    { PREFIX_TABLE (PREFIX_VEX_11) },
+    { PREFIX_TABLE (PREFIX_VEX_12) },
+    { MOD_TABLE (MOD_VEX_13) },
+    { "vunpcklpX",     { XM, Vex, EXx } },
+    { "vunpckhpX",     { XM, Vex, EXx } },
+    { PREFIX_TABLE (PREFIX_VEX_16) },
+    { MOD_TABLE (MOD_VEX_17) },
     /* 18 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7415,17 +6581,17 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3896) },
+    { PREFIX_TABLE (PREFIX_VEX_3897) },
     /* 98 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { 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 } },
@@ -7433,17 +6599,17 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_38A6) },
+    { PREFIX_TABLE (PREFIX_VEX_38A7) },
     /* a8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_38A8) },
+    { PREFIX_TABLE (PREFIX_VEX_38A9) },
+    { PREFIX_TABLE (PREFIX_VEX_38AA) },
+    { PREFIX_TABLE (PREFIX_VEX_38AB) },
+    { PREFIX_TABLE (PREFIX_VEX_38AC) },
+    { PREFIX_TABLE (PREFIX_VEX_38AD) },
+    { PREFIX_TABLE (PREFIX_VEX_38AE) },
+    { PREFIX_TABLE (PREFIX_VEX_38AF) },
     /* b0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7451,17 +6617,17 @@ static const struct dis386 vex_table[][256] = {
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_38B6) },
+    { PREFIX_TABLE (PREFIX_VEX_38B7) },
     /* b8 */
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_38B8) },
+    { PREFIX_TABLE (PREFIX_VEX_38B9) },
+    { PREFIX_TABLE (PREFIX_VEX_38BA) },
+    { PREFIX_TABLE (PREFIX_VEX_38BB) },
+    { PREFIX_TABLE (PREFIX_VEX_38BC) },
+    { PREFIX_TABLE (PREFIX_VEX_38BD) },
+    { PREFIX_TABLE (PREFIX_VEX_38BE) },
+    { PREFIX_TABLE (PREFIX_VEX_38BF) },
     /* c0 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7614,13 +6780,13 @@ static const struct dis386 vex_table[][256] = {
     { PREFIX_TABLE (PREFIX_VEX_3A41) },
     { PREFIX_TABLE (PREFIX_VEX_3A42) },
     { "(bad)",         { XX } },
-    { "(bad)",         { XX } },
+    { PREFIX_TABLE (PREFIX_VEX_3A44) },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
     /* 48 */
-    { PREFIX_TABLE (PREFIX_VEX_3A48) },
-    { PREFIX_TABLE (PREFIX_VEX_3A49) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     { PREFIX_TABLE (PREFIX_VEX_3A4A) },
     { PREFIX_TABLE (PREFIX_VEX_3A4B) },
     { PREFIX_TABLE (PREFIX_VEX_3A4C) },
@@ -7641,10 +6807,10 @@ static const struct dis386 vex_table[][256] = {
     { "(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) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 60 */
     { PREFIX_TABLE (PREFIX_VEX_3A60) },
     { PREFIX_TABLE (PREFIX_VEX_3A61) },
@@ -7655,14 +6821,14 @@ static const struct dis386 vex_table[][256] = {
     { "(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) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 70 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7673,14 +6839,14 @@ static const struct dis386 vex_table[][256] = {
     { "(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) },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
+    { "(bad)",         { XX } },
     /* 80 */
     { "(bad)",         { XX } },
     { "(bad)",         { XX } },
@@ -7843,13 +7009,13 @@ static const struct dis386 vex_len_table[][2] = {
 
   /* VEX_LEN_11_P_1 */
   {
-    { "vmovss",                { EXdVex, Vex128, XM } },
+    { "vmovss",                { EXdVexS, Vex128, XM } },
     { "(bad)",         { XX } },
   },
 
   /* VEX_LEN_11_P_3 */
   {
-    { "vmovsd",                { EXqVex, Vex128, XM } },
+    { "vmovsd",                { EXqVexS, Vex128, XM } },
     { "(bad)",         { XX } },
   },
 
@@ -7913,12 +7079,6 @@ static const struct dis386 vex_len_table[][2] = {
     { "(bad)",         { XX } },
   },
 
-  /* VEX_LEN_2B_M_0 */
-  {
-    { "vmovntpX",      { Mx, XM } },
-    { "(bad)",         { XX } },
-  },
-
   /* VEX_LEN_2C_P_1 */
   {
     { "vcvttss2siY",   { Gv, EXd } },
@@ -8435,12 +7595,6 @@ static const struct dis386 vex_len_table[][2] = {
     { "(bad)",         { XX } },
   },
 
-  /* VEX_LEN_E7_P_2_M_0 */
-  {
-    { "vmovntdq",      { Mx, XM } },
-    { "(bad)",         { XX } },
-  },
-
   /* VEX_LEN_E8_P_2 */
   {
     { "vpsubsb",       { XM, Vex128, EXx } },
@@ -8963,6 +8117,12 @@ static const struct dis386 vex_len_table[][2] = {
     { "(bad)",         { XX } },
   },
 
+  /* VEX_LEN_3A44_P_2 */
+  {
+    { "vpclmulqdq",    { XM, Vex128, EXx, PCLMUL } },
+    { "(bad)",         { XX } },
+  },
+
   /* VEX_LEN_3A4C_P_2 */
   {
     { "vpblendvb",     { XM, Vex128, EXx, XMVexI4 } },
@@ -8993,54 +8153,6 @@ static const struct dis386 vex_len_table[][2] = {
     { "(bad)",         { XX } },
   },
 
-  /* VEX_LEN_3A6A_P_2 */
-  {
-    { "vfmaddss",      { XMVexW, Vex128FMA, EXdVexW, EXdVexW, VexI4 } },
-    { "(bad)",         { XX } },
-  },
-
-  /* VEX_LEN_3A6B_P_2 */
-  {
-    { "vfmaddsd",      { XMVexW, Vex128FMA, EXqVexW, EXqVexW, VexI4 } },
-    { "(bad)",         { XX } },
-  },
-
-  /* VEX_LEN_3A6E_P_2 */
-  {
-    { "vfmsubss",      { XMVexW, Vex128FMA, EXdVexW, EXdVexW, VexI4 } },
-    { "(bad)",         { XX } },
-  },
-
-  /* VEX_LEN_3A6F_P_2 */
-  {
-    { "vfmsubsd",      { XMVexW, Vex128FMA, EXqVexW, EXqVexW, VexI4 } },
-    { "(bad)",         { XX } },
-  },
-
-  /* VEX_LEN_3A7A_P_2 */
-  {
-    { "vfnmaddss",     { XMVexW, Vex128FMA, EXdVexW, EXdVexW, VexI4 } },
-    { "(bad)",         { XX } },
-  },
-
-  /* VEX_LEN_3A7B_P_2 */
-  {
-    { "vfnmaddsd",     { XMVexW, Vex128FMA, EXqVexW, EXqVexW, VexI4 } },
-    { "(bad)",         { XX } },
-  },
-
-  /* VEX_LEN_3A7E_P_2 */
-  {
-    { "vfnmsubss",     { XMVexW, Vex128FMA, EXdVexW, EXdVexW, VexI4 } },
-    { "(bad)",         { XX } },
-  },
-
-  /* VEX_LEN_3A7F_P_2 */
-  {
-    { "vfnmsubsd",     { XMVexW, Vex128FMA, EXqVexW, EXqVexW, VexI4 } },
-    { "(bad)",         { XX } },
-  },
-
   /* VEX_LEN_3ADF_P_2 */
   {
     { "vaeskeygenassist", { XM, EXx, Ib } },
@@ -9141,7 +8253,7 @@ static const struct dis386 mod_table[][2] = {
   },
   {
     /* MOD_0F24 */
-    { THREE_BYTE_TABLE (THREE_BYTE_0F24) },
+    { "(bad)",         { XX } },    
     { "movL",          { Rd, Td } },
   },
   {
@@ -9346,7 +8458,7 @@ static const struct dis386 mod_table[][2] = {
   },
   {
     /* MOD_VEX_2B */
-    { VEX_LEN_TABLE (VEX_LEN_2B_M_0) },
+    { "vmovntpX",      { Mx, XM } },
     { "(bad)",         { XX } },
   },
   {
@@ -9421,7 +8533,7 @@ static const struct dis386 mod_table[][2] = {
   },
   {
     /* MOD_VEX_E7_PREFIX_2 */
-    { VEX_LEN_TABLE (VEX_LEN_E7_P_2_M_0) },
+    { "vmovntdq",      { Mx, XM } },
     { "(bad)",         { XX } },
   },
   {
@@ -10032,8 +9144,7 @@ get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
       break;
 
     default:
-      oappend (INTERNAL_DISASSEMBLER_ERROR);
-      return NULL;
+      abort ();
     }
 
   if (dp->name != NULL)
@@ -10240,6 +9351,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
     }
 
   op = 0;
+
   if (*codep == 0x0f)
     {
       unsigned char threebyte;
@@ -11192,21 +10304,35 @@ case_Q:
            }
          break;
        case 'W':
-         /* operand size flag for cwtl, cbtw */
-         USED_REX (REX_W);
-         if (rex & REX_W)
+         if (l == 0 && len == 1)
            {
-             if (intel_syntax)
-               *obufp++ = 'd';
+             /* operand size flag for cwtl, cbtw */
+             USED_REX (REX_W);
+             if (rex & REX_W)
+               {
+                 if (intel_syntax)
+                   *obufp++ = 'd';
+                 else
+                   *obufp++ = 'l';
+               }
+             else if (sizeflag & DFLAG)
+               *obufp++ = 'w';
              else
-               *obufp++ = 'l';
+               *obufp++ = 'b';
+             if (!(rex & REX_W))
+               used_prefixes |= (prefixes & PREFIX_DATA);
            }
-         else if (sizeflag & DFLAG)
-           *obufp++ = 'w';
          else
-           *obufp++ = 'b';
-         if (!(rex & REX_W))
-           used_prefixes |= (prefixes & PREFIX_DATA);
+           {
+             if (l != 1 || len != 2 || last[0] != 'X')
+               {
+                 SAVE_LAST (*p);
+                 break;
+               }
+             if (!need_vex)
+               abort ();
+             *obufp++ = vex.w ? 'd': 's';
+           }
          break;
        }
       alt = 0;
@@ -11415,6 +10541,7 @@ intel_operand_size (int bytemode, int sizeflag)
       used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     case d_mode:
+    case d_swap_mode:
     case dqd_mode:
       oappend ("DWORD PTR ");
       break;
@@ -11495,6 +10622,15 @@ intel_operand_size (int bytemode, int sizeflag)
     case o_mode:
       oappend ("OWORD PTR ");
       break;
+    case vex_w_dq_mode:
+      if (!need_vex)
+       abort ();
+
+      if (vex.w)
+       oappend ("QWORD PTR ");
+      else
+       oappend ("DWORD PTR ");
+      break;
     default:
       break;
     }
@@ -11572,7 +10708,7 @@ OP_E_register (int bytemode, int sizeflag)
 }
 
 static void
-OP_E_memory (int bytemode, int sizeflag, int has_drex)
+OP_E_memory (int bytemode, int sizeflag)
 {
   bfd_vma disp = 0;
   int add = (rex & REX_B) ? 8 : 0;
@@ -11615,14 +10751,6 @@ OP_E_memory (int bytemode, int sizeflag, int has_drex)
        }
       rbase = base + add;
 
-      /* If we have a DREX byte, skip it now 
-        (it has already been handled) */
-      if (has_drex)
-       {
-         FETCH_DATA (the_info, codep + 1);
-         codep++;
-       }
-
       switch (modrm.mod)
        {
        case 0:
@@ -11832,7 +10960,7 @@ OP_E_memory (int bytemode, int sizeflag, int has_drex)
 }
 
 static void
-OP_E_extended (int bytemode, int sizeflag, int has_drex)
+OP_E_extended (int bytemode, int sizeflag)
 {
   /* Skip mod/rm byte.  */
   MODRM_CHECK;
@@ -11841,13 +10969,13 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex)
   if (modrm.mod == 3)
     OP_E_register (bytemode, sizeflag);
   else
-    OP_E_memory (bytemode, sizeflag, has_drex);
+    OP_E_memory (bytemode, sizeflag);
 }
 
 static void
 OP_E (int bytemode, int sizeflag)
 {
-  OP_E_extended (bytemode, sizeflag, 0);
+  OP_E_extended (bytemode, sizeflag);
 }
 
 
@@ -12640,11 +11768,17 @@ static void
 OP_EX (int bytemode, int sizeflag)
 {
   int add;
+
+  /* Skip mod/rm byte.  */
+  MODRM_CHECK;
+  codep++;
+
   if (modrm.mod != 3)
     {
-      OP_E (bytemode, sizeflag);
+      OP_E_memory (bytemode, sizeflag);
       return;
     }
+
   USED_REX (REX_B);
   if (rex & REX_B)
     add = 8;
@@ -12652,12 +11786,11 @@ OP_EX (int bytemode, int sizeflag)
     add = 0;
 
   if ((sizeflag & SUFFIX_ALWAYS)
-      && (bytemode == x_swap_mode || bytemode == q_swap_mode))
+      && (bytemode == x_swap_mode
+         || bytemode == d_swap_mode
+         || bytemode == q_swap_mode))
     swap_operand ();
-
-  /* Skip mod/rm byte.  */
-  MODRM_CHECK;
-  codep++;
+
   if (need_vex
       && bytemode != xmm_mode
       && bytemode != xmmq_mode)
@@ -12916,694 +12049,163 @@ OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
       strcpy (op_out[0], op1_names[0]);
       strcpy (op_out[1], names[1]);
       strcpy (op_out[2], names[2]);
-      two_source_ops = 1;
-    }
-  /* Skip mod/rm byte.  */
-  MODRM_CHECK;
-  codep++;
-}
-
-static void
-BadOp (void)
-{
-  /* Throw away prefixes and 1st. opcode byte.  */
-  codep = insn_codep + 1;
-  oappend ("(bad)");
-}
-
-static void
-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 ";
-
-  switch (bytemode)
-    {
-    case al_reg:
-    case eAX_reg:
-    case indir_dx_reg:
-      OP_IMREG (bytemode, sizeflag);
-      break;
-    case eDI_reg:
-      OP_ESreg (bytemode, sizeflag);
-      break;
-    case eSI_reg:
-      OP_DSreg (bytemode, sizeflag);
-      break;
-    default:
-      abort ();
-      break;
-    }
-}
-
-static void
-CMPXCHG8B_Fixup (int bytemode, int sizeflag)
-{
-  USED_REX (REX_W);
-  if (rex & REX_W)
-    {
-      /* Change cmpxchg8b to cmpxchg16b.  */
-      char *p = mnemonicendp - 2;
-      mnemonicendp = stpcpy (p, "16b");
-      bytemode = o_mode;
-    }
-  OP_M (bytemode, sizeflag);
-}
-
-static void
-XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
-{
-  if (need_vex)
-    {
-      switch (vex.length)
-       {
-       case 128:
-         sprintf (scratchbuf, "%%xmm%d", reg);
-         break;
-       case 256:
-         sprintf (scratchbuf, "%%ymm%d", reg);
-         break;
-       default:
-         abort ();
-       }
-    }
-  else
-    sprintf (scratchbuf, "%%xmm%d", reg);
-  oappend (scratchbuf + intel_syntax);
-}
-
-static void
-CRC32_Fixup (int bytemode, int sizeflag)
-{
-  /* Add proper suffix to "crc32".  */
-  char *p = mnemonicendp;
-
-  switch (bytemode)
-    {
-    case b_mode:
-      if (intel_syntax)
-       goto skip;
-
-      *p++ = 'b';
-      break;
-    case v_mode:
-      if (intel_syntax)
-       goto skip;
-
-      USED_REX (REX_W);
-      if (rex & REX_W)
-       *p++ = 'q';
-      else if (sizeflag & DFLAG)
-       *p++ = 'l';
-      else
-       *p++ = 'w';
-      used_prefixes |= (prefixes & PREFIX_DATA);
-      break;
-    default:
-      oappend (INTERNAL_DISASSEMBLER_ERROR);
-      break;
-    }
-  mnemonicendp = p;
-  *p = '\0';
-
-skip:
-  if (modrm.mod == 3)
-    {
-      int add;
-
-      /* Skip mod/rm byte.  */
-      MODRM_CHECK;
-      codep++;
-
-      USED_REX (REX_B);
-      add = (rex & REX_B) ? 8 : 0;
-      if (bytemode == b_mode)
-       {
-         USED_REX (0);
-         if (rex)
-           oappend (names8rex[modrm.rm + add]);
-         else
-           oappend (names8[modrm.rm + add]);
-       }
-      else
-       {
-         USED_REX (REX_W);
-         if (rex & REX_W)
-           oappend (names64[modrm.rm + add]);
-         else if ((prefixes & PREFIX_DATA))
-           oappend (names16[modrm.rm + add]);
-         else
-           oappend (names32[modrm.rm + add]);
-       }
-    }
-  else
-    OP_E (bytemode, sizeflag);
-}
-
-/* Print a DREX argument as either a register or memory operation.  */
-static void
-print_drex_arg (unsigned int reg, int bytemode, int sizeflag)
-{
-  if (reg == DREX_REG_UNKNOWN)
-    BadOp ();
-
-  else if (reg != DREX_REG_MEMORY)
-    {
-      sprintf (scratchbuf, "%%xmm%d", reg);
-      oappend (scratchbuf + intel_syntax);
-    }
-
-  else
-    OP_E_extended (bytemode, sizeflag, 1);
-}
-
-/* SSE5 instructions that have 4 arguments are encoded as:
-   0f 24 <sub-opcode> <modrm> <optional-sib> <drex> <offset>.
-
-   The <sub-opcode> byte has 1 bit (0x4) that is combined with 1 bit in
-   the DREX field (0x8) to determine how the arguments are laid out.  
-   The destination register must be the same register as one of the 
-   inputs, and it is encoded in the DREX byte.  No REX prefix is used 
-   for these instructions, since the DREX field contains the 3 extension
-   bits provided by the REX prefix.
-
-   The bytemode argument adds 2 extra bits for passing extra information:
-       DREX_OC1        -- Set the OC1 bit to indicate dest == 1st arg
-       DREX_NO_OC0     -- OC0 in DREX is invalid 
-       (but pretend it is set).  */
-
-static void
-OP_DREX4 (int flag_bytemode, int sizeflag)
-{
-  unsigned int drex_byte;
-  unsigned int regs[4];
-  unsigned int modrm_regmem;
-  unsigned int modrm_reg;
-  unsigned int drex_reg;
-  int bytemode;
-  int rex_save = rex;
-  int rex_used_save = rex_used;
-  int has_sib = 0;
-  int oc1 = (flag_bytemode & DREX_OC1) ? 2 : 0;
-  int oc0;
-  int i;
-
-  bytemode = flag_bytemode & ~ DREX_MASK;
-
-  for (i = 0; i < 4; i++)
-    regs[i] = DREX_REG_UNKNOWN;
-
-  /* Determine if we have a SIB byte in addition to MODRM before the 
-     DREX byte.  */
-  if (((sizeflag & AFLAG) || address_mode == mode_64bit)
-      && (modrm.mod != 3)
-      && (modrm.rm == 4))
-    has_sib = 1;
-
-  /* Get the DREX byte.  */
-  FETCH_DATA (the_info, codep + 2 + has_sib);
-  drex_byte = codep[has_sib+1];
-  drex_reg = DREX_XMM (drex_byte);
-  modrm_reg = modrm.reg + ((drex_byte & REX_R) ? 8 : 0);
-
-  /* Is OC0 legal?  If not, hardwire oc0 == 1.  */
-  if (flag_bytemode & DREX_NO_OC0)
-    {
-      oc0 = 1;
-      if (DREX_OC0 (drex_byte))
-       BadOp ();
-    }
-  else
-    oc0 = DREX_OC0 (drex_byte);
-
-  if (modrm.mod == 3)
-    {                  
-      /* regmem == register  */
-      modrm_regmem = modrm.rm + ((drex_byte & REX_B) ? 8 : 0);
-      rex = rex_used = 0;
-      /* skip modrm/drex since we don't call OP_E_extended  */
-      codep += 2;
-    }
-  else
-    {                  
-      /* regmem == memory, fill in appropriate REX bits  */
-      modrm_regmem = DREX_REG_MEMORY;
-      rex = drex_byte & (REX_B | REX_X | REX_R);
-      if (rex)
-       rex |= REX_OPCODE;
-      rex_used = rex;
-    }
-  
-  /* Based on the OC1/OC0 bits, lay out the arguments in the correct 
-     order.  */
-  switch (oc0 + oc1)
-    {
-    default:
-      BadOp ();
-      return;
-
-    case 0:
-      regs[0] = modrm_regmem;
-      regs[1] = modrm_reg;
-      regs[2] = drex_reg;
-      regs[3] = drex_reg;
-      break;
-
-    case 1:
-      regs[0] = modrm_reg;
-      regs[1] = modrm_regmem;
-      regs[2] = drex_reg;
-      regs[3] = drex_reg;
-      break;
-
-    case 2:
-      regs[0] = drex_reg;
-      regs[1] = modrm_regmem;
-      regs[2] = modrm_reg;
-      regs[3] = drex_reg;
-      break;
-
-    case 3:
-      regs[0] = drex_reg;
-      regs[1] = modrm_reg;
-      regs[2] = modrm_regmem;
-      regs[3] = drex_reg;
-      break;
-    }
-
-  /* Print out the arguments.  */
-  for (i = 0; i < 4; i++)
-    {
-      int j = (intel_syntax) ? 3 - i : i;
-      if (i > 0)
-       {
-         *obufp++ = ',';
-         *obufp = '\0';
-       }
-
-      print_drex_arg (regs[j], bytemode, sizeflag);
-    }
-
-  rex = rex_save;
-  rex_used = rex_used_save;
-}
-
-/* SSE5 instructions that have 3 arguments, and are encoded as:
-   0f 24 <sub-opcode> <modrm> <optional-sib> <drex> <offset>   (or)
-   0f 25 <sub-opcode> <modrm> <optional-sib> <drex> <offset> <cmp-byte>
-
-   The DREX field has 1 bit (0x8) to determine how the arguments are 
-   laid out. The destination register is encoded in the DREX byte.  
-   No REX prefix is used for these instructions, since the DREX field 
-   contains the 3 extension bits provided by the REX prefix.  */
-
-static void
-OP_DREX3 (int flag_bytemode, int sizeflag)
-{
-  unsigned int drex_byte;
-  unsigned int regs[3];
-  unsigned int modrm_regmem;
-  unsigned int modrm_reg;
-  unsigned int drex_reg;
-  int bytemode;
-  int rex_save = rex;
-  int rex_used_save = rex_used;
-  int has_sib = 0;
-  int oc0;
-  int i;
-
-  bytemode = flag_bytemode & ~ DREX_MASK;
-
-  for (i = 0; i < 3; i++)
-    regs[i] = DREX_REG_UNKNOWN;
-
-  /* Determine if we have a SIB byte in addition to MODRM before the 
-     DREX byte.  */
-  if (((sizeflag & AFLAG) || address_mode == mode_64bit)
-      && (modrm.mod != 3)
-      && (modrm.rm == 4))
-    has_sib = 1;
-
-  /* Get the DREX byte.  */
-  FETCH_DATA (the_info, codep + 2 + has_sib);
-  drex_byte = codep[has_sib+1];
-  drex_reg = DREX_XMM (drex_byte);
-  modrm_reg = modrm.reg + ((drex_byte & REX_R) ? 8 : 0);
-
-  /* Is OC0 legal?  If not, hardwire oc0 == 0 */
-  oc0 = DREX_OC0 (drex_byte);
-  if ((flag_bytemode & DREX_NO_OC0) && oc0)
-    BadOp ();
-
-  if (modrm.mod == 3)
-    {                  
-      /* regmem == register */
-      modrm_regmem = modrm.rm + ((drex_byte & REX_B) ? 8 : 0);
-      rex = rex_used = 0;
-      /* skip modrm/drex since we don't call OP_E_extended.  */
-      codep += 2;
-    }
-  else
-    {                  
-      /* regmem == memory, fill in appropriate REX bits.  */
-      modrm_regmem = DREX_REG_MEMORY;
-      rex = drex_byte & (REX_B | REX_X | REX_R);
-      if (rex)
-       rex |= REX_OPCODE;
-      rex_used = rex;
-    }
-
-  /* Based on the OC1/OC0 bits, lay out the arguments in the correct 
-     order.  */
-  switch (oc0)
-    {
-    default:
-      BadOp ();
-      return;
-
-    case 0:
-      regs[0] = modrm_regmem;
-      regs[1] = modrm_reg;
-      regs[2] = drex_reg;
-      break;
-
-    case 1:
-      regs[0] = modrm_reg;
-      regs[1] = modrm_regmem;
-      regs[2] = drex_reg;
-      break;
-    }
-
-  /* Print out the arguments.  */
-  for (i = 0; i < 3; i++)
-    {
-      int j = (intel_syntax) ? 2 - i : i;
-      if (i > 0)
-       {
-         *obufp++ = ',';
-         *obufp = '\0';
-       }
-
-      print_drex_arg (regs[j], bytemode, sizeflag);
-    }
-
-  rex = rex_save;
-  rex_used = rex_used_save;
-}
-
-/* Emit a floating point comparison for comp<xx> instructions.  */
-
-static void
-OP_DREX_FCMP (int bytemode ATTRIBUTE_UNUSED, 
-             int sizeflag ATTRIBUTE_UNUSED)
-{
-  unsigned char byte;
-
-  static const char *const cmp_test[] = {
-    "eq",
-    "lt",
-    "le",
-    "unord",
-    "ne",
-    "nlt",
-    "nle",
-    "ord",
-    "ueq",
-    "ult",
-    "ule",
-    "false",
-    "une",
-    "unlt",
-    "unle",
-    "true"
-  };
-
-  FETCH_DATA (the_info, codep + 1);
-  byte = *codep & 0xff;
-
-  if (byte >= ARRAY_SIZE (cmp_test)
-      || obuf[0] != 'c'
-      || obuf[1] != 'o'
-      || obuf[2] != 'm')
-    {
-      /* The instruction isn't one we know about, so just append the 
-        extension byte as a numeric value.  */
-      OP_I (b_mode, 0);
-    }
-
-  else
-    {
-      sprintf (scratchbuf, "com%s%s", cmp_test[byte], obuf+3);
-      mnemonicendp = stpcpy (obuf, scratchbuf);
-      codep++;
+      two_source_ops = 1;
     }
+  /* Skip mod/rm byte.  */
+  MODRM_CHECK;
+  codep++;
 }
 
-/* Emit an integer point comparison for pcom<xx> instructions, 
-   rewriting the instruction to have the test inside of it.  */
-
 static void
-OP_DREX_ICMP (int bytemode ATTRIBUTE_UNUSED, 
-             int sizeflag ATTRIBUTE_UNUSED)
+BadOp (void)
 {
-  unsigned char byte;
-
-  static const char *const cmp_test[] = {
-    "lt",
-    "le",
-    "gt",
-    "ge",
-    "eq",
-    "ne",
-    "false",
-    "true"
-  };
-
-  FETCH_DATA (the_info, codep + 1);
-  byte = *codep & 0xff;
-
-  if (byte >= ARRAY_SIZE (cmp_test)
-      || obuf[0] != 'p'
-      || obuf[1] != 'c'
-      || obuf[2] != 'o'
-      || obuf[3] != 'm')
-    {
-      /* The instruction isn't one we know about, so just print the 
-        comparison test byte as a numeric value.  */
-      OP_I (b_mode, 0);
-    }
-
-  else
-    {
-      sprintf (scratchbuf, "pcom%s%s", cmp_test[byte], obuf+4);
-      mnemonicendp = stpcpy (obuf, scratchbuf);
-      codep++;
-    }
+  /* Throw away prefixes and 1st. opcode byte.  */
+  codep = insn_codep + 1;
+  oappend ("(bad)");
 }
 
-/* Display the destination register operand for instructions with
-   VEX. */
-
 static void
-OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
+REP_Fixup (int bytemode, int sizeflag)
 {
-  if (!need_vex)
-    abort ();
-
-  if (!need_vex_reg)
-    return;
+  /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
+     lods and stos.  */
+  if (prefixes & PREFIX_REPZ)
+    repz_prefix = "rep ";
 
-  switch (vex.length)
+  switch (bytemode)
     {
-    case 128:
-      switch (bytemode)
-       {
-       case vex_mode:
-       case vex128_mode:
-         break;
-       default:
-         abort ();
-         return;
-       }
-
-      sprintf (scratchbuf, "%%xmm%d", vex.register_specifier);
+    case al_reg:
+    case eAX_reg:
+    case indir_dx_reg:
+      OP_IMREG (bytemode, sizeflag);
       break;
-    case 256:
-      switch (bytemode)
-       {
-       case vex_mode:
-       case vex256_mode:
-         break;
-       default:
-         abort ();
-         return;
-       }
-
-      sprintf (scratchbuf, "%%ymm%d", vex.register_specifier);
+    case eDI_reg:
+      OP_ESreg (bytemode, sizeflag);
+      break;
+    case eSI_reg:
+      OP_DSreg (bytemode, sizeflag);
       break;
     default:
       abort ();
       break;
     }
-  oappend (scratchbuf + intel_syntax);
 }
 
-/* Get the VEX immediate byte without moving codep.  */
-
-static unsigned char
-get_vex_imm8 (int sizeflag)
+static void
+CMPXCHG8B_Fixup (int bytemode, int sizeflag)
 {
-  int bytes_before_imm = 0;
-
-  /* Skip mod/rm byte.   */
-  MODRM_CHECK;
-  codep++;
-
-  if (modrm.mod != 3)
+  USED_REX (REX_W);
+  if (rex & REX_W)
     {
-      /* There are SIB/displacement bytes.  */
-      if ((sizeflag & AFLAG) || address_mode == mode_64bit)
-       {
-         /* 32/64 bit address mode */
-         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;
-           }
-       }
-      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;
-           }
-       }
+      /* Change cmpxchg8b to cmpxchg16b.  */
+      char *p = mnemonicendp - 2;
+      mnemonicendp = stpcpy (p, "16b");
+      bytemode = o_mode;
     }
-
-  FETCH_DATA (the_info, codep + bytes_before_imm + 1);
-  return codep [bytes_before_imm];
+  OP_M (bytemode, sizeflag);
 }
 
 static void
-OP_EX_VexReg (int bytemode, int sizeflag, int reg)
+XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
 {
-  if (reg == -1 && modrm.mod != 3)
-    {
-      OP_E_memory (bytemode, sizeflag, 0);
-      return;
-    }
-  else
+  if (need_vex)
     {
-      if (reg == -1)
+      switch (vex.length)
        {
-         reg = modrm.rm;
-         USED_REX (REX_B);
-         if (rex & REX_B)
-           reg += 8;
+       case 128:
+         sprintf (scratchbuf, "%%xmm%d", reg);
+         break;
+       case 256:
+         sprintf (scratchbuf, "%%ymm%d", reg);
+         break;
+       default:
+         abort ();
        }
-      else if (reg > 7 && address_mode != mode_64bit)
-       BadOp ();
-    }
-
-  switch (vex.length)
-    {
-    case 128:
-      sprintf (scratchbuf, "%%xmm%d", reg);
-      break;
-    case 256:
-      sprintf (scratchbuf, "%%ymm%d", reg);
-      break;
-    default:
-      abort ();
     }
+  else
+    sprintf (scratchbuf, "%%xmm%d", reg);
   oappend (scratchbuf + intel_syntax);
 }
 
 static void
-OP_EX_VexImmW (int bytemode, int sizeflag)
+CRC32_Fixup (int bytemode, int sizeflag)
 {
-  int reg = -1;
-  static unsigned char vex_imm8;
+  /* Add proper suffix to "crc32".  */
+  char *p = mnemonicendp;
 
-  if (!vex_w_done)
-    {
-      vex_imm8 = get_vex_imm8 (sizeflag);
-      if (vex.w)
-       reg = vex_imm8 >> 4;
-      vex_w_done = 1;
-    }
-  else
+  switch (bytemode)
     {
-      if (!vex.w)
-       reg = vex_imm8 >> 4;
-    }
+    case b_mode:
+      if (intel_syntax)
+       goto skip;
 
-  OP_EX_VexReg (bytemode, sizeflag, reg);
-}
+      *p++ = 'b';
+      break;
+    case v_mode:
+      if (intel_syntax)
+       goto skip;
 
-static void
-OP_EX_VexW (int bytemode, int sizeflag)
-{
-  int reg = -1;
+      USED_REX (REX_W);
+      if (rex & REX_W)
+       *p++ = 'q';
+      else if (sizeflag & DFLAG)
+       *p++ = 'l';
+      else
+       *p++ = 'w';
+      used_prefixes |= (prefixes & PREFIX_DATA);
+      break;
+    default:
+      oappend (INTERNAL_DISASSEMBLER_ERROR);
+      break;
+    }
+  mnemonicendp = p;
+  *p = '\0';
 
-  if (!vex_w_done)
+skip:
+  if (modrm.mod == 3)
     {
-      vex_w_done = 1;
-      if (vex.w)
-       reg = vex.register_specifier;
+      int add;
+
+      /* Skip mod/rm byte.  */
+      MODRM_CHECK;
+      codep++;
+
+      USED_REX (REX_B);
+      add = (rex & REX_B) ? 8 : 0;
+      if (bytemode == b_mode)
+       {
+         USED_REX (0);
+         if (rex)
+           oappend (names8rex[modrm.rm + add]);
+         else
+           oappend (names8[modrm.rm + add]);
+       }
+      else
+       {
+         USED_REX (REX_W);
+         if (rex & REX_W)
+           oappend (names64[modrm.rm + add]);
+         else if ((prefixes & PREFIX_DATA))
+           oappend (names16[modrm.rm + add]);
+         else
+           oappend (names32[modrm.rm + add]);
+       }
     }
   else
-    {
-      if (!vex.w)
-       reg = vex.register_specifier;
-    }
-
-  OP_EX_VexReg (bytemode, sizeflag, reg);
+    OP_E (bytemode, sizeflag);
 }
 
+/* Display the destination register operand for instructions with
+   VEX. */
+
 static void
-OP_VEX_FMA (int bytemode, int sizeflag)
+OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
 {
-  int reg = get_vex_imm8 (sizeflag) >> 4;
+  if (!need_vex)
+    abort ();
 
-  if (reg > 7 && address_mode != mode_64bit)
-    BadOp ();
+  if (!need_vex_reg)
+    return;
 
   switch (vex.length)
     {
@@ -13618,36 +12220,28 @@ OP_VEX_FMA (int bytemode, int sizeflag)
          return;
        }
 
-      sprintf (scratchbuf, "%%xmm%d", reg);
+      sprintf (scratchbuf, "%%xmm%d", vex.register_specifier);
       break;
     case 256:
       switch (bytemode)
        {
        case vex_mode:
+       case vex256_mode:
          break;
        default:
          abort ();
          return;
        }
 
-      sprintf (scratchbuf, "%%ymm%d", reg);
+      sprintf (scratchbuf, "%%ymm%d", vex.register_specifier);
       break;
     default:
       abort ();
+      break;
     }
   oappend (scratchbuf + intel_syntax);
 }
 
-static void
-VEXI4_Fixup (int bytemode ATTRIBUTE_UNUSED,
-            int sizeflag ATTRIBUTE_UNUSED)
-{
-  /* Skip the immediate byte and check for invalid bits.  */
-  FETCH_DATA (the_info, codep + 1);
-  if (*codep++ & 0xf)
-    BadOp ();
-}
-
 static void
 OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
 {
@@ -13679,15 +12273,6 @@ OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
   oappend (scratchbuf + intel_syntax);
 }
 
-static void
-OP_XMM_VexW (int bytemode, int sizeflag)
-{
-  /* Turn off the REX.W bit since it is used for swapping operands
-     now.  */
-  rex &= ~REX_W;
-  OP_XMM (bytemode, sizeflag);
-}
-
 static void
 OP_EX_Vex (int bytemode, int sizeflag)
 {
@@ -13839,43 +12424,6 @@ PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED,
     }
 }
 
-static const struct op vpermil2_op[] =
-{
-  { STRING_COMMA_LEN ("td") },
-  { STRING_COMMA_LEN ("td") },
-  { STRING_COMMA_LEN ("mo") },
-  { STRING_COMMA_LEN ("mz") }
-};
-
-static void
-VPERMIL2_Fixup (int bytemode ATTRIBUTE_UNUSED,
-               int sizeflag ATTRIBUTE_UNUSED)
-{
-  unsigned int vpermil2_type;
-
-  FETCH_DATA (the_info, codep + 1);
-  vpermil2_type = *codep++ & 0xf;
-  if (vpermil2_type < ARRAY_SIZE (vpermil2_op))
-    {
-      char suffix [4];
-      char *p = mnemonicendp - 3;
-      suffix[0] = p[0];
-      suffix[1] = p[1];
-      suffix[2] = p[2];
-      suffix[3] = '\0';
-      sprintf (p, "%s%s", vpermil2_op[vpermil2_type].name, suffix);
-      mnemonicendp += vpermil2_op[vpermil2_type].len;
-    }
-  else
-    {
-      /* We have a reserved extension byte.  Output it directly.  */
-      scratchbuf[0] = '$';
-      print_operand_value (scratchbuf + 1, 1, vpermil2_type);
-      oappend (scratchbuf + intel_syntax);
-      scratchbuf[0] = '\0';
-    }
-}
-
 static void
 MOVBE_Fixup (int bytemode, int sizeflag)
 {
This page took 0.090371 seconds and 4 git commands to generate.