PATCH: Add more nops to x86 disassembler

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PATCH: Add more nops to x86 disassembler

H.J. Lu-27
Opcodes from 0x0f19 to 0x0f1e are AMD nops. I am checking in this
patch to add them to x86 disassembler.


H.J.
---
gas/testsuite/

2008-01-10  H.J. Lu  <[hidden email]>

        * gas/i386/nops.s: Add more tests with opcodes from 0x0f19
        to 0x0f1f.
        * gas/i386/x86-64-nops.s: Likewise.

        * gas/i386/nops.d: Updated.
        * gas/i386/x86-64-nops.d: Likewise.

opcodes/

        * i386-dis.c (REG_0F0E): Renamed to REG_0F0D.
        (REG_0F18): Updated.
        (reg_table): Updated.
        (dis386_twobyte): Updated.  Use "nopQ" on 0x19 to 0x1e.
        (twobyte_has_modrm): Set 1 for 0x19 to 0x1e.

2008-01-10  H.J. Lu  <[hidden email]>

--- binutils/gas/testsuite/gas/i386/nops.d.nop 2007-03-22 06:57:27.000000000 -0700
+++ binutils/gas/testsuite/gas/i386/nops.d 2008-01-10 06:38:37.000000000 -0800
@@ -5,20 +5,55 @@
 
 Disassembly of section .text:
 
-0+000 <.text>:
-[ ]*0:[ ]+0f 1f 00[ ]+nopl[ ]+\(%eax\)
-[ ]*3:[ ]+0f 1f 40 00[ ]+nopl[ ]+0x0\(%eax\)
-[ ]*7:[ ]+0f 1f 44 00 00[ ]+nopl[ ]+0x0\(%eax,%eax,1\)
-[ ]*c:[ ]+66 0f 1f 44 00 00[ ]+nopw[ ]+0x0\(%eax,%eax,1\)
-[ ]*12:[ ]+0f 1f 80 00 00 00 00[ ]+nopl[ ]+0x0\(%eax\)
-[ ]*19:[ ]+0f 1f 84 00 00 00 00 00[ ]+nopl[ ]+0x0\(%eax,%eax,1\)
-[ ]*21:[ ]+66 0f 1f 84 00 00 00 00 00[ ]+nopw[ ]+0x0\(%eax,%eax,1\)
-[ ]*2a:[ ]+66 2e 0f 1f 84 00 00 00 00 00[ ]+nopw[ ]+%cs:0x0\(%eax,%eax,1\)
-[ ]*34:[ ]+0f 1f 00[ ]+nopl[ ]+\(%eax\)
-[ ]*37:[ ]+0f 1f c0[ ]+nop[ ]+%eax
-[ ]*3a:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
-[ ]*3e:[ ]+0f 1f 00[ ]+nopl[ ]+\(%eax\)
-[ ]*41:[ ]+66 0f 1f 00[ ]+nopw[ ]+\(%eax\)
-[ ]*45:[ ]+0f 1f c0[ ]+nop[ ]+%eax
-[ ]*48:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
+0+ <.text>:
+[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%eax\)
+[ ]*[a-f0-9]+: 0f 1f 40 00           nopl   0x0\(%eax\)
+[ ]*[a-f0-9]+: 0f 1f 44 00 00       nopl   0x0\(%eax,%eax,1\)
+[ ]*[a-f0-9]+: 66 0f 1f 44 00 00     nopw   0x0\(%eax,%eax,1\)
+[ ]*[a-f0-9]+: 0f 1f 80 00 00 00 00 nopl   0x0\(%eax\)
+[ ]*[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl   0x0\(%eax,%eax,1\)
+[ ]*[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw   0x0\(%eax,%eax,1\)
+[ ]*[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw   %cs:0x0\(%eax,%eax,1\)
+[ ]*[a-f0-9]+: 0f 19 ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1a ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1b ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1c ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1d ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1e ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1f ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 19 5a 22           nopl   0x22\(%edx\)
+[ ]*[a-f0-9]+: 0f 1a 5a 22           nopl   0x22\(%edx\)
+[ ]*[a-f0-9]+: 0f 1b 5a 22           nopl   0x22\(%edx\)
+[ ]*[a-f0-9]+: 0f 1c 5a 22           nopl   0x22\(%edx\)
+[ ]*[a-f0-9]+: 0f 1d 5a 22           nopl   0x22\(%edx\)
+[ ]*[a-f0-9]+: 0f 1e 5a 22           nopl   0x22\(%edx\)
+[ ]*[a-f0-9]+: 0f 1f 5a 22           nopl   0x22\(%edx\)
+[ ]*[a-f0-9]+: 0f 19 9c 1d 11 22 33 44 nopl   0x44332211\(%ebp,%ebx,1\)
+[ ]*[a-f0-9]+: 0f 1a 9c 1d 11 22 33 44 nopl   0x44332211\(%ebp,%ebx,1\)
+[ ]*[a-f0-9]+: 0f 1b 9c 1d 11 22 33 44 nopl   0x44332211\(%ebp,%ebx,1\)
+[ ]*[a-f0-9]+: 0f 1c 9c 1d 11 22 33 44 nopl   0x44332211\(%ebp,%ebx,1\)
+[ ]*[a-f0-9]+: 0f 1d 9c 1d 11 22 33 44 nopl   0x44332211\(%ebp,%ebx,1\)
+[ ]*[a-f0-9]+: 0f 1e 9c 1d 11 22 33 44 nopl   0x44332211\(%ebp,%ebx,1\)
+[ ]*[a-f0-9]+: 0f 1f 9c 1d 11 22 33 44 nopl   0x44332211\(%ebp,%ebx,1\)
+[ ]*[a-f0-9]+: 0f 19 04 60           nopl   \(%eax,%eiz,2\)
+[ ]*[a-f0-9]+: 0f 1a 04 60           nopl   \(%eax,%eiz,2\)
+[ ]*[a-f0-9]+: 0f 1b 04 60           nopl   \(%eax,%eiz,2\)
+[ ]*[a-f0-9]+: 0f 1c 04 60           nopl   \(%eax,%eiz,2\)
+[ ]*[a-f0-9]+: 0f 1d 04 60           nopl   \(%eax,%eiz,2\)
+[ ]*[a-f0-9]+: 0f 1e 04 60           nopl   \(%eax,%eiz,2\)
+[ ]*[a-f0-9]+: 0f 1f 04 60           nopl   \(%eax,%eiz,2\)
+[ ]*[a-f0-9]+: 0f 19 04 59           nopl   \(%ecx,%ebx,2\)
+[ ]*[a-f0-9]+: 0f 1a 04 59           nopl   \(%ecx,%ebx,2\)
+[ ]*[a-f0-9]+: 0f 1b 04 59           nopl   \(%ecx,%ebx,2\)
+[ ]*[a-f0-9]+: 0f 1c 04 59           nopl   \(%ecx,%ebx,2\)
+[ ]*[a-f0-9]+: 0f 1d 04 59           nopl   \(%ecx,%ebx,2\)
+[ ]*[a-f0-9]+: 0f 1e 04 59           nopl   \(%ecx,%ebx,2\)
+[ ]*[a-f0-9]+: 0f 1f 04 59           nopl   \(%ecx,%ebx,2\)
+[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%eax\)
+[ ]*[a-f0-9]+: 0f 1f c0             nop    %eax
+[ ]*[a-f0-9]+: 66 0f 1f c0           nop    %ax
+[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%eax\)
+[ ]*[a-f0-9]+: 66 0f 1f 00           nopw   \(%eax\)
+[ ]*[a-f0-9]+: 0f 1f c0             nop    %eax
+[ ]*[a-f0-9]+: 66 0f 1f c0           nop    %ax
 #pass
--- binutils/gas/testsuite/gas/i386/nops.s.nop 2007-03-22 06:57:27.000000000 -0700
+++ binutils/gas/testsuite/gas/i386/nops.s 2008-01-10 06:35:11.000000000 -0800
@@ -9,6 +9,49 @@
  .byte 0x66, 0x0f, 0x1f, 0x84, 0x0,  0x0, 0x0, 0x0, 0x0
  .byte 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0
 
+ # reg,reg
+ .byte 0x0f, 0x19, 0xff
+ .byte 0x0f, 0x1a, 0xff  
+ .byte 0x0f, 0x1b, 0xff
+ .byte 0x0f, 0x1c, 0xff  
+ .byte 0x0f, 0x1d, 0xff
+ .byte 0x0f, 0x1e, 0xff  
+ .byte 0x0f, 0x1f, 0xff
+
+ # with base and imm8
+ .byte 0x0f, 0x19, 0x5A, 0x22
+ .byte 0x0f, 0x1a, 0x5A, 0x22
+ .byte 0x0f, 0x1b, 0x5A, 0x22
+ .byte 0x0f, 0x1c, 0x5A, 0x22
+ .byte 0x0f, 0x1d, 0x5A, 0x22
+ .byte 0x0f, 0x1e, 0x5A, 0x22
+ .byte 0x0f, 0x1f, 0x5A, 0x22
+
+ # with sib and imm32
+ .byte 0x0f, 0x19, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1a, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1b, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1c, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1d, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1e, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1f, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+
+ .byte 0x0f, 0x19, 0x04, 0x60
+ .byte 0x0f, 0x1a, 0x04, 0x60
+ .byte 0x0f, 0x1b, 0x04, 0x60
+ .byte 0x0f, 0x1c, 0x04, 0x60
+ .byte 0x0f, 0x1d, 0x04, 0x60
+ .byte 0x0f, 0x1e, 0x04, 0x60
+ .byte 0x0f, 0x1f, 0x04, 0x60
+
+ .byte 0x0f, 0x19, 0x04, 0x59
+ .byte 0x0f, 0x1a, 0x04, 0x59
+ .byte 0x0f, 0x1b, 0x04, 0x59
+ .byte 0x0f, 0x1c, 0x04, 0x59
+ .byte 0x0f, 0x1d, 0x04, 0x59
+ .byte 0x0f, 0x1e, 0x04, 0x59
+ .byte 0x0f, 0x1f, 0x04, 0x59
+
  nop (%eax)
  nop %eax
  nop %ax
@@ -16,5 +59,3 @@
  nopw (%eax)
  nopl %eax
  nopw %ax
-
- .p2align 4
--- binutils/gas/testsuite/gas/i386/x86-64-nops.d.nop 2007-03-22 06:57:27.000000000 -0700
+++ binutils/gas/testsuite/gas/i386/x86-64-nops.d 2008-01-10 06:38:41.000000000 -0800
@@ -5,33 +5,68 @@
 
 Disassembly of section .text:
 
-0+000 <.text>:
-[ ]*0:[ ]+0f 1f 00[ ]+nopl[ ]+\(%rax\)
-[ ]*3:[ ]+0f 1f 40 00[ ]+nopl[ ]+0x0\(%rax\)
-[ ]*7:[ ]+0f 1f 44 00 00[ ]+nopl[ ]+0x0\(%rax,%rax,1\)
-[ ]*c:[ ]+66 0f 1f 44 00 00[ ]+nopw[ ]+0x0\(%rax,%rax,1\)
-[ ]*12:[ ]+0f 1f 80 00 00 00 00[ ]+nopl[ ]+0x0\(%rax\)
-[ ]*19:[ ]+0f 1f 84 00 00 00 00 00[ ]+nopl[ ]+0x0\(%rax,%rax,1\)
-[ ]*21:[ ]+66 0f 1f 84 00 00 00 00 00[ ]+nopw[ ]+0x0\(%rax,%rax,1\)
-[ ]*2a:[ ]+66 2e 0f 1f 84 00 00 00 00 00[ ]+nopw[ ]+%cs:0x0\(%rax,%rax,1\)
-[ ]*34:[ ]+0f 1f 00[ ]+nopl[ ]+\(%rax\)
-[ ]*37:[ ]+48 0f 1f c0[ ]+nop[ ]+%rax
-[ ]*3b:[ ]+0f 1f c0[ ]+nop[ ]+%eax
-[ ]*3e:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
-[ ]*42:[ ]+48 0f 1f 00[ ]+nopq[ ]+\(%rax\)
-[ ]*46:[ ]+0f 1f 00[ ]+nopl[ ]+\(%rax\)
-[ ]*49:[ ]+66 0f 1f 00[ ]+nopw[ ]+\(%rax\)
-[ ]*4d:[ ]+48 0f 1f c0[ ]+nop[ ]+%rax
-[ ]*51:[ ]+0f 1f c0[ ]+nop[ ]+%eax
-[ ]*54:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
-[ ]*58:[ ]+41 0f 1f 02[ ]+nopl[ ]+\(%r10\)
-[ ]*5c:[ ]+49 0f 1f c2[ ]+nop[ ]+%r10
-[ ]*60:[ ]+41 0f 1f c2[ ]+nop[ ]+%r10d
-[ ]*64:[ ]+66 41 0f 1f c2[ ]+nop[ ]+%r10w
-[ ]*69:[ ]+49 0f 1f 02[ ]+nopq[ ]+\(%r10\)
-[ ]*6d:[ ]+41 0f 1f 02[ ]+nopl[ ]+\(%r10\)
-[ ]*71:[ ]+66 41 0f 1f 02[ ]+nopw[ ]+\(%r10\)
-[ ]*76:[ ]+49 0f 1f c2[ ]+nop[ ]+%r10
-[ ]*7a:[ ]+41 0f 1f c2[ ]+nop[ ]+%r10d
-[ ]*7e:[ ]+66 41 0f 1f c2[ ]+nop[ ]+%r10w
+0+ <.text>:
+[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%rax\)
+[ ]*[a-f0-9]+: 0f 1f 40 00           nopl   0x0\(%rax\)
+[ ]*[a-f0-9]+: 0f 1f 44 00 00       nopl   0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 66 0f 1f 44 00 00     nopw   0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 0f 1f 80 00 00 00 00 nopl   0x0\(%rax\)
+[ ]*[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl   0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw   0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw   %cs:0x0\(%rax,%rax,1\)
+[ ]*[a-f0-9]+: 0f 19 ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1a ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1b ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1c ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1d ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1e ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 1f ff             nop    %edi
+[ ]*[a-f0-9]+: 0f 19 5a 22           nopl   0x22\(%rdx\)
+[ ]*[a-f0-9]+: 0f 1a 5a 22           nopl   0x22\(%rdx\)
+[ ]*[a-f0-9]+: 0f 1b 5a 22           nopl   0x22\(%rdx\)
+[ ]*[a-f0-9]+: 0f 1c 5a 22           nopl   0x22\(%rdx\)
+[ ]*[a-f0-9]+: 0f 1d 5a 22           nopl   0x22\(%rdx\)
+[ ]*[a-f0-9]+: 0f 1e 5a 22           nopl   0x22\(%rdx\)
+[ ]*[a-f0-9]+: 0f 1f 5a 22           nopl   0x22\(%rdx\)
+[ ]*[a-f0-9]+: 0f 19 9c 1d 11 22 33 44 nopl   0x44332211\(%rbp,%rbx,1\)
+[ ]*[a-f0-9]+: 0f 1a 9c 1d 11 22 33 44 nopl   0x44332211\(%rbp,%rbx,1\)
+[ ]*[a-f0-9]+: 0f 1b 9c 1d 11 22 33 44 nopl   0x44332211\(%rbp,%rbx,1\)
+[ ]*[a-f0-9]+: 0f 1c 9c 1d 11 22 33 44 nopl   0x44332211\(%rbp,%rbx,1\)
+[ ]*[a-f0-9]+: 0f 1d 9c 1d 11 22 33 44 nopl   0x44332211\(%rbp,%rbx,1\)
+[ ]*[a-f0-9]+: 0f 1e 9c 1d 11 22 33 44 nopl   0x44332211\(%rbp,%rbx,1\)
+[ ]*[a-f0-9]+: 0f 1f 9c 1d 11 22 33 44 nopl   0x44332211\(%rbp,%rbx,1\)
+[ ]*[a-f0-9]+: 0f 19 04 60           nopl   \(%rax,%riz,2\)
+[ ]*[a-f0-9]+: 0f 1a 04 60           nopl   \(%rax,%riz,2\)
+[ ]*[a-f0-9]+: 0f 1b 04 60           nopl   \(%rax,%riz,2\)
+[ ]*[a-f0-9]+: 0f 1c 04 60           nopl   \(%rax,%riz,2\)
+[ ]*[a-f0-9]+: 0f 1d 04 60           nopl   \(%rax,%riz,2\)
+[ ]*[a-f0-9]+: 0f 1e 04 60           nopl   \(%rax,%riz,2\)
+[ ]*[a-f0-9]+: 0f 1f 04 60           nopl   \(%rax,%riz,2\)
+[ ]*[a-f0-9]+: 0f 19 04 59           nopl   \(%rcx,%rbx,2\)
+[ ]*[a-f0-9]+: 0f 1a 04 59           nopl   \(%rcx,%rbx,2\)
+[ ]*[a-f0-9]+: 0f 1b 04 59           nopl   \(%rcx,%rbx,2\)
+[ ]*[a-f0-9]+: 0f 1c 04 59           nopl   \(%rcx,%rbx,2\)
+[ ]*[a-f0-9]+: 0f 1d 04 59           nopl   \(%rcx,%rbx,2\)
+[ ]*[a-f0-9]+: 0f 1e 04 59           nopl   \(%rcx,%rbx,2\)
+[ ]*[a-f0-9]+: 0f 1f 04 59           nopl   \(%rcx,%rbx,2\)
+[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%rax\)
+[ ]*[a-f0-9]+: 48 0f 1f c0           nop    %rax
+[ ]*[a-f0-9]+: 0f 1f c0             nop    %eax
+[ ]*[a-f0-9]+: 66 0f 1f c0           nop    %ax
+[ ]*[a-f0-9]+: 48 0f 1f 00           nopq   \(%rax\)
+[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%rax\)
+[ ]*[a-f0-9]+: 66 0f 1f 00           nopw   \(%rax\)
+[ ]*[a-f0-9]+: 48 0f 1f c0           nop    %rax
+[ ]*[a-f0-9]+: 0f 1f c0             nop    %eax
+[ ]*[a-f0-9]+: 66 0f 1f c0           nop    %ax
+[ ]*[a-f0-9]+: 41 0f 1f 02           nopl   \(%r10\)
+[ ]*[a-f0-9]+: 49 0f 1f c2           nop    %r10
+[ ]*[a-f0-9]+: 41 0f 1f c2           nop    %r10d
+[ ]*[a-f0-9]+: 66 41 0f 1f c2       nop    %r10w
+[ ]*[a-f0-9]+: 49 0f 1f 02           nopq   \(%r10\)
+[ ]*[a-f0-9]+: 41 0f 1f 02           nopl   \(%r10\)
+[ ]*[a-f0-9]+: 66 41 0f 1f 02       nopw   \(%r10\)
+[ ]*[a-f0-9]+: 49 0f 1f c2           nop    %r10
+[ ]*[a-f0-9]+: 41 0f 1f c2           nop    %r10d
+[ ]*[a-f0-9]+: 66 41 0f 1f c2       nop    %r10w
 #pass
--- binutils/gas/testsuite/gas/i386/x86-64-nops.s.nop 2007-03-22 06:57:27.000000000 -0700
+++ binutils/gas/testsuite/gas/i386/x86-64-nops.s 2008-01-10 06:35:28.000000000 -0800
@@ -9,6 +9,49 @@
  .byte 0x66, 0x0f, 0x1f, 0x84, 0x0,  0x0, 0x0, 0x0, 0x0
  .byte 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0
 
+ # reg,reg
+ .byte 0x0f, 0x19, 0xff
+ .byte 0x0f, 0x1a, 0xff  
+ .byte 0x0f, 0x1b, 0xff
+ .byte 0x0f, 0x1c, 0xff  
+ .byte 0x0f, 0x1d, 0xff
+ .byte 0x0f, 0x1e, 0xff  
+ .byte 0x0f, 0x1f, 0xff
+
+ # with base and imm8
+ .byte 0x0f, 0x19, 0x5A, 0x22
+ .byte 0x0f, 0x1a, 0x5A, 0x22
+ .byte 0x0f, 0x1b, 0x5A, 0x22
+ .byte 0x0f, 0x1c, 0x5A, 0x22
+ .byte 0x0f, 0x1d, 0x5A, 0x22
+ .byte 0x0f, 0x1e, 0x5A, 0x22
+ .byte 0x0f, 0x1f, 0x5A, 0x22
+
+ # with sib and imm32
+ .byte 0x0f, 0x19, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1a, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1b, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1c, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1d, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1e, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+ .byte 0x0f, 0x1f, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
+
+ .byte 0x0f, 0x19, 0x04, 0x60
+ .byte 0x0f, 0x1a, 0x04, 0x60
+ .byte 0x0f, 0x1b, 0x04, 0x60
+ .byte 0x0f, 0x1c, 0x04, 0x60
+ .byte 0x0f, 0x1d, 0x04, 0x60
+ .byte 0x0f, 0x1e, 0x04, 0x60
+ .byte 0x0f, 0x1f, 0x04, 0x60
+
+ .byte 0x0f, 0x19, 0x04, 0x59
+ .byte 0x0f, 0x1a, 0x04, 0x59
+ .byte 0x0f, 0x1b, 0x04, 0x59
+ .byte 0x0f, 0x1c, 0x04, 0x59
+ .byte 0x0f, 0x1d, 0x04, 0x59
+ .byte 0x0f, 0x1e, 0x04, 0x59
+ .byte 0x0f, 0x1f, 0x04, 0x59
+
  nop (%rax)
  nop %rax
  nop %eax
@@ -29,5 +72,3 @@
  nopq %r10
  nopl %r10d
  nopw %r10w
-
- .p2align 4
--- binutils/opcodes/i386-dis.c.nop 2007-12-31 07:44:57.000000000 -0800
+++ binutils/opcodes/i386-dis.c 2008-01-10 06:32:26.000000000 -0800
@@ -491,8 +491,8 @@ fetch_data (struct disassemble_info *inf
 #define REG_FF (REG_FE + 1)
 #define REG_0F00 (REG_FF + 1)
 #define REG_0F01 (REG_0F00 + 1)
-#define REG_0F0E (REG_0F01 + 1)
-#define REG_0F18 (REG_0F0E + 1)
+#define REG_0F0D (REG_0F01 + 1)
+#define REG_0F18 (REG_0F0D + 1)
 #define REG_0F71 (REG_0F18 + 1)
 #define REG_0F72 (REG_0F71 + 1)
 #define REG_0F73 (REG_0F72 + 1)
@@ -1067,7 +1067,7 @@ static const struct dis386 dis386_twobyt
   { "(bad)", { XX } },
   { "ud2a", { XX } },
   { "(bad)", { XX } },
-  { REG_TABLE (REG_0F0E) },
+  { REG_TABLE (REG_0F0D) },
   { "femms", { XX } },
   { "", { MX, EM, OPSUF } }, /* See OP_3DNowSuffix.  */
   /* 10 */
@@ -1081,12 +1081,12 @@ static const struct dis386 dis386_twobyt
   { MOD_TABLE (MOD_0F17) },
   /* 18 */
   { REG_TABLE (REG_0F18) },
-  { "(bad)", { XX } },
-  { "(bad)", { XX } },
-  { "(bad)", { XX } },
-  { "(bad)", { XX } },
-  { "(bad)", { XX } },
-  { "(bad)", { XX } },
+  { "nopQ", { Ev } },
+  { "nopQ", { Ev } },
+  { "nopQ", { Ev } },
+  { "nopQ", { Ev } },
+  { "nopQ", { Ev } },
+  { "nopQ", { Ev } },
   { "nopQ", { Ev } },
   /* 20 */
   { MOD_TABLE (MOD_0F20) },
@@ -1369,7 +1369,7 @@ static const unsigned char twobyte_has_m
   /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
   /*       -------------------------------        */
   /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
-  /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1, /* 1f */
+  /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
   /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
   /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
   /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
@@ -1679,7 +1679,7 @@ static const struct dis386 reg_table[][8
     { "lmsw", { Ew } },
     { MOD_TABLE (MOD_0F01_REG_7) },
   },
-  /* REG_0F0E */
+  /* REG_0F0D */
   {
     { "prefetch", { Eb } },
     { "prefetchw", { Eb } },
Reply | Threaded
Open this post in threaded view
|

RE: PATCH: Add more nops to x86 disassembler

rajagopal, dwarak
This patch looks fine. Thanks for applying this.

- Dwarak

> -----Original Message-----
> From: H.J. Lu [mailto:[hidden email]]
> Sent: Thursday, January 10, 2008 8:50 AM
> To: [hidden email]
> Cc: Meissner, Michael
> Subject: PATCH: Add more nops to x86 disassembler
>
> Opcodes from 0x0f19 to 0x0f1e are AMD nops. I am checking in this
> patch to add them to x86 disassembler.
>
>
> H.J.
> ---
> gas/testsuite/
>
> 2008-01-10  H.J. Lu  <[hidden email]>
>
> * gas/i386/nops.s: Add more tests with opcodes from 0x0f19
> to 0x0f1f.
> * gas/i386/x86-64-nops.s: Likewise.
>
> * gas/i386/nops.d: Updated.
> * gas/i386/x86-64-nops.d: Likewise.
>
> opcodes/
>
> * i386-dis.c (REG_0F0E): Renamed to REG_0F0D.
> (REG_0F18): Updated.
> (reg_table): Updated.
> (dis386_twobyte): Updated.  Use "nopQ" on 0x19 to 0x1e.
> (twobyte_has_modrm): Set 1 for 0x19 to 0x1e.
>
> 2008-01-10  H.J. Lu  <[hidden email]>
>
> --- binutils/gas/testsuite/gas/i386/nops.d.nop 2007-03-22
> 06:57:27.000000000 -0700
> +++ binutils/gas/testsuite/gas/i386/nops.d 2008-01-10
> 06:38:37.000000000 -0800
> @@ -5,20 +5,55 @@
>
>  Disassembly of section .text:
>
> -0+000 <.text>:
> -[ ]*0:[ ]+0f 1f 00[ ]+nopl[ ]+\(%eax\)
> -[ ]*3:[ ]+0f 1f 40 00[ ]+nopl[ ]+0x0\(%eax\)
> -[ ]*7:[ ]+0f 1f 44 00 00[ ]+nopl[
]+0x0\(%eax,%eax,1\)
> -[ ]*c:[ ]+66 0f 1f 44 00 00[ ]+nopw[
]+0x0\(%eax,%eax,1\)
> -[ ]*12:[ ]+0f 1f 80 00 00 00 00[ ]+nopl[
]+0x0\(%eax\)

> -[ ]*19:[ ]+0f 1f 84 00 00 00 00 00[ ]+nopl[
> ]+0x0\(%eax,%eax,1\)
> -[ ]*21:[ ]+66 0f 1f 84 00 00 00 00 00[ ]+nopw[
> ]+0x0\(%eax,%eax,1\)
> -[ ]*2a:[ ]+66 2e 0f 1f 84 00 00 00 00 00[ ]+nopw[
> ]+%cs:0x0\(%eax,%eax,1\)
> -[ ]*34:[ ]+0f 1f 00[ ]+nopl[ ]+\(%eax\)
> -[ ]*37:[ ]+0f 1f c0[ ]+nop[ ]+%eax
> -[ ]*3a:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
> -[ ]*3e:[ ]+0f 1f 00[ ]+nopl[ ]+\(%eax\)
> -[ ]*41:[ ]+66 0f 1f 00[ ]+nopw[ ]+\(%eax\)
> -[ ]*45:[ ]+0f 1f c0[ ]+nop[ ]+%eax
> -[ ]*48:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
> +0+ <.text>:
> +[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%eax\)
> +[ ]*[a-f0-9]+: 0f 1f 40 00           nopl   0x0\(%eax\)
> +[ ]*[a-f0-9]+: 0f 1f 44 00 00       nopl
0x0\(%eax,%eax,1\)
> +[ ]*[a-f0-9]+: 66 0f 1f 44 00 00     nopw
0x0\(%eax,%eax,1\)

> +[ ]*[a-f0-9]+: 0f 1f 80 00 00 00 00 nopl   0x0\(%eax\)
> +[ ]*[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl
> 0x0\(%eax,%eax,1\)
> +[ ]*[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw
> 0x0\(%eax,%eax,1\)
> +[ ]*[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw
> %cs:0x0\(%eax,%eax,1\)
> +[ ]*[a-f0-9]+: 0f 19 ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1a ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1b ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1c ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1d ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1e ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1f ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 19 5a 22           nopl   0x22\(%edx\)
> +[ ]*[a-f0-9]+: 0f 1a 5a 22           nopl   0x22\(%edx\)
> +[ ]*[a-f0-9]+: 0f 1b 5a 22           nopl   0x22\(%edx\)
> +[ ]*[a-f0-9]+: 0f 1c 5a 22           nopl   0x22\(%edx\)
> +[ ]*[a-f0-9]+: 0f 1d 5a 22           nopl   0x22\(%edx\)
> +[ ]*[a-f0-9]+: 0f 1e 5a 22           nopl   0x22\(%edx\)
> +[ ]*[a-f0-9]+: 0f 1f 5a 22           nopl   0x22\(%edx\)
> +[ ]*[a-f0-9]+: 0f 19 9c 1d 11 22 33 44 nopl
> 0x44332211\(%ebp,%ebx,1\)
> +[ ]*[a-f0-9]+: 0f 1a 9c 1d 11 22 33 44 nopl
> 0x44332211\(%ebp,%ebx,1\)
> +[ ]*[a-f0-9]+: 0f 1b 9c 1d 11 22 33 44 nopl
> 0x44332211\(%ebp,%ebx,1\)
> +[ ]*[a-f0-9]+: 0f 1c 9c 1d 11 22 33 44 nopl
> 0x44332211\(%ebp,%ebx,1\)
> +[ ]*[a-f0-9]+: 0f 1d 9c 1d 11 22 33 44 nopl
> 0x44332211\(%ebp,%ebx,1\)
> +[ ]*[a-f0-9]+: 0f 1e 9c 1d 11 22 33 44 nopl
> 0x44332211\(%ebp,%ebx,1\)
> +[ ]*[a-f0-9]+: 0f 1f 9c 1d 11 22 33 44 nopl
> 0x44332211\(%ebp,%ebx,1\)
> +[ ]*[a-f0-9]+: 0f 19 04 60           nopl   \(%eax,%eiz,2\)
> +[ ]*[a-f0-9]+: 0f 1a 04 60           nopl   \(%eax,%eiz,2\)
> +[ ]*[a-f0-9]+: 0f 1b 04 60           nopl   \(%eax,%eiz,2\)
> +[ ]*[a-f0-9]+: 0f 1c 04 60           nopl   \(%eax,%eiz,2\)
> +[ ]*[a-f0-9]+: 0f 1d 04 60           nopl   \(%eax,%eiz,2\)
> +[ ]*[a-f0-9]+: 0f 1e 04 60           nopl   \(%eax,%eiz,2\)
> +[ ]*[a-f0-9]+: 0f 1f 04 60           nopl   \(%eax,%eiz,2\)
> +[ ]*[a-f0-9]+: 0f 19 04 59           nopl   \(%ecx,%ebx,2\)
> +[ ]*[a-f0-9]+: 0f 1a 04 59           nopl   \(%ecx,%ebx,2\)
> +[ ]*[a-f0-9]+: 0f 1b 04 59           nopl   \(%ecx,%ebx,2\)
> +[ ]*[a-f0-9]+: 0f 1c 04 59           nopl   \(%ecx,%ebx,2\)
> +[ ]*[a-f0-9]+: 0f 1d 04 59           nopl   \(%ecx,%ebx,2\)
> +[ ]*[a-f0-9]+: 0f 1e 04 59           nopl   \(%ecx,%ebx,2\)
> +[ ]*[a-f0-9]+: 0f 1f 04 59           nopl   \(%ecx,%ebx,2\)
> +[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%eax\)
> +[ ]*[a-f0-9]+: 0f 1f c0             nop    %eax
> +[ ]*[a-f0-9]+: 66 0f 1f c0           nop    %ax
> +[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%eax\)
> +[ ]*[a-f0-9]+: 66 0f 1f 00           nopw   \(%eax\)
> +[ ]*[a-f0-9]+: 0f 1f c0             nop    %eax
> +[ ]*[a-f0-9]+: 66 0f 1f c0           nop    %ax
>  #pass
> --- binutils/gas/testsuite/gas/i386/nops.s.nop 2007-03-22
> 06:57:27.000000000 -0700
> +++ binutils/gas/testsuite/gas/i386/nops.s 2008-01-10
> 06:35:11.000000000 -0800
> @@ -9,6 +9,49 @@
>   .byte 0x66, 0x0f, 0x1f, 0x84, 0x0,  0x0, 0x0, 0x0, 0x0
>   .byte 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0
>
> + # reg,reg
> + .byte 0x0f, 0x19, 0xff
> + .byte 0x0f, 0x1a, 0xff
> + .byte 0x0f, 0x1b, 0xff
> + .byte 0x0f, 0x1c, 0xff
> + .byte 0x0f, 0x1d, 0xff
> + .byte 0x0f, 0x1e, 0xff
> + .byte 0x0f, 0x1f, 0xff
> +
> + # with base and imm8
> + .byte 0x0f, 0x19, 0x5A, 0x22
> + .byte 0x0f, 0x1a, 0x5A, 0x22
> + .byte 0x0f, 0x1b, 0x5A, 0x22
> + .byte 0x0f, 0x1c, 0x5A, 0x22
> + .byte 0x0f, 0x1d, 0x5A, 0x22
> + .byte 0x0f, 0x1e, 0x5A, 0x22
> + .byte 0x0f, 0x1f, 0x5A, 0x22
> +
> + # with sib and imm32
> + .byte 0x0f, 0x19, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1a, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1b, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1c, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1d, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1e, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1f, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> +
> + .byte 0x0f, 0x19, 0x04, 0x60
> + .byte 0x0f, 0x1a, 0x04, 0x60
> + .byte 0x0f, 0x1b, 0x04, 0x60
> + .byte 0x0f, 0x1c, 0x04, 0x60
> + .byte 0x0f, 0x1d, 0x04, 0x60
> + .byte 0x0f, 0x1e, 0x04, 0x60
> + .byte 0x0f, 0x1f, 0x04, 0x60
> +
> + .byte 0x0f, 0x19, 0x04, 0x59
> + .byte 0x0f, 0x1a, 0x04, 0x59
> + .byte 0x0f, 0x1b, 0x04, 0x59
> + .byte 0x0f, 0x1c, 0x04, 0x59
> + .byte 0x0f, 0x1d, 0x04, 0x59
> + .byte 0x0f, 0x1e, 0x04, 0x59
> + .byte 0x0f, 0x1f, 0x04, 0x59
> +
>   nop (%eax)
>   nop %eax
>   nop %ax
> @@ -16,5 +59,3 @@
>   nopw (%eax)
>   nopl %eax
>   nopw %ax
> -
> - .p2align 4
> --- binutils/gas/testsuite/gas/i386/x86-64-nops.d.nop 2007-03-22
> 06:57:27.000000000 -0700
> +++ binutils/gas/testsuite/gas/i386/x86-64-nops.d 2008-01-10
> 06:38:41.000000000 -0800
> @@ -5,33 +5,68 @@
>
>  Disassembly of section .text:
>
> -0+000 <.text>:
> -[ ]*0:[ ]+0f 1f 00[ ]+nopl[ ]+\(%rax\)
> -[ ]*3:[ ]+0f 1f 40 00[ ]+nopl[ ]+0x0\(%rax\)
> -[ ]*7:[ ]+0f 1f 44 00 00[ ]+nopl[
]+0x0\(%rax,%rax,1\)
> -[ ]*c:[ ]+66 0f 1f 44 00 00[ ]+nopw[
]+0x0\(%rax,%rax,1\)
> -[ ]*12:[ ]+0f 1f 80 00 00 00 00[ ]+nopl[
]+0x0\(%rax\)

> -[ ]*19:[ ]+0f 1f 84 00 00 00 00 00[ ]+nopl[
> ]+0x0\(%rax,%rax,1\)
> -[ ]*21:[ ]+66 0f 1f 84 00 00 00 00 00[ ]+nopw[
> ]+0x0\(%rax,%rax,1\)
> -[ ]*2a:[ ]+66 2e 0f 1f 84 00 00 00 00 00[ ]+nopw[
> ]+%cs:0x0\(%rax,%rax,1\)
> -[ ]*34:[ ]+0f 1f 00[ ]+nopl[ ]+\(%rax\)
> -[ ]*37:[ ]+48 0f 1f c0[ ]+nop[ ]+%rax
> -[ ]*3b:[ ]+0f 1f c0[ ]+nop[ ]+%eax
> -[ ]*3e:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
> -[ ]*42:[ ]+48 0f 1f 00[ ]+nopq[ ]+\(%rax\)
> -[ ]*46:[ ]+0f 1f 00[ ]+nopl[ ]+\(%rax\)
> -[ ]*49:[ ]+66 0f 1f 00[ ]+nopw[ ]+\(%rax\)
> -[ ]*4d:[ ]+48 0f 1f c0[ ]+nop[ ]+%rax
> -[ ]*51:[ ]+0f 1f c0[ ]+nop[ ]+%eax
> -[ ]*54:[ ]+66 0f 1f c0[ ]+nop[ ]+%ax
> -[ ]*58:[ ]+41 0f 1f 02[ ]+nopl[ ]+\(%r10\)
> -[ ]*5c:[ ]+49 0f 1f c2[ ]+nop[ ]+%r10
> -[ ]*60:[ ]+41 0f 1f c2[ ]+nop[ ]+%r10d
> -[ ]*64:[ ]+66 41 0f 1f c2[ ]+nop[ ]+%r10w
> -[ ]*69:[ ]+49 0f 1f 02[ ]+nopq[ ]+\(%r10\)
> -[ ]*6d:[ ]+41 0f 1f 02[ ]+nopl[ ]+\(%r10\)
> -[ ]*71:[ ]+66 41 0f 1f 02[ ]+nopw[ ]+\(%r10\)
> -[ ]*76:[ ]+49 0f 1f c2[ ]+nop[ ]+%r10
> -[ ]*7a:[ ]+41 0f 1f c2[ ]+nop[ ]+%r10d
> -[ ]*7e:[ ]+66 41 0f 1f c2[ ]+nop[ ]+%r10w
> +0+ <.text>:
> +[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%rax\)
> +[ ]*[a-f0-9]+: 0f 1f 40 00           nopl   0x0\(%rax\)
> +[ ]*[a-f0-9]+: 0f 1f 44 00 00       nopl
0x0\(%rax,%rax,1\)
> +[ ]*[a-f0-9]+: 66 0f 1f 44 00 00     nopw
0x0\(%rax,%rax,1\)

> +[ ]*[a-f0-9]+: 0f 1f 80 00 00 00 00 nopl   0x0\(%rax\)
> +[ ]*[a-f0-9]+: 0f 1f 84 00 00 00 00 00 nopl
> 0x0\(%rax,%rax,1\)
> +[ ]*[a-f0-9]+: 66 0f 1f 84 00 00 00 00 00 nopw
> 0x0\(%rax,%rax,1\)
> +[ ]*[a-f0-9]+: 66 2e 0f 1f 84 00 00 00 00 00 nopw
> %cs:0x0\(%rax,%rax,1\)
> +[ ]*[a-f0-9]+: 0f 19 ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1a ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1b ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1c ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1d ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1e ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 1f ff             nop    %edi
> +[ ]*[a-f0-9]+: 0f 19 5a 22           nopl   0x22\(%rdx\)
> +[ ]*[a-f0-9]+: 0f 1a 5a 22           nopl   0x22\(%rdx\)
> +[ ]*[a-f0-9]+: 0f 1b 5a 22           nopl   0x22\(%rdx\)
> +[ ]*[a-f0-9]+: 0f 1c 5a 22           nopl   0x22\(%rdx\)
> +[ ]*[a-f0-9]+: 0f 1d 5a 22           nopl   0x22\(%rdx\)
> +[ ]*[a-f0-9]+: 0f 1e 5a 22           nopl   0x22\(%rdx\)
> +[ ]*[a-f0-9]+: 0f 1f 5a 22           nopl   0x22\(%rdx\)
> +[ ]*[a-f0-9]+: 0f 19 9c 1d 11 22 33 44 nopl
> 0x44332211\(%rbp,%rbx,1\)
> +[ ]*[a-f0-9]+: 0f 1a 9c 1d 11 22 33 44 nopl
> 0x44332211\(%rbp,%rbx,1\)
> +[ ]*[a-f0-9]+: 0f 1b 9c 1d 11 22 33 44 nopl
> 0x44332211\(%rbp,%rbx,1\)
> +[ ]*[a-f0-9]+: 0f 1c 9c 1d 11 22 33 44 nopl
> 0x44332211\(%rbp,%rbx,1\)
> +[ ]*[a-f0-9]+: 0f 1d 9c 1d 11 22 33 44 nopl
> 0x44332211\(%rbp,%rbx,1\)
> +[ ]*[a-f0-9]+: 0f 1e 9c 1d 11 22 33 44 nopl
> 0x44332211\(%rbp,%rbx,1\)
> +[ ]*[a-f0-9]+: 0f 1f 9c 1d 11 22 33 44 nopl
> 0x44332211\(%rbp,%rbx,1\)
> +[ ]*[a-f0-9]+: 0f 19 04 60           nopl   \(%rax,%riz,2\)
> +[ ]*[a-f0-9]+: 0f 1a 04 60           nopl   \(%rax,%riz,2\)
> +[ ]*[a-f0-9]+: 0f 1b 04 60           nopl   \(%rax,%riz,2\)
> +[ ]*[a-f0-9]+: 0f 1c 04 60           nopl   \(%rax,%riz,2\)
> +[ ]*[a-f0-9]+: 0f 1d 04 60           nopl   \(%rax,%riz,2\)
> +[ ]*[a-f0-9]+: 0f 1e 04 60           nopl   \(%rax,%riz,2\)
> +[ ]*[a-f0-9]+: 0f 1f 04 60           nopl   \(%rax,%riz,2\)
> +[ ]*[a-f0-9]+: 0f 19 04 59           nopl   \(%rcx,%rbx,2\)
> +[ ]*[a-f0-9]+: 0f 1a 04 59           nopl   \(%rcx,%rbx,2\)
> +[ ]*[a-f0-9]+: 0f 1b 04 59           nopl   \(%rcx,%rbx,2\)
> +[ ]*[a-f0-9]+: 0f 1c 04 59           nopl   \(%rcx,%rbx,2\)
> +[ ]*[a-f0-9]+: 0f 1d 04 59           nopl   \(%rcx,%rbx,2\)
> +[ ]*[a-f0-9]+: 0f 1e 04 59           nopl   \(%rcx,%rbx,2\)
> +[ ]*[a-f0-9]+: 0f 1f 04 59           nopl   \(%rcx,%rbx,2\)
> +[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%rax\)
> +[ ]*[a-f0-9]+: 48 0f 1f c0           nop    %rax
> +[ ]*[a-f0-9]+: 0f 1f c0             nop    %eax
> +[ ]*[a-f0-9]+: 66 0f 1f c0           nop    %ax
> +[ ]*[a-f0-9]+: 48 0f 1f 00           nopq   \(%rax\)
> +[ ]*[a-f0-9]+: 0f 1f 00             nopl   \(%rax\)
> +[ ]*[a-f0-9]+: 66 0f 1f 00           nopw   \(%rax\)
> +[ ]*[a-f0-9]+: 48 0f 1f c0           nop    %rax
> +[ ]*[a-f0-9]+: 0f 1f c0             nop    %eax
> +[ ]*[a-f0-9]+: 66 0f 1f c0           nop    %ax
> +[ ]*[a-f0-9]+: 41 0f 1f 02           nopl   \(%r10\)
> +[ ]*[a-f0-9]+: 49 0f 1f c2           nop    %r10
> +[ ]*[a-f0-9]+: 41 0f 1f c2           nop    %r10d
> +[ ]*[a-f0-9]+: 66 41 0f 1f c2       nop    %r10w
> +[ ]*[a-f0-9]+: 49 0f 1f 02           nopq   \(%r10\)
> +[ ]*[a-f0-9]+: 41 0f 1f 02           nopl   \(%r10\)
> +[ ]*[a-f0-9]+: 66 41 0f 1f 02       nopw   \(%r10\)
> +[ ]*[a-f0-9]+: 49 0f 1f c2           nop    %r10
> +[ ]*[a-f0-9]+: 41 0f 1f c2           nop    %r10d
> +[ ]*[a-f0-9]+: 66 41 0f 1f c2       nop    %r10w
>  #pass
> --- binutils/gas/testsuite/gas/i386/x86-64-nops.s.nop 2007-03-22
> 06:57:27.000000000 -0700
> +++ binutils/gas/testsuite/gas/i386/x86-64-nops.s 2008-01-10
> 06:35:28.000000000 -0800
> @@ -9,6 +9,49 @@
>   .byte 0x66, 0x0f, 0x1f, 0x84, 0x0,  0x0, 0x0, 0x0, 0x0
>   .byte 0x66, 0x2e, 0x0f, 0x1f, 0x84, 0x0, 0x0, 0x0, 0x0, 0x0
>
> + # reg,reg
> + .byte 0x0f, 0x19, 0xff
> + .byte 0x0f, 0x1a, 0xff
> + .byte 0x0f, 0x1b, 0xff
> + .byte 0x0f, 0x1c, 0xff
> + .byte 0x0f, 0x1d, 0xff
> + .byte 0x0f, 0x1e, 0xff
> + .byte 0x0f, 0x1f, 0xff
> +
> + # with base and imm8
> + .byte 0x0f, 0x19, 0x5A, 0x22
> + .byte 0x0f, 0x1a, 0x5A, 0x22
> + .byte 0x0f, 0x1b, 0x5A, 0x22
> + .byte 0x0f, 0x1c, 0x5A, 0x22
> + .byte 0x0f, 0x1d, 0x5A, 0x22
> + .byte 0x0f, 0x1e, 0x5A, 0x22
> + .byte 0x0f, 0x1f, 0x5A, 0x22
> +
> + # with sib and imm32
> + .byte 0x0f, 0x19, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1a, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1b, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1c, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1d, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1e, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> + .byte 0x0f, 0x1f, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
> +
> + .byte 0x0f, 0x19, 0x04, 0x60
> + .byte 0x0f, 0x1a, 0x04, 0x60
> + .byte 0x0f, 0x1b, 0x04, 0x60
> + .byte 0x0f, 0x1c, 0x04, 0x60
> + .byte 0x0f, 0x1d, 0x04, 0x60
> + .byte 0x0f, 0x1e, 0x04, 0x60
> + .byte 0x0f, 0x1f, 0x04, 0x60
> +
> + .byte 0x0f, 0x19, 0x04, 0x59
> + .byte 0x0f, 0x1a, 0x04, 0x59
> + .byte 0x0f, 0x1b, 0x04, 0x59
> + .byte 0x0f, 0x1c, 0x04, 0x59
> + .byte 0x0f, 0x1d, 0x04, 0x59
> + .byte 0x0f, 0x1e, 0x04, 0x59
> + .byte 0x0f, 0x1f, 0x04, 0x59
> +
>   nop (%rax)
>   nop %rax
>   nop %eax
> @@ -29,5 +72,3 @@
>   nopq %r10
>   nopl %r10d
>   nopw %r10w
> -
> - .p2align 4
> --- binutils/opcodes/i386-dis.c.nop 2007-12-31 07:44:57.000000000
-0800
> +++ binutils/opcodes/i386-dis.c 2008-01-10 06:32:26.000000000
-0800

> @@ -491,8 +491,8 @@ fetch_data (struct disassemble_info *inf
>  #define REG_FF (REG_FE + 1)
>  #define REG_0F00 (REG_FF + 1)
>  #define REG_0F01 (REG_0F00 + 1)
> -#define REG_0F0E (REG_0F01 + 1)
> -#define REG_0F18 (REG_0F0E + 1)
> +#define REG_0F0D (REG_0F01 + 1)
> +#define REG_0F18 (REG_0F0D + 1)
>  #define REG_0F71 (REG_0F18 + 1)
>  #define REG_0F72 (REG_0F71 + 1)
>  #define REG_0F73 (REG_0F72 + 1)
> @@ -1067,7 +1067,7 @@ static const struct dis386 dis386_twobyt
>    { "(bad)", { XX } },
>    { "ud2a", { XX } },
>    { "(bad)", { XX } },
> -  { REG_TABLE (REG_0F0E) },
> +  { REG_TABLE (REG_0F0D) },
>    { "femms", { XX } },
>    { "", { MX, EM, OPSUF } }, /* See
OP_3DNowSuffix.  */

>    /* 10 */
> @@ -1081,12 +1081,12 @@ static const struct dis386 dis386_twobyt
>    { MOD_TABLE (MOD_0F17) },
>    /* 18 */
>    { REG_TABLE (REG_0F18) },
> -  { "(bad)", { XX } },
> -  { "(bad)", { XX } },
> -  { "(bad)", { XX } },
> -  { "(bad)", { XX } },
> -  { "(bad)", { XX } },
> -  { "(bad)", { XX } },
> +  { "nopQ", { Ev } },
> +  { "nopQ", { Ev } },
> +  { "nopQ", { Ev } },
> +  { "nopQ", { Ev } },
> +  { "nopQ", { Ev } },
> +  { "nopQ", { Ev } },
>    { "nopQ", { Ev } },
>    /* 20 */
>    { MOD_TABLE (MOD_0F20) },
> @@ -1369,7 +1369,7 @@ static const unsigned char twobyte_has_m
>    /*       0 1 2 3 4 5 6 7 8 9 a b c d e f        */
>    /*       -------------------------------        */
>    /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
> -  /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1, /* 1f */
> +  /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
>    /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
>    /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
>    /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
> @@ -1679,7 +1679,7 @@ static const struct dis386 reg_table[][8
>      { "lmsw", { Ew } },
>      { MOD_TABLE (MOD_0F01_REG_7) },
>    },
> -  /* REG_0F0E */
> +  /* REG_0F0D */
>    {
>      { "prefetch", { Eb } },
>      { "prefetchw", { Eb } },
>