2007-06-29 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / opcodes / i386-dis.c
index d0626dd200374a101c7dd7517d801097f56b5036..e84d31459535152b27d46237fbf7935fa5fa7c1d 100644 (file)
@@ -50,6 +50,7 @@ static void oappend (const char *);
 static void append_seg (void);
 static void OP_indirE (int, int);
 static void print_operand_value (char *, int, bfd_vma);
+static void print_displacement (char *, bfd_vma);
 static void OP_E (int, int);
 static void OP_G (int, int);
 static bfd_vma get64 (void);
@@ -98,6 +99,8 @@ static void BadOp (void);
 static void VMX_Fixup (int, int);
 static void REP_Fixup (int, int);
 static void CMPXCHG8B_Fixup (int, int);
+static void XMM_Fixup (int, int);
+static void CRC32_Fixup (int, int);
 
 struct dis_private {
   /* Points to first byte not fetched.  */
@@ -200,6 +203,8 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define Ed { OP_E, d_mode }
 #define Edq { OP_E, dq_mode }
 #define Edqw { OP_E, dqw_mode }
+#define Edqb { OP_E, dqb_mode }
+#define Edqd { OP_E, dqd_mode }
 #define indirEv { OP_indirE, stack_v_mode }
 #define indirEp { OP_indirE, f_mode }
 #define stackEv { OP_E, stack_v_mode }
@@ -301,7 +306,11 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define MX { OP_MMX, 0 }
 #define XM { OP_XMM, 0 }
 #define EM { OP_EM, v_mode }
-#define EX { OP_EX, v_mode }
+#define EMd { OP_EM, d_mode }
+#define EMq { OP_EM, q_mode }
+#define EXd { OP_EX, d_mode }
+#define EXq { OP_EX, q_mode }
+#define EXx { OP_EX, x_mode }
 #define MS { OP_MS, v_mode }
 #define XS { OP_XS, v_mode }
 #define EMC { OP_EMC, v_mode }
@@ -309,6 +318,7 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define VM { OP_VMX, q_mode }
 #define OPSUF { OP_3DNowSuffix, 0 }
 #define OPSIMD { OP_SIMD_Suffix, 0 }
+#define XMM0 { XMM_Fixup, 0 }
 
 /* Used handle "rep" prefix for string instructions.  */
 #define Xbr { REP_Fixup, eSI_reg }
@@ -345,6 +355,8 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define stack_v_mode 15 /* v_mode for stack-related opcodes.  */
 #define z_mode 16 /* non-quad operand size depends on prefixes */
 #define o_mode 17  /* 16-byte operand */
+#define dqb_mode 18 /* registers like dq_mode, memory like b_mode.  */
+#define dqd_mode 19 /* registers like dq_mode, memory like d_mode.  */
 
 #define es_reg 100
 #define cs_reg 101
@@ -468,6 +480,65 @@ fetch_data (struct disassemble_info *info, bfd_byte *addr)
 #define PREGRP36  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 36 } }
 #define PREGRP37  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 37 } }
 #define PREGRP38  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 38 } }
+#define PREGRP39  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 39 } }
+#define PREGRP40  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 40 } }
+#define PREGRP41  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 41 } }
+#define PREGRP42  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 42 } }
+#define PREGRP43  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 43 } }
+#define PREGRP44  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 44 } }
+#define PREGRP45  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 45 } }
+#define PREGRP46  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 46 } }
+#define PREGRP47  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 47 } }
+#define PREGRP48  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 48 } }
+#define PREGRP49  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 49 } }
+#define PREGRP50  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 50 } }
+#define PREGRP51  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 51 } }
+#define PREGRP52  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 52 } }
+#define PREGRP53  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 53 } }
+#define PREGRP54  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 54 } }
+#define PREGRP55  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 55 } }
+#define PREGRP56  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 56 } }
+#define PREGRP57  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 57 } }
+#define PREGRP58  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 58 } }
+#define PREGRP59  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 59 } }
+#define PREGRP60  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 60 } }
+#define PREGRP61  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 61 } }
+#define PREGRP62  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 62 } }
+#define PREGRP63  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 63 } }
+#define PREGRP64  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 64 } }
+#define PREGRP65  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 65 } }
+#define PREGRP66  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 66 } }
+#define PREGRP67  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 67 } }
+#define PREGRP68  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 68 } }
+#define PREGRP69  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 69 } }
+#define PREGRP70  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 70 } }
+#define PREGRP71  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 71 } }
+#define PREGRP72  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 72 } }
+#define PREGRP73  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 73 } }
+#define PREGRP74  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 74 } }
+#define PREGRP75  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 75 } }
+#define PREGRP76  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 76 } }
+#define PREGRP77  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 77 } }
+#define PREGRP78  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 78 } }
+#define PREGRP79  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 79 } }
+#define PREGRP80  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 80 } }
+#define PREGRP81  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 81 } }
+#define PREGRP82  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 82 } }
+#define PREGRP83  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 83 } }
+#define PREGRP84  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 84 } }
+#define PREGRP85  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 85 } }
+#define PREGRP86  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 86 } }
+#define PREGRP87  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 87 } }
+#define PREGRP88  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 88 } }
+#define PREGRP89  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 89 } }
+#define PREGRP90  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 90 } }
+#define PREGRP91  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 91 } }
+#define PREGRP92  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 92 } }
+#define PREGRP93  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 93 } }
+#define PREGRP94  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 94 } }
+#define PREGRP95  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 95 } }
+#define PREGRP96  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 96 } }
+#define PREGRP97  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 97 } }
 
 
 #define X86_64_0  NULL, { { NULL, X86_64_SPECIAL }, { NULL, 0 } }
@@ -503,6 +574,7 @@ struct dis386 {
    'I' => honor following macro letter even in Intel mode (implemented only
    .      for some of the macro letters)
    'J' => print 'l'
+   'K' => print 'd' or 'q' if rex prefix is present.
    'L' => print 'l' if suffix_always is true
    'N' => print 'n' if instruction has no wait "prefix"
    'O' => print 'd' or 'o' (or 'q' in Intel mode)
@@ -843,11 +915,11 @@ static const struct dis386 dis386_twobyte[] = {
   { PREGRP8 },
   { PREGRP9 },
   { PREGRP30 },
-  { "movlpX",          { EX, XM, { SIMD_Fixup, 'h' } } },
-  { "unpcklpX",                { XM, EX } },
-  { "unpckhpX",                { XM, EX } },
+  { "movlpX",          { EXq, XM, { SIMD_Fixup, 'h' } } },
+  { "unpcklpX",                { XM, EXq } },
+  { "unpckhpX",                { XM, EXq } },
   { PREGRP31 },
-  { "movhpX",          { EX, XM, { SIMD_Fixup, 'l' } } },
+  { "movhpX",          { EXq, XM, { SIMD_Fixup, 'l' } } },
   /* 18 */
   { GRP16 },
   { "(bad)",           { XX } },
@@ -867,14 +939,14 @@ static const struct dis386 dis386_twobyte[] = {
   { "movL",            { Td, Rd } },
   { "(bad)",           { XX } },
   /* 28 */
-  { "movapX",          { XM, EX } },
-  { "movapX",          { EX, XM } },
+  { "movapX",          { XM, EXx } },
+  { "movapX",          { EXx,  XM } },
   { PREGRP2 },
   { PREGRP33 },
   { PREGRP4 },
   { PREGRP3 },
-  { "ucomisX",         { XM,EX } },
-  { "comisX",          { XM,EX } },
+  { PREGRP93 },
+  { PREGRP94 },
   /* 30 */
   { "wrmsr",           { XX } },
   { "rdtsc",           { XX } },
@@ -916,10 +988,10 @@ static const struct dis386 dis386_twobyte[] = {
   { PREGRP13 },
   { PREGRP12 },
   { PREGRP11 },
-  { "andpX",           { XM, EX } },
-  { "andnpX",          { XM, EX } },
-  { "orpX",            { XM, EX } },
-  { "xorpX",           { XM, EX } },
+  { "andpX",           { XM, EXx } },
+  { "andnpX",          { XM, EXx } },
+  { "orpX",            { XM, EXx } },
+  { "xorpX",           { XM, EXx } },
   /* 58 */
   { PREGRP0 },
   { PREGRP10 },
@@ -930,9 +1002,9 @@ static const struct dis386 dis386_twobyte[] = {
   { PREGRP5 },
   { PREGRP6 },
   /* 60 */
-  { "punpcklbw",       { MX, EM } },
-  { "punpcklwd",       { MX, EM } },
-  { "punpckldq",       { MX, EM } },
+  { PREGRP95 },
+  { PREGRP96 },
+  { PREGRP97 },
   { "packsswb",                { MX, EM } },
   { "pcmpgtb",         { MX, EM } },
   { "pcmpgtw",         { MX, EM } },
@@ -1044,7 +1116,7 @@ static const struct dis386 dis386_twobyte[] = {
   { "movntiS",         { Ev, Gv } },
   { "pinsrw",          { MX, Edqw, Ib } },
   { "pextrw",          { Gdq, MS, Ib } },
-  { "shufpX",          { XM, EX, Ib } },
+  { "shufpX",          { XM, EXx, Ib } },
   { GRP9 },
   /* c8 */
   { "bswap",           { RMeAX } },
@@ -1226,15 +1298,15 @@ static const unsigned char twobyte_uses_REPZ_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
 };
 
-/* This is used to determine if opcode 0f 38 XX uses DATA prefix.  */ 
+/* This is used to determine if opcode 0f 38 XX uses DATA prefix.  */
 static const unsigned char threebyte_0x38_uses_DATA_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
   /*       -------------------------------        */
   /* 00 */ 1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0, /* 0f */
-  /* 10 */ 0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0, /* 1f */
-  /* 20 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 2f */
-  /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */
-  /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */
+  /* 10 */ 1,0,0,0,1,1,0,1,0,0,0,0,1,1,1,0, /* 1f */
+  /* 20 */ 1,1,1,1,1,1,0,0,1,1,1,1,0,0,0,0, /* 2f */
+  /* 30 */ 1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1, /* 3f */
+  /* 40 */ 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */
   /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 5f */
   /* 60 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 6f */
   /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 7f */
@@ -1250,7 +1322,7 @@ static const unsigned char threebyte_0x38_uses_DATA_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
 };
 
-/* This is used to determine if opcode 0f 38 XX uses REPNZ prefix.  */ 
+/* This is used to determine if opcode 0f 38 XX uses REPNZ prefix.  */
 static const unsigned char threebyte_0x38_uses_REPNZ_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
   /*       -------------------------------        */
@@ -1269,12 +1341,12 @@ static const unsigned char threebyte_0x38_uses_REPNZ_prefix[256] = {
   /* c0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */
   /* d0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* df */
   /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ef */
-  /* f0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ff */
+  /* f0 */ 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ff */
   /*       -------------------------------        */
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
 };
 
-/* This is used to determine if opcode 0f 38 XX uses REPZ prefix.  */ 
+/* This is used to determine if opcode 0f 38 XX uses REPZ prefix.  */
 static const unsigned char threebyte_0x38_uses_REPZ_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
   /*       -------------------------------        */
@@ -1298,17 +1370,17 @@ static const unsigned char threebyte_0x38_uses_REPZ_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
 };
 
-/* This is used to determine if opcode 0f 3a XX uses DATA prefix.  */ 
+/* This is used to determine if opcode 0f 3a XX uses DATA prefix.  */
 static const unsigned char threebyte_0x3a_uses_DATA_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
   /*       -------------------------------        */
-  /* 00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, /* 0f */
-  /* 10 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1f */
-  /* 20 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 2f */
+  /* 00 */ 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1, /* 0f */
+  /* 10 */ 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* 1f */
+  /* 20 */ 1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 2f */
   /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */
-  /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */
+  /* 40 */ 1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */
   /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 5f */
-  /* 60 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 6f */
+  /* 60 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0, /* 6f */
   /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 7f */
   /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
   /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 9f */
@@ -1322,7 +1394,7 @@ static const unsigned char threebyte_0x3a_uses_DATA_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
 };
 
-/* This is used to determine if opcode 0f 3a XX uses REPNZ prefix.  */ 
+/* This is used to determine if opcode 0f 3a XX uses REPNZ prefix.  */
 static const unsigned char threebyte_0x3a_uses_REPNZ_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
   /*       -------------------------------        */
@@ -1346,7 +1418,7 @@ static const unsigned char threebyte_0x3a_uses_REPNZ_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
 };
 
-/* This is used to determine if opcode 0f 3a XX uses REPZ prefix.  */ 
+/* This is used to determine if opcode 0f 3a XX uses REPZ prefix.  */
 static const unsigned char threebyte_0x3a_uses_REPZ_prefix[256] = {
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
   /*       -------------------------------        */
@@ -1380,8 +1452,8 @@ static disassemble_info *the_info;
 static struct
   {
     int mod;
-    int rm;
     int reg;
+    int rm;
   }
 modrm;
 static unsigned char need_modrm;
@@ -1765,17 +1837,17 @@ static const struct dis386 grps[][8] = {
 static const struct dis386 prefix_user_table[][4] = {
   /* PREGRP0 */
   {
-    { "addps", { XM, EX } },
-    { "addss", { XM, EX } },
-    { "addpd", { XM, EX } },
-    { "addsd", { XM, EX } },
+    { "addps", { XM, EXx } },
+    { "addss", { XM, EXd } },
+    { "addpd", { XM, EXx } },
+    { "addsd", { XM, EXq } },
   },
   /* PREGRP1 */
   {
-    { "", { XM, EX, OPSIMD } },        /* See OP_SIMD_SUFFIX.  */
-    { "", { XM, EX, OPSIMD } },
-    { "", { XM, EX, OPSIMD } },
-    { "", { XM, EX, OPSIMD } },
+    { "", { XM, EXx, OPSIMD } },       /* See OP_SIMD_SUFFIX.  */
+    { "", { XM, EXx, OPSIMD } },
+    { "", { XM, EXx, OPSIMD } },
+    { "", { XM, EXx, OPSIMD } },
   },
   /* PREGRP2 */
   {
@@ -1786,260 +1858,732 @@ static const struct dis386 prefix_user_table[][4] = {
   },
   /* PREGRP3 */
   {
-    { "cvtps2pi", { MXC, EX } },
-    { "cvtss2siY", { Gv, EX } },
-    { "cvtpd2pi", { MXC, EX } },
-    { "cvtsd2siY", { Gv, EX } },
+    { "cvtps2pi", { MXC, EXx } },
+    { "cvtss2siY", { Gv, EXx } },
+    { "cvtpd2pi", { MXC, EXx } },
+    { "cvtsd2siY", { Gv, EXx } },
   },
   /* PREGRP4 */
   {
-    { "cvttps2pi", { MXC, EX } },
-    { "cvttss2siY", { Gv, EX } },
-    { "cvttpd2pi", { MXC, EX } },
-    { "cvttsd2siY", { Gv, EX } },
+    { "cvttps2pi", { MXC, EXx } },
+    { "cvttss2siY", { Gv, EXx } },
+    { "cvttpd2pi", { MXC, EXx } },
+    { "cvttsd2siY", { Gv, EXx } },
   },
   /* PREGRP5 */
   {
-    { "divps", { XM, EX } },
-    { "divss", { XM, EX } },
-    { "divpd", { XM, EX } },
-    { "divsd", { XM, EX } },
+    { "divps", { XM, EXx } },
+    { "divss", { XM, EXx } },
+    { "divpd", { XM, EXx } },
+    { "divsd", { XM, EXx } },
   },
   /* PREGRP6 */
   {
-    { "maxps", { XM, EX } },
-    { "maxss", { XM, EX } },
-    { "maxpd", { XM, EX } },
-    { "maxsd", { XM, EX } },
+    { "maxps", { XM, EXx } },
+    { "maxss", { XM, EXx } },
+    { "maxpd", { XM, EXx } },
+    { "maxsd", { XM, EXx } },
   },
   /* PREGRP7 */
   {
-    { "minps", { XM, EX } },
-    { "minss", { XM, EX } },
-    { "minpd", { XM, EX } },
-    { "minsd", { XM, EX } },
+    { "minps", { XM, EXx } },
+    { "minss", { XM, EXx } },
+    { "minpd", { XM, EXx } },
+    { "minsd", { XM, EXx } },
   },
   /* PREGRP8 */
   {
-    { "movups",        { XM, EX } },
-    { "movss", { XM, EX } },
-    { "movupd",        { XM, EX } },
-    { "movsd", { XM, EX } },
+    { "movups",        { XM, EXx } },
+    { "movss", { XM, EXx } },
+    { "movupd",        { XM, EXx } },
+    { "movsd", { XM, EXx } },
   },
   /* PREGRP9 */
   {
-    { "movups",        { EX, XM } },
-    { "movss", { EX, XM } },
-    { "movupd",        { EX, XM } },
-    { "movsd", { EX, XM } },
+    { "movups",        { EXx,  XM } },
+    { "movss", { EXx,  XM } },
+    { "movupd",        { EXx,  XM } },
+    { "movsd", { EXx,  XM } },
   },
   /* PREGRP10 */
   {
-    { "mulps", { XM, EX } },
-    { "mulss", { XM, EX } },
-    { "mulpd", { XM, EX } },
-    { "mulsd", { XM, EX } },
+    { "mulps", { XM, EXx } },
+    { "mulss", { XM, EXx } },
+    { "mulpd", { XM, EXx } },
+    { "mulsd", { XM, EXx } },
   },
   /* PREGRP11 */
   {
-    { "rcpps", { XM, EX } },
-    { "rcpss", { XM, EX } },
-    { "(bad)", { XM, EX } },
-    { "(bad)", { XM, EX } },
+    { "rcpps", { XM, EXx } },
+    { "rcpss", { XM, EXx } },
+    { "(bad)", { XM, EXx } },
+    { "(bad)", { XM, EXx } },
   },
   /* PREGRP12 */
   {
-    { "rsqrtps",{ XM, EX } },
-    { "rsqrtss",{ XM, EX } },
-    { "(bad)", { XM, EX } },
-    { "(bad)", { XM, EX } },
+    { "rsqrtps",{ XM, EXx } },
+    { "rsqrtss",{ XM, EXx } },
+    { "(bad)", { XM, EXx } },
+    { "(bad)", { XM, EXx } },
   },
   /* PREGRP13 */
   {
-    { "sqrtps", { XM, EX } },
-    { "sqrtss", { XM, EX } },
-    { "sqrtpd", { XM, EX } },
-    { "sqrtsd",        { XM, EX } },
+    { "sqrtps", { XM, EXx } },
+    { "sqrtss", { XM, EXx } },
+    { "sqrtpd", { XM, EXx } },
+    { "sqrtsd",        { XM, EXx } },
   },
   /* PREGRP14 */
   {
-    { "subps", { XM, EX } },
-    { "subss", { XM, EX } },
-    { "subpd", { XM, EX } },
-    { "subsd", { XM, EX } },
+    { "subps", { XM, EXx } },
+    { "subss", { XM, EXx } },
+    { "subpd", { XM, EXx } },
+    { "subsd", { XM, EXx } },
   },
   /* PREGRP15 */
   {
-    { "(bad)", { XM, EX } },
-    { "cvtdq2pd", { XM, EX } },
-    { "cvttpd2dq", { XM, EX } },
-    { "cvtpd2dq", { XM, EX } },
+    { "(bad)", { XM, EXx } },
+    { "cvtdq2pd", { XM, EXq } },
+    { "cvttpd2dq", { XM, EXx } },
+    { "cvtpd2dq", { XM, EXx } },
   },
   /* PREGRP16 */
   {
-    { "cvtdq2ps", { XM, EX } },
-    { "cvttps2dq", { XM, EX } },
-    { "cvtps2dq", { XM, EX } },
-    { "(bad)", { XM, EX } },
+    { "cvtdq2ps", { XM, EXx } },
+    { "cvttps2dq", { XM, EXx } },
+    { "cvtps2dq", { XM, EXx } },
+    { "(bad)", { XM, EXx } },
   },
   /* PREGRP17 */
   {
-    { "cvtps2pd", { XM, EX } },
-    { "cvtss2sd", { XM, EX } },
-    { "cvtpd2ps", { XM, EX } },
-    { "cvtsd2ss", { XM, EX } },
+    { "cvtps2pd", { XM, EXq } },
+    { "cvtss2sd", { XM, EXx } },
+    { "cvtpd2ps", { XM, EXx } },
+    { "cvtsd2ss", { XM, EXx } },
   },
   /* PREGRP18 */
   {
     { "maskmovq", { MX, MS } },
-    { "(bad)", { XM, EX } },
+    { "(bad)", { XM, EXx } },
     { "maskmovdqu", { XM, XS } },
-    { "(bad)", { XM, EX } },
+    { "(bad)", { XM, EXx } },
   },
   /* PREGRP19 */
   {
     { "movq",  { MX, EM } },
-    { "movdqu",        { XM, EX } },
-    { "movdqa",        { XM, EX } },
-    { "(bad)", { XM, EX } },
+    { "movdqu",        { XM, EXx } },
+    { "movdqa",        { XM, EXx } },
+    { "(bad)", { XM, EXx } },
   },
   /* PREGRP20 */
   {
     { "movq",  { EM, MX } },
-    { "movdqu",        { EX, XM } },
-    { "movdqa",        { EX, XM } },
-    { "(bad)", { EX, XM } },
+    { "movdqu",        { EXx,  XM } },
+    { "movdqa",        { EXx,  XM } },
+    { "(bad)", { EXx,  XM } },
   },
   /* PREGRP21 */
   {
-    { "(bad)", { EX, XM } },
+    { "(bad)", { EXx,  XM } },
     { "movq2dq",{ XM, MS } },
-    { "movq",  { EX, XM } },
+    { "movq",  { EXx,  XM } },
     { "movdq2q",{ MX, XS } },
   },
   /* PREGRP22 */
   {
-    { "pshufw",        { MX, EM, Ib } },
-    { "pshufhw",{ XM, EX, Ib } },
-    { "pshufd",        { XM, EX, Ib } },
-    { "pshuflw",{ XM, EX, Ib } },
+    { "pshufw",        { MX, EM, Ib } },
+    { "pshufhw",{ XM, EXx, Ib } },
+    { "pshufd",        { XM, EXx, Ib } },
+    { "pshuflw",{ XM, EXx, Ib } },
+  },
+  /* PREGRP23 */
+  {
+    { "movd",  { Edq, MX } },
+    { "movq",  { XM, EXx } },
+    { "movd",  { Edq, XM } },
+    { "(bad)", { Ed, XM } },
+  },
+  /* PREGRP24 */
+  {
+    { "(bad)", { MX, EXx } },
+    { "(bad)", { XM, EXx } },
+    { "punpckhqdq", { XM, EXx } },
+    { "(bad)", { XM, EXx } },
+  },
+  /* PREGRP25 */
+  {
+    { "movntq",        { EM, MX } },
+    { "(bad)", { EM, XM } },
+    { "movntdq",{ EM, XM } },
+    { "(bad)", { EM, XM } },
+  },
+  /* PREGRP26 */
+  {
+    { "(bad)", { MX, EXx } },
+    { "(bad)", { XM, EXx } },
+    { "punpcklqdq", { XM, EXx } },
+    { "(bad)", { XM, EXx } },
+  },
+  /* PREGRP27 */
+  {
+    { "(bad)", { MX, EXx } },
+    { "(bad)", { XM, EXx } },
+    { "addsubpd", { XM, EXx } },
+    { "addsubps", { XM, EXx } },
+  },
+  /* PREGRP28 */
+  {
+    { "(bad)", { MX, EXx } },
+    { "(bad)", { XM, EXx } },
+    { "haddpd",        { XM, EXx } },
+    { "haddps",        { XM, EXx } },
+  },
+  /* PREGRP29 */
+  {
+    { "(bad)", { MX, EXx } },
+    { "(bad)", { XM, EXx } },
+    { "hsubpd",        { XM, EXx } },
+    { "hsubps",        { XM, EXx } },
+  },
+  /* PREGRP30 */
+  {
+    { "movlpX",        { XM, EXq, { SIMD_Fixup, 'h' } } }, /* really only 2 operands */
+    { "movsldup", { XM, EXx } },
+    { "movlpd",        { XM, EXq } },
+    { "movddup", { XM, EXq } },
+  },
+  /* PREGRP31 */
+  {
+    { "movhpX",        { XM, EXq, { SIMD_Fixup, 'l' } } },
+    { "movshdup", { XM, EXx } },
+    { "movhpd",        { XM, EXq } },
+    { "(bad)", { XM, EXq } },
+  },
+  /* PREGRP32 */
+  {
+    { "(bad)", { XM, EXx } },
+    { "(bad)", { XM, EXx } },
+    { "(bad)", { XM, EXx } },
+    { "lddqu", { XM, M } },
+  },
+  /* PREGRP33 */
+  {
+    {"movntps", { Ev, XM } },
+    {"movntss", { Ev, XM } },
+    {"movntpd", { Ev, XM } },
+    {"movntsd", { Ev, XM } },
+  },
+
+  /* PREGRP34 */
+  {
+    {"vmread", { Em, Gm } },
+    {"(bad)",  { XX } },
+    {"extrq",  { XS, Ib, Ib } },
+    {"insertq",        { XM, XS, Ib, Ib } },
+  },
+
+ /* PREGRP35 */
+  {
+    {"vmwrite",        { Gm, Em } },
+    {"(bad)",  { XX } },
+    {"extrq",  { XM, XS } },
+    {"insertq",        { XM, XS } },
+  },
+
+  /* PREGRP36 */
+  {
+    { "bsrS",  { Gv, Ev } },
+    { "lzcntS",        { Gv, Ev } },
+    { "bsrS",  { Gv, Ev } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP37 */
+  {
+    { "(bad)", { XX } },
+    { "popcntS", { Gv, Ev } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP38 */
+  {
+    { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
+    { "pause", { XX } },
+    { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP39 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pblendvb", {XM, EXx, XMM0 } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP40 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "blendvps", {XM, EXx, XMM0 } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP41 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "blendvpd", { XM, EXx, XMM0 } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP42 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "ptest",  { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP43 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovsxbw", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP44 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovsxbd", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP45 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovsxbq", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP46 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovsxwd", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP47 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovsxwq", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP48 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovsxdq", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP49 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmuldq", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP50 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pcmpeqq", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP51 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "movntdqa", { XM, EM } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP52 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "packusdw", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP53 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovzxbw", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP54 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovzxbd", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP55 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovzxbq", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP56 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovzxwd", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP57 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovzxwq", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP58 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmovzxdq", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP59 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pminsb",        { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP60 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pminsd",        { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP61 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pminuw",        { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP62 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pminud",        { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP63 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmaxsb",        { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP64 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmaxsd",        { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP65 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmaxuw", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP66 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmaxud", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP67 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pmulld", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP68 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "phminposuw", { XM, EXx } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP69 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "roundps", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP70 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "roundpd", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP71 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "roundss", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP72 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "roundsd", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP73 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "blendps", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP74 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "blendpd", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP75 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pblendw", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP76 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pextrb",        { Edqb, XM, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP77 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pextrw",        { Edqw, XM, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP78 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pextrK",        { Edq, XM, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP79 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "extractps", { Edqd, XM, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP80 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pinsrb",        { XM, Edqb, Ib } },
+    { "(bad)", { XX } },
+  },
+
+  /* PREGRP81 */
+  {
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "insertps", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
   },
-  /* PREGRP23 */
+
+  /* PREGRP82 */
   {
-    { "movd",  { Edq, MX } },
-    { "movq",  { XM, EX } },
-    { "movd",  { Edq, XM } },
-    { "(bad)", { Ed, XM } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pinsrK",        { XM, Edq, Ib } },
+    { "(bad)", { XX } },
   },
-  /* PREGRP24 */
+
+  /* PREGRP83 */
   {
-    { "(bad)", { MX, EX } },
-    { "(bad)", { XM, EX } },
-    { "punpckhqdq", { XM, EX } },
-    { "(bad)", { XM, EX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "dpps",  { XM, EXx, Ib } },
+    { "(bad)", { XX } },
   },
-  /* PREGRP25 */
+
+  /* PREGRP84 */
   {
-    { "movntq",        { EM, MX } },
-    { "(bad)", { EM, XM } },
-    { "movntdq",{ EM, XM } },
-    { "(bad)", { EM, XM } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "dppd",  { XM, EXx, Ib } },
+    { "(bad)", { XX } },
   },
-  /* PREGRP26 */
+
+  /* PREGRP85 */
   {
-    { "(bad)", { MX, EX } },
-    { "(bad)", { XM, EX } },
-    { "punpcklqdq", { XM, EX } },
-    { "(bad)", { XM, EX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "mpsadbw", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
   },
-  /* PREGRP27 */
+
+  /* PREGRP86 */
   {
-    { "(bad)", { MX, EX } },
-    { "(bad)", { XM, EX } },
-    { "addsubpd", { XM, EX } },
-    { "addsubps", { XM, EX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pcmpgtq", { XM, EXx } },
+    { "(bad)", { XX } },
   },
-  /* PREGRP28 */
+
+  /* PREGRP87 */
   {
-    { "(bad)", { MX, EX } },
-    { "(bad)", { XM, EX } },
-    { "haddpd",        { XM, EX } },
-    { "haddps",        { XM, EX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "crc32", { Gdq, { CRC32_Fixup, b_mode } } },     
   },
-  /* PREGRP29 */
+
+  /* PREGRP88 */
   {
-    { "(bad)", { MX, EX } },
-    { "(bad)", { XM, EX } },
-    { "hsubpd",        { XM, EX } },
-    { "hsubps",        { XM, EX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "crc32", { Gdq, { CRC32_Fixup, v_mode } } },     
   },
-  /* PREGRP30 */
+
+  /* PREGRP89 */
   {
-    { "movlpX",        { XM, EX, { SIMD_Fixup, 'h' } } }, /* really only 2 operands */
-    { "movsldup", { XM, EX } },
-    { "movlpd",        { XM, EX } },
-    { "movddup", { XM, EX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pcmpestrm", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
   },
-  /* PREGRP31 */
+
+  /* PREGRP90 */
   {
-    { "movhpX",        { XM, EX, { SIMD_Fixup, 'l' } } },
-    { "movshdup", { XM, EX } },
-    { "movhpd",        { XM, EX } },
-    { "(bad)", { XM, EX } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pcmpestri", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
   },
-  /* PREGRP32 */
+
+  /* PREGRP91 */
   {
-    { "(bad)", { XM, EX } },
-    { "(bad)", { XM, EX } },
-    { "(bad)", { XM, EX } },
-    { "lddqu", { XM, M } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pcmpistrm", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
   },
-  /* PREGRP33 */
+
+  /* PREGRP92 */
   {
-    {"movntps", { Ev, XM } },
-    {"movntss", { Ev, XM } },
-    {"movntpd", { Ev, XM } },
-    {"movntsd", { Ev, XM } },
+    { "(bad)", { XX } },
+    { "(bad)", { XX } },
+    { "pcmpistri", { XM, EXx, Ib } },
+    { "(bad)", { XX } },
   },
 
-  /* PREGRP34 */
+  /* PREGRP93 */
   {
-    {"vmread", { Em, Gm } },
-    {"(bad)",  { XX } },
-    {"extrq",  { XS, Ib, Ib } },
-    {"insertq",        { XM, XS, Ib, Ib } },
+    { "ucomiss",{ XM, EXd } }, 
+    { "(bad)", { XX } },
+    { "ucomisd",{ XM, EXq } }, 
+    { "(bad)", { XX } },
   },
-  
- /* PREGRP35 */  
+
+  /* PREGRP94 */
   {
-    {"vmwrite",        { Gm, Em } },
-    {"(bad)",  { XX } },
-    {"extrq",  { XM, XS } },
-    {"insertq",        { XM, XS } },
-  }, 
+    { "comiss",        { XM, EXd } },
+    { "(bad)", { XX } },
+    { "comisd",        { XM, EXq } },
+    { "(bad)", { XX } },
+  },
 
-  /* PREGRP36 */
+  /* PREGRP95 */
   {
-    { "bsrS",  { Gv, Ev } },
-    { "lzcntS",        { Gv, Ev } },
-    { "bsrS",  { Gv, Ev } },
+    { "punpcklbw",{ MX, EMd } },
+    { "(bad)", { XX } },
+    { "punpcklbw",{ MX, EMq } },
     { "(bad)", { XX } },
   },
 
-  /* PREGRP37 */
+  /* PREGRP96 */
   {
-    { "(bad)", { XX } },
-    { "popcntS", { Gv, Ev } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },    
+    { "punpcklwd",{ MX, EMd } },
+    { "(bad)", { XX } },
+    { "punpcklwd",{ MX, EMq } },
+    { "(bad)", { XX } },
   },
 
-  /* PREGRP38 */
+  /* PREGRP97 */
   {
-    { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
-    { "pause", { XX } },
-    { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
-    { "(bad)", { XX } },    
+    { "punpckldq",{ MX, EMd } },
+    { "(bad)", { XX } },
+    { "punpckldq",{ MX, EMq } },
+    { "(bad)", { XX } },
   },
 };
 
@@ -2084,14 +2628,14 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     /* 10 */
+    { PREGRP39 },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
+    { PREGRP40 },
+    { PREGRP41 },
     { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP42 },
     /* 18 */
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -2102,44 +2646,44 @@ static const struct dis386 three_byte_table[][256] = {
     { "pabsd", { MX, EM } },
     { "(bad)", { XX } },
     /* 20 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP43 },
+    { PREGRP44 },
+    { PREGRP45 },
+    { PREGRP46 },
+    { PREGRP47 },
+    { PREGRP48 },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     /* 28 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP49 },
+    { PREGRP50 },
+    { PREGRP51 },
+    { PREGRP52 },
     { "(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 } },
+    { PREGRP53 },
+    { PREGRP54 },
+    { PREGRP55 },
+    { PREGRP56 },
+    { PREGRP57 },
+    { PREGRP58 },
+    { "(bad)", { XX } },
+    { PREGRP86 },
     /* 38 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP59 },
+    { PREGRP60 },
+    { PREGRP61 },
+    { PREGRP62 },
+    { PREGRP63 },
+    { PREGRP64 },
+    { PREGRP65 },
+    { PREGRP66 },
     /* 40 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP67 },
+    { PREGRP68 },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -2336,8 +2880,8 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     /* f0 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP87 },
+    { PREGRP88 },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -2366,23 +2910,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 } },
+    { PREGRP69 },
+    { PREGRP70 },
+    { PREGRP71 },
+    { PREGRP72 },
+    { PREGRP73 },
+    { PREGRP74 },
+    { PREGRP75 },
     { "palignr", { MX, EM, Ib } },
     /* 10 */
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP76 },
+    { PREGRP77 },
+    { PREGRP78 },
+    { PREGRP79 },
     /* 18 */
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -2393,9 +2937,9 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     /* 20 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP80 },
+    { PREGRP81 },
+    { PREGRP82 },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -2429,9 +2973,9 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     /* 40 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP83 },
+    { PREGRP84 },
+    { PREGRP85 },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -2465,10 +3009,10 @@ static const struct dis386 three_byte_table[][256] = {
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     /* 60 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP89 },
+    { PREGRP90 },
+    { PREGRP91 },
+    { PREGRP92 },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -3125,7 +3669,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
       uses_LOCK_prefix = 0;
       codep++;
     }
-  
+
   if (!uses_REPZ_prefix && (prefixes & PREFIX_REPZ))
     {
       oappend ("repz ");
@@ -3238,7 +3782,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
         {
          for (i = 0; i < MAX_OPERANDS; ++i)
            {
-             obufp = op_out[i];                  
+             obufp = op_out[i];
              op_ad = MAX_OPERANDS - 1 - i;
              if (dp->op[i].rtn)
                (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag);
@@ -3279,14 +3823,19 @@ print_insn (bfd_vma pc, disassemble_info *info)
      order as the intel book; everything else is printed in reverse order.  */
   if (intel_syntax || two_source_ops)
     {
+      bfd_vma riprel;
+
       for (i = 0; i < MAX_OPERANDS; ++i)
         op_txt[i] = op_out[i];
-       
+
       for (i = 0; i < (MAX_OPERANDS >> 1); ++i)
        {
           op_ad = op_index[i];
           op_index[i] = op_index[MAX_OPERANDS - 1 - i];
           op_index[MAX_OPERANDS - 1 - i] = op_ad;
+         riprel = op_riprel[i];
+         op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
+         op_riprel[MAX_OPERANDS - 1 - i] = riprel;
        }
     }
   else
@@ -3314,6 +3863,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
        (*info->fprintf_func) (info->stream, "        # ");
        (*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep
                                                + op_address[op_index[i]]), info);
+       break;
       }
   return codep - priv.the_buffer;
 }
@@ -3839,6 +4389,13 @@ putop (const char *template, int sizeflag)
            break;
          *obufp++ = 'l';
          break;
+       case 'K':
+         USED_REX (REX_W);
+         if (rex & REX_W)
+           *obufp++ = 'q';
+         else
+           *obufp++ = 'd';
+         break;
        case 'Z':
          if (intel_syntax)
            break;
@@ -4122,12 +4679,57 @@ print_operand_value (char *buf, int hex, bfd_vma disp)
     }
 }
 
+/* Put DISP in BUF as signed hex number.  */
+
+static void
+print_displacement (char *buf, bfd_vma disp)
+{
+  bfd_signed_vma val = disp;
+  char tmp[30];
+  int i, j = 0;
+
+  if (val < 0)
+    {
+      buf[j++] = '-';
+      val = -disp;
+
+      /* Check for possible overflow.  */
+      if (val < 0)
+       {
+         switch (address_mode)
+           {
+           case mode_64bit:
+             strcpy (buf + j, "0x8000000000000000");
+             break;
+           case mode_32bit:
+             strcpy (buf + j, "0x80000000");
+             break;
+           case mode_16bit:
+             strcpy (buf + j, "0x8000");
+             break;
+           }
+         return;
+       }
+    }
+
+  buf[j++] = '0';
+  buf[j++] = 'x';
+
+  sprintf_vma (tmp, val);
+  for (i = 0; tmp[i] == '0'; i++)
+    continue;
+  if (tmp[i] == '\0')
+    i--;
+  strcpy (buf + j, tmp + i);
+}
+
 static void
 intel_operand_size (int bytemode, int sizeflag)
 {
   switch (bytemode)
     {
     case b_mode:
+    case dqb_mode:
       oappend ("BYTE PTR ");
       break;
     case w_mode:
@@ -4161,6 +4763,7 @@ intel_operand_size (int bytemode, int sizeflag)
        used_prefixes |= (prefixes & PREFIX_DATA);
       break;
     case d_mode:
+    case dqd_mode:
       oappend ("DWORD PTR ");
       break;
     case q_mode:
@@ -4244,6 +4847,8 @@ OP_E (int bytemode, int sizeflag)
          /* FALLTHRU */
        case v_mode:
        case dq_mode:
+       case dqb_mode:
+       case dqd_mode:
        case dqw_mode:
          USED_REX (REX_W);
          if (rex & REX_W)
@@ -4268,8 +4873,10 @@ OP_E (int bytemode, int sizeflag)
     intel_operand_size (bytemode, sizeflag);
   append_seg ();
 
-  if ((sizeflag & AFLAG) || address_mode == mode_64bit) /* 32 bit address mode */
+  if ((sizeflag & AFLAG) || address_mode == mode_64bit)
     {
+      /* 32/64 bit address mode */
+      int havedisp;
       int havesib;
       int havebase;
       int base;
@@ -4318,10 +4925,15 @@ OP_E (int bytemode, int sizeflag)
          break;
        }
 
+      havedisp = havebase || (havesib && (index != 4 || scale != 0));
+
       if (!intel_syntax)
        if (modrm.mod != 0 || (base & 7) == 5)
          {
-           print_operand_value (scratchbuf, !riprel, disp);
+           if (havedisp || riprel)
+             print_displacement (scratchbuf, disp);
+           else
+             print_operand_value (scratchbuf, 1, disp);
            oappend (scratchbuf);
            if (riprel)
              {
@@ -4330,11 +4942,14 @@ OP_E (int bytemode, int sizeflag)
              }
          }
 
-      if (havebase || (havesib && (index != 4 || scale != 0)))
+      if (havedisp || (intel_syntax && riprel))
        {
          *obufp++ = open_char;
          if (intel_syntax && riprel)
-           oappend ("rip + ");
+           {
+             set_op (disp, 1);
+             oappend ("rip");
+           }
          *obufp = '\0';
          if (havebase)
            oappend (address_mode == mode_64bit && (sizeflag & AFLAG)
@@ -4359,9 +4974,10 @@ OP_E (int bytemode, int sizeflag)
                  oappend (scratchbuf);
                }
            }
-         if (intel_syntax && disp)
+         if (intel_syntax
+             && (disp || modrm.mod != 0 || (base & 7) == 5))
            {
-             if ((bfd_signed_vma) disp > 0)
+             if ((bfd_signed_vma) disp >= 0)
                {
                  *obufp++ = '+';
                  *obufp = '\0';
@@ -4373,7 +4989,7 @@ OP_E (int bytemode, int sizeflag)
                  disp = - (bfd_signed_vma) disp;
                }
 
-             print_operand_value (scratchbuf, modrm.mod != 1, disp);
+             print_displacement (scratchbuf, disp);
              oappend (scratchbuf);
            }
 
@@ -4425,7 +5041,7 @@ OP_E (int bytemode, int sizeflag)
       if (!intel_syntax)
        if (modrm.mod != 0 || modrm.rm == 6)
          {
-           print_operand_value (scratchbuf, 0, disp);
+           print_displacement (scratchbuf, disp);
            oappend (scratchbuf);
          }
 
@@ -4434,9 +5050,10 @@ OP_E (int bytemode, int sizeflag)
          *obufp++ = open_char;
          *obufp = '\0';
          oappend (index16[modrm.rm]);
-         if (intel_syntax && disp)
+         if (intel_syntax
+             && (disp || modrm.mod != 0 || modrm.rm == 6))
            {
-             if ((bfd_signed_vma) disp > 0)
+             if ((bfd_signed_vma) disp >= 0)
                {
                  *obufp++ = '+';
                  *obufp = '\0';
@@ -4448,7 +5065,7 @@ OP_E (int bytemode, int sizeflag)
                  disp = - (bfd_signed_vma) disp;
                }
 
-             print_operand_value (scratchbuf, modrm.mod != 1, disp);
+             print_displacement (scratchbuf, disp);
              oappend (scratchbuf);
            }
 
@@ -4498,6 +5115,8 @@ OP_G (int bytemode, int sizeflag)
       break;
     case v_mode:
     case dq_mode:
+    case dqb_mode:
+    case dqd_mode:
     case dqw_mode:
       USED_REX (REX_W);
       if (rex & REX_W)
@@ -5187,10 +5806,10 @@ OP_EM (int bytemode, int sizeflag)
   oappend (scratchbuf + intel_syntax);
 }
 
-/* cvt* are the only instructions in sse2 which have 
-   both SSE and MMX operands and also have 0x66 prefix 
-   in their opcode. 0x66 was originally used to differentiate 
-   between SSE and MMX instruction(operands). So we have to handle the 
+/* cvt* are the only instructions in sse2 which have
+   both SSE and MMX operands and also have 0x66 prefix
+   in their opcode. 0x66 was originally used to differentiate
+   between SSE and MMX instruction(operands). So we have to handle the
    cvt* separately using OP_EMC and OP_MXC */
 static void
 OP_EMC (int bytemode, int sizeflag)
@@ -5205,7 +5824,7 @@ OP_EMC (int bytemode, int sizeflag)
       OP_E (bytemode, sizeflag);
       return;
     }
-  
+
   /* Skip mod/rm byte.  */
   MODRM_CHECK;
   codep++;
@@ -5228,17 +5847,6 @@ OP_EX (int bytemode, int sizeflag)
   int add = 0;
   if (modrm.mod != 3)
     {
-      if (intel_syntax && bytemode == v_mode)
-       {
-         switch (prefixes & (PREFIX_DATA|PREFIX_REPZ|PREFIX_REPNZ))
-           {
-           case 0:            bytemode = x_mode; break;
-           case PREFIX_REPZ:  bytemode = d_mode; used_prefixes |= PREFIX_REPZ;  break;
-           case PREFIX_DATA:  bytemode = x_mode; used_prefixes |= PREFIX_DATA;  break;
-           case PREFIX_REPNZ: bytemode = q_mode; used_prefixes |= PREFIX_REPNZ; break;
-           default:           bytemode = 0; break;
-           }
-       }
       OP_E (bytemode, sizeflag);
       return;
     }
@@ -5314,7 +5922,7 @@ OP_0fae (int bytemode, int sizeflag)
 }
 
 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
-   32bit mode and "xchg %rax,%rax" in 64bit mode.  */  
+   32bit mode and "xchg %rax,%rax" in 64bit mode.  */
 
 static void
 NOP_Fixup1 (int bytemode, int sizeflag)
@@ -5384,7 +5992,7 @@ static const char *const Suffix3DNow[] = {
 /* A8 */       NULL,           NULL,           "pfsubr",       NULL,
 /* AC */       NULL,           NULL,           "pfacc",        NULL,
 /* B0 */       "pfcmpeq",      NULL,           NULL,           NULL,
-/* B4 */       "pfmul",        NULL,           "pfrcpit2",     "pfmulhrw",
+/* B4 */       "pfmul",        NULL,           "pfrcpit2",     "pmulhrw",
 /* B8 */       NULL,           NULL,           NULL,           "pswapd",
 /* BC */       NULL,           NULL,           NULL,           "pavgusb",
 /* C0 */       NULL,           NULL,           NULL,           NULL,
@@ -5719,7 +6327,7 @@ REP_Fixup (int bytemode, int sizeflag)
   size_t ilen = 0;
 
   if (prefixes & PREFIX_REPZ)
-    switch (*insn_codep) 
+    switch (*insn_codep)
       {
       case 0x6e:       /* outsb */
       case 0x6f:       /* outsw/outsl */
@@ -5797,3 +6405,76 @@ CMPXCHG8B_Fixup (int bytemode, int sizeflag)
     }
   OP_M (bytemode, sizeflag);
 }
+
+static void
+XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
+{
+  sprintf (scratchbuf, "%%xmm%d", reg);
+  oappend (scratchbuf + intel_syntax);
+}
+
+static void
+CRC32_Fixup (int bytemode, int sizeflag)
+{
+  /* Add proper suffix to "crc32".  */
+  char *p = obuf + strlen (obuf);
+
+  switch (bytemode)
+    {
+    case b_mode:
+      if (intel_syntax)
+       break;
+
+      *p++ = 'b';
+      break;
+    case v_mode:
+      if (intel_syntax)
+       break;
+
+      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;
+    }
+  *p = '\0';
+
+  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);
+}
This page took 0.050714 seconds and 4 git commands to generate.