X86: Decode opcode 0x82 as opcode 0x80 in 32-bit mode
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 3 Nov 2016 16:13:01 +0000 (09:13 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 3 Nov 2016 16:15:52 +0000 (09:15 -0700)
Update x86 disassembler to treat opcode 0x82 as an aliase of opcode 0x80
in 32-bit mode.

gas/

PR binutils/20754
* testsuite/gas/i386/opcode.s: Add tests for opcode 0x82.
* testsuite/gas/i386/opcode-intel.d: Updated.
* testsuite/gas/i386/opcode.d: Likewise.

opcodes/

PR binutils/20754
* i386-dis.c (REG_82): New.
(X86_64_82_REG_0): Likewise.
(X86_64_82_REG_1): Likewise.
(X86_64_82_REG_2): Likewise.
(X86_64_82_REG_3): Likewise.
(X86_64_82_REG_4): Likewise.
(X86_64_82_REG_5): Likewise.
(X86_64_82_REG_6): Likewise.
(X86_64_82_REG_7): Likewise.
(dis386): Use REG_82.
(reg_table): Add REG_82.
(x86_64_table): Add X86_64_82_REG_0, X86_64_82_REG_1,
X86_64_82_REG_2, X86_64_82_REG_3, X86_64_82_REG_4,
X86_64_82_REG_5, X86_64_82_REG_6 and X86_64_82_REG_7.

gas/ChangeLog
gas/testsuite/gas/i386/opcode-intel.d
gas/testsuite/gas/i386/opcode.d
gas/testsuite/gas/i386/opcode.s
opcodes/ChangeLog
opcodes/i386-dis.c

index 0030ab3f80cf07665086a593564f138f0eec5875..9fc7e1b53ba504318bdd69dce634a7646bb3c448 100644 (file)
@@ -1,3 +1,10 @@
+2016-11-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/20754
+       * testsuite/gas/i386/opcode.s: Add tests for opcode 0x82.
+       * testsuite/gas/i386/opcode-intel.d: Updated.
+       * testsuite/gas/i386/opcode.d: Likewise.
+
 2016-11-02  Jiong Wang  <jiong.wang@arm.com>
 
        * config/tc-arm.c (SBIT_SHIFT): New.
index 23b7afad6df85de17eeed0bc371ff73af6675c18..6a6c86f7d4ef7684cff61adc85b8f86692e623bb 100644 (file)
@@ -592,4 +592,12 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    0f 4b 90 90 90 90 90    cmovnp edx,DWORD PTR \[eax-0x6f6f6f70\]
 [      ]*[a-f0-9]+:    66 0f 4a 90 90 90 90 90         cmovp  dx,WORD PTR \[eax-0x6f6f6f70\]
 [      ]*[a-f0-9]+:    66 0f 4b 90 90 90 90 90         cmovnp dx,WORD PTR \[eax-0x6f6f6f70\]
+ +[a-f0-9]+:   82 c3 01                add    bl,0x1
+ +[a-f0-9]+:   82 f3 01                xor    bl,0x1
+ +[a-f0-9]+:   82 d3 01                adc    bl,0x1
+ +[a-f0-9]+:   82 db 01                sbb    bl,0x1
+ +[a-f0-9]+:   82 e3 01                and    bl,0x1
+ +[a-f0-9]+:   82 eb 01                sub    bl,0x1
+ +[a-f0-9]+:   82 f3 01                xor    bl,0x1
+ +[a-f0-9]+:   82 fb 01                cmp    bl,0x1
 #pass
index 1a94fc81f14d3e5887b8043bb2191f86eeca834a..2294f64ab1cc4d234adc8660fa8f7437808a7ad8 100644 (file)
@@ -591,4 +591,12 @@ Disassembly of section .text:
 [      ]*[a-f0-9]+:    0f 4b 90 90 90 90 90    cmovnp -0x6f6f6f70\(%eax\),%edx
 [      ]*[a-f0-9]+:    66 0f 4a 90 90 90 90 90         cmovp  -0x6f6f6f70\(%eax\),%dx
 [      ]*[a-f0-9]+:    66 0f 4b 90 90 90 90 90         cmovnp -0x6f6f6f70\(%eax\),%dx
+ +[a-f0-9]+:   82 c3 01                add    \$0x1,%bl
+ +[a-f0-9]+:   82 f3 01                xor    \$0x1,%bl
+ +[a-f0-9]+:   82 d3 01                adc    \$0x1,%bl
+ +[a-f0-9]+:   82 db 01                sbb    \$0x1,%bl
+ +[a-f0-9]+:   82 e3 01                and    \$0x1,%bl
+ +[a-f0-9]+:   82 eb 01                sub    \$0x1,%bl
+ +[a-f0-9]+:   82 f3 01                xor    \$0x1,%bl
+ +[a-f0-9]+:   82 fb 01                cmp    \$0x1,%bl
 #pass
index a07e42372df38652e5a192c18531fab7853a050e..001a1148179b3dcd322e5cee05caec2df2f3f0a7 100644 (file)
@@ -589,3 +589,12 @@ foo:
  cmovpo 0x90909090(%eax),%edx
  cmovpe  0x90909090(%eax),%dx
  cmovpo 0x90909090(%eax),%dx
+
+       .byte 0x82, 0xc3, 0x01
+       .byte 0x82, 0xf3, 0x01
+       .byte 0x82, 0xd3, 0x01
+       .byte 0x82, 0xdb, 0x01
+       .byte 0x82, 0xe3, 0x01
+       .byte 0x82, 0xeb, 0x01
+       .byte 0x82, 0xf3, 0x01
+       .byte 0x82, 0xfb, 0x01
index 813181764b5106ebf49331a8a6f1e118d3adb118..d0f88461bc0a5b08286880962894aecdd8243add 100644 (file)
@@ -1,3 +1,21 @@
+2016-11-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/20754
+       * i386-dis.c (REG_82): New.
+       (X86_64_82_REG_0): Likewise.
+       (X86_64_82_REG_1): Likewise.
+       (X86_64_82_REG_2): Likewise.
+       (X86_64_82_REG_3): Likewise.
+       (X86_64_82_REG_4): Likewise.
+       (X86_64_82_REG_5): Likewise.
+       (X86_64_82_REG_6): Likewise.
+       (X86_64_82_REG_7): Likewise.
+       (dis386): Use REG_82.
+       (reg_table): Add REG_82.
+       (x86_64_table): Add X86_64_82_REG_0, X86_64_82_REG_1,
+       X86_64_82_REG_2, X86_64_82_REG_3, X86_64_82_REG_4,
+       X86_64_82_REG_5, X86_64_82_REG_6 and X86_64_82_REG_7.
+
 2016-11-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        * i386-dis.c (REG_82): Renamed to ...
index 8fb607cef5798c94d8ea4e07b9d04a7c25ac03e0..b0bb5e8cab26d625a0449ada317e02f768a4de58 100644 (file)
@@ -706,6 +706,7 @@ enum
 {
   REG_80 = 0,
   REG_81,
+  REG_82,
   REG_83,
   REG_8F,
   REG_C0,
@@ -1694,6 +1695,14 @@ enum
   X86_64_63,
   X86_64_6D,
   X86_64_6F,
+  X86_64_82_REG_0,
+  X86_64_82_REG_1,
+  X86_64_82_REG_2,
+  X86_64_82_REG_3,
+  X86_64_82_REG_4,
+  X86_64_82_REG_5,
+  X86_64_82_REG_6,
+  X86_64_82_REG_7,
   X86_64_9A,
   X86_64_C4,
   X86_64_C5,
@@ -2662,7 +2671,7 @@ static const struct dis386 dis386[] = {
   /* 80 */
   { REG_TABLE (REG_80) },
   { REG_TABLE (REG_81) },
-  { Bad_Opcode },
+  { REG_TABLE (REG_82) },
   { REG_TABLE (REG_83) },
   { "testB",           { Eb, Gb }, 0 },
   { "testS",           { Ev, Gv }, 0 },
@@ -3400,6 +3409,17 @@ static const struct dis386 reg_table[][8] = {
     { "xorQ",  { Evh1, Iv }, 0 },
     { "cmpQ",  { Ev, Iv }, 0 },
   },
+  /* REG_82 */
+  {
+    { X86_64_TABLE (X86_64_82_REG_0) },
+    { X86_64_TABLE (X86_64_82_REG_1) },
+    { X86_64_TABLE (X86_64_82_REG_2) },
+    { X86_64_TABLE (X86_64_82_REG_3) },
+    { X86_64_TABLE (X86_64_82_REG_4) },
+    { X86_64_TABLE (X86_64_82_REG_5) },
+    { X86_64_TABLE (X86_64_82_REG_6) },
+    { X86_64_TABLE (X86_64_82_REG_7) },
+  },
   /* REG_83 */
   {
     { "addQ",  { Evh1, sIb }, 0 },
@@ -6887,6 +6907,46 @@ static const struct dis386 x86_64_table[][2] = {
     { "outs{G|}", { indirDXr, Xz }, 0 },
   },
 
+  /* X86_64_82_REG_0 */
+  {
+    { "addA",  { Ebh1, Ib }, 0 },
+  },
+
+  /* X86_64_82_REG_1 */
+  {
+    { "orA",   { Ebh1, Ib }, 0 },
+  },
+
+  /* X86_64_82_REG_2 */
+  {
+    { "adcA",  { Ebh1, Ib }, 0 },
+  },
+
+  /* X86_64_82_REG_3 */
+  {
+    { "sbbA",  { Ebh1, Ib }, 0 },
+  },
+
+  /* X86_64_82_REG_4 */
+  {
+    { "andA",  { Ebh1, Ib }, 0 },
+  },
+
+  /* X86_64_82_REG_5 */
+  {
+    { "subA",  { Ebh1, Ib }, 0 },
+  },
+
+  /* X86_64_82_REG_6 */
+  {
+    { "xorA",  { Ebh1, Ib }, 0 },
+  },
+
+  /* X86_64_82_REG_7 */
+  {
+    { "cmpA",  { Eb, Ib }, 0 },
+  },
+
   /* X86_64_9A */
   {
     { "Jcall{T|}", { Ap }, 0 },
This page took 0.031789 seconds and 4 git commands to generate.