diff options
-rw-r--r-- | gas/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/sib-intel.d | 32 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/sib.d | 32 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/sib.s | 33 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-sib-intel.d | 32 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-sib.d | 32 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-sib.s | 33 | ||||
-rw-r--r-- | opcodes/ChangeLog | 4 | ||||
-rw-r--r-- | opcodes/i386-dis.c | 12 |
9 files changed, 219 insertions, 1 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 279a5d8..37f054c 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,5 +1,15 @@ 2007-09-20 H.J. Lu <hongjiu.lu@intel.com> + * gas/i386/sib.s: Add more eiz tests. + * gas/i386/x86-64-sib.s: Add more riz tests. + + * gas/i386/sib-intel.d: Updated. + * gas/i386/sib.d: Likewise. + * gas/i386/x86-64-sib-intel.d: Likewise. + * gas/i386/x86-64-sib.d: Likewise. + +2007-09-20 H.J. Lu <hongjiu.lu@intel.com> + PR 658 * gas/i386/i386.exp: Run sib-intel, x86-64-sib and x86-64-sib-intel. diff --git a/gas/testsuite/gas/i386/sib-intel.d b/gas/testsuite/gas/i386/sib-intel.d index 707f74a..27709eb 100644 --- a/gas/testsuite/gas/i386/sib-intel.d +++ b/gas/testsuite/gas/i386/sib-intel.d @@ -7,13 +7,45 @@ Disassembly of section .text: 0+ <foo>: +[ ]*[a-f0-9]+: 8b 1d e2 ff ff ff mov ebx,DWORD PTR ds:0xffffffe2 +[ ]*[a-f0-9]+: 8b 1c 25 e2 ff ff ff mov ebx,DWORD PTR \[eiz\*1-0x1e\] +[ ]*[a-f0-9]+: 8b 04 25 e2 ff ff ff mov eax,DWORD PTR \[eiz\*1-0x1e\] +[ ]*[a-f0-9]+: 8b 04 65 e2 ff ff ff mov eax,DWORD PTR \[eiz\*2-0x1e\] +[ ]*[a-f0-9]+: 8b 04 a5 e2 ff ff ff mov eax,DWORD PTR \[eiz\*4-0x1e\] +[ ]*[a-f0-9]+: 8b 04 e5 e2 ff ff ff mov eax,DWORD PTR \[eiz\*8-0x1e\] +[ ]*[a-f0-9]+: a1 1e 00 00 00 mov eax,ds:0x1e +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov eax,DWORD PTR \[eiz\*1\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov eax,DWORD PTR \[eiz\*1\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 65 1e 00 00 00 mov eax,DWORD PTR \[eiz\*2\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 a5 1e 00 00 00 mov eax,DWORD PTR \[eiz\*4\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 e5 1e 00 00 00 mov eax,DWORD PTR \[eiz\*8\+0x1e\] [ ]*[a-f0-9]+: 8b 03 mov eax,DWORD PTR \[ebx\] [ ]*[a-f0-9]+: 8b 04 23 mov eax,DWORD PTR \[ebx\+eiz\*1\] +[ ]*[a-f0-9]+: 8b 04 23 mov eax,DWORD PTR \[ebx\+eiz\*1\] +[ ]*[a-f0-9]+: 8b 04 63 mov eax,DWORD PTR \[ebx\+eiz\*2\] +[ ]*[a-f0-9]+: 8b 04 a3 mov eax,DWORD PTR \[ebx\+eiz\*4\] +[ ]*[a-f0-9]+: 8b 04 e3 mov eax,DWORD PTR \[ebx\+eiz\*8\] +[ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[esp\] +[ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[esp\] +[ ]*[a-f0-9]+: 8b 04 64 mov eax,DWORD PTR \[esp\+eiz\*2\] +[ ]*[a-f0-9]+: 8b 04 a4 mov eax,DWORD PTR \[esp\+eiz\*4\] +[ ]*[a-f0-9]+: 8b 04 e4 mov eax,DWORD PTR \[esp\+eiz\*8\] +[ ]*[a-f0-9]+: 8b 04 25 e2 ff ff ff mov eax,DWORD PTR \[eiz\*1-0x1e\] +[ ]*[a-f0-9]+: 8b 04 65 e2 ff ff ff mov eax,DWORD PTR \[eiz\*2-0x1e\] +[ ]*[a-f0-9]+: 8b 04 a5 e2 ff ff ff mov eax,DWORD PTR \[eiz\*4-0x1e\] +[ ]*[a-f0-9]+: 8b 04 e5 e2 ff ff ff mov eax,DWORD PTR \[eiz\*8-0x1e\] +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov eax,DWORD PTR \[eiz\*1\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 65 1e 00 00 00 mov eax,DWORD PTR \[eiz\*2\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 a5 1e 00 00 00 mov eax,DWORD PTR \[eiz\*4\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 e5 1e 00 00 00 mov eax,DWORD PTR \[eiz\*8\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 23 mov eax,DWORD PTR \[ebx\+eiz\*1\] +[ ]*[a-f0-9]+: 8b 04 23 mov eax,DWORD PTR \[ebx\+eiz\*1\] [ ]*[a-f0-9]+: 8b 04 63 mov eax,DWORD PTR \[ebx\+eiz\*2\] [ ]*[a-f0-9]+: 8b 04 a3 mov eax,DWORD PTR \[ebx\+eiz\*4\] [ ]*[a-f0-9]+: 8b 04 e3 mov eax,DWORD PTR \[ebx\+eiz\*8\] [ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[esp\] [ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[esp\] +[ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[esp\] [ ]*[a-f0-9]+: 8b 04 64 mov eax,DWORD PTR \[esp\+eiz\*2\] [ ]*[a-f0-9]+: 8b 04 a4 mov eax,DWORD PTR \[esp\+eiz\*4\] [ ]*[a-f0-9]+: 8b 04 e4 mov eax,DWORD PTR \[esp\+eiz\*8\] diff --git a/gas/testsuite/gas/i386/sib.d b/gas/testsuite/gas/i386/sib.d index 574a308..0ece418 100644 --- a/gas/testsuite/gas/i386/sib.d +++ b/gas/testsuite/gas/i386/sib.d @@ -6,13 +6,45 @@ Disassembly of section .text: 0+ <foo>: +[ ]*[a-f0-9]+: 8b 1d e2 ff ff ff mov 0xffffffe2,%ebx +[ ]*[a-f0-9]+: 8b 1c 25 e2 ff ff ff mov -0x1e\(,%eiz,1\),%ebx +[ ]*[a-f0-9]+: 8b 04 25 e2 ff ff ff mov -0x1e\(,%eiz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 65 e2 ff ff ff mov -0x1e\(,%eiz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a5 e2 ff ff ff mov -0x1e\(,%eiz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e5 e2 ff ff ff mov -0x1e\(,%eiz,8\),%eax +[ ]*[a-f0-9]+: a1 1e 00 00 00 mov 0x1e,%eax +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov 0x1e\(,%eiz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov 0x1e\(,%eiz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 65 1e 00 00 00 mov 0x1e\(,%eiz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a5 1e 00 00 00 mov 0x1e\(,%eiz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e5 1e 00 00 00 mov 0x1e\(,%eiz,8\),%eax [ ]*[a-f0-9]+: 8b 03 mov \(%ebx\),%eax [ ]*[a-f0-9]+: 8b 04 23 mov \(%ebx,%eiz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 23 mov \(%ebx,%eiz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 63 mov \(%ebx,%eiz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a3 mov \(%ebx,%eiz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e3 mov \(%ebx,%eiz,8\),%eax +[ ]*[a-f0-9]+: 8b 04 24 mov \(%esp\),%eax +[ ]*[a-f0-9]+: 8b 04 24 mov \(%esp\),%eax +[ ]*[a-f0-9]+: 8b 04 64 mov \(%esp,%eiz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a4 mov \(%esp,%eiz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e4 mov \(%esp,%eiz,8\),%eax +[ ]*[a-f0-9]+: 8b 04 25 e2 ff ff ff mov -0x1e\(,%eiz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 65 e2 ff ff ff mov -0x1e\(,%eiz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a5 e2 ff ff ff mov -0x1e\(,%eiz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e5 e2 ff ff ff mov -0x1e\(,%eiz,8\),%eax +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov 0x1e\(,%eiz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 65 1e 00 00 00 mov 0x1e\(,%eiz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a5 1e 00 00 00 mov 0x1e\(,%eiz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e5 1e 00 00 00 mov 0x1e\(,%eiz,8\),%eax +[ ]*[a-f0-9]+: 8b 04 23 mov \(%ebx,%eiz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 23 mov \(%ebx,%eiz,1\),%eax [ ]*[a-f0-9]+: 8b 04 63 mov \(%ebx,%eiz,2\),%eax [ ]*[a-f0-9]+: 8b 04 a3 mov \(%ebx,%eiz,4\),%eax [ ]*[a-f0-9]+: 8b 04 e3 mov \(%ebx,%eiz,8\),%eax [ ]*[a-f0-9]+: 8b 04 24 mov \(%esp\),%eax [ ]*[a-f0-9]+: 8b 04 24 mov \(%esp\),%eax +[ ]*[a-f0-9]+: 8b 04 24 mov \(%esp\),%eax [ ]*[a-f0-9]+: 8b 04 64 mov \(%esp,%eiz,2\),%eax [ ]*[a-f0-9]+: 8b 04 a4 mov \(%esp,%eiz,4\),%eax [ ]*[a-f0-9]+: 8b 04 e4 mov \(%esp,%eiz,8\),%eax diff --git a/gas/testsuite/gas/i386/sib.s b/gas/testsuite/gas/i386/sib.s index f11d6d2..430da42 100644 --- a/gas/testsuite/gas/i386/sib.s +++ b/gas/testsuite/gas/i386/sib.s @@ -3,7 +3,20 @@ .text .allow_index_reg foo: + mov -30,%ebx + mov -30(,%eiz),%ebx + mov -30(,%eiz,1),%eax + mov -30(,%eiz,2),%eax + mov -30(,%eiz,4),%eax + mov -30(,%eiz,8),%eax + mov 30,%eax + mov 30(,%eiz),%eax + mov 30(,%eiz,1),%eax + mov 30(,%eiz,2),%eax + mov 30(,%eiz,4),%eax + mov 30(,%eiz,8),%eax mov (%ebx),%eax + mov (%ebx,%eiz),%eax mov (%ebx,%eiz,1),%eax mov (%ebx,%eiz,2),%eax mov (%ebx,%eiz,4),%eax @@ -13,4 +26,24 @@ foo: mov (%esp,%eiz,2),%eax mov (%esp,%eiz,4),%eax mov (%esp,%eiz,8),%eax + .intel_syntax noprefix + mov eax,DWORD PTR [eiz*1-30] + mov eax,DWORD PTR [eiz*2-30] + mov eax,DWORD PTR [eiz*4-30] + mov eax,DWORD PTR [eiz*8-30] + mov eax,DWORD PTR [eiz*1+30] + mov eax,DWORD PTR [eiz*2+30] + mov eax,DWORD PTR [eiz*4+30] + mov eax,DWORD PTR [eiz*8+30] + mov eax,DWORD PTR [ebx+eiz] + mov eax,DWORD PTR [ebx+eiz*1] + mov eax,DWORD PTR [ebx+eiz*2] + mov eax,DWORD PTR [ebx+eiz*4] + mov eax,DWORD PTR [ebx+eiz*8] + mov eax,DWORD PTR [esp] + mov eax,DWORD PTR [esp+eiz] + mov eax,DWORD PTR [esp+eiz*1] + mov eax,DWORD PTR [esp+eiz*2] + mov eax,DWORD PTR [esp+eiz*4] + mov eax,DWORD PTR [esp+eiz*8] .p2align 4 diff --git a/gas/testsuite/gas/i386/x86-64-sib-intel.d b/gas/testsuite/gas/i386/x86-64-sib-intel.d index 0dce66f..1ae72ea 100644 --- a/gas/testsuite/gas/i386/x86-64-sib-intel.d +++ b/gas/testsuite/gas/i386/x86-64-sib-intel.d @@ -8,13 +8,45 @@ Disassembly of section .text: 0+ <foo>: +[ ]*[a-f0-9]+: 8b 1c 25 e2 ff ff ff mov ebx,DWORD PTR ds:0xffffffffffffffe2 +[ ]*[a-f0-9]+: 8b 1c 25 e2 ff ff ff mov ebx,DWORD PTR ds:0xffffffffffffffe2 +[ ]*[a-f0-9]+: 8b 04 25 e2 ff ff ff mov eax,DWORD PTR ds:0xffffffffffffffe2 +[ ]*[a-f0-9]+: 8b 04 65 e2 ff ff ff mov eax,DWORD PTR \[riz\*2-0x1e\] +[ ]*[a-f0-9]+: 8b 04 a5 e2 ff ff ff mov eax,DWORD PTR \[riz\*4-0x1e\] +[ ]*[a-f0-9]+: 8b 04 e5 e2 ff ff ff mov eax,DWORD PTR \[riz\*8-0x1e\] +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov eax,DWORD PTR ds:0x1e +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov eax,DWORD PTR ds:0x1e +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov eax,DWORD PTR ds:0x1e +[ ]*[a-f0-9]+: 8b 04 65 1e 00 00 00 mov eax,DWORD PTR \[riz\*2\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 a5 1e 00 00 00 mov eax,DWORD PTR \[riz\*4\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 e5 1e 00 00 00 mov eax,DWORD PTR \[riz\*8\+0x1e\] [ ]*[a-f0-9]+: 8b 03 mov eax,DWORD PTR \[rbx\] [ ]*[a-f0-9]+: 8b 04 23 mov eax,DWORD PTR \[rbx\+riz\*1\] +[ ]*[a-f0-9]+: 8b 04 23 mov eax,DWORD PTR \[rbx\+riz\*1\] +[ ]*[a-f0-9]+: 8b 04 63 mov eax,DWORD PTR \[rbx\+riz\*2\] +[ ]*[a-f0-9]+: 8b 04 a3 mov eax,DWORD PTR \[rbx\+riz\*4\] +[ ]*[a-f0-9]+: 8b 04 e3 mov eax,DWORD PTR \[rbx\+riz\*8\] +[ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[rsp\] +[ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[rsp\] +[ ]*[a-f0-9]+: 8b 04 64 mov eax,DWORD PTR \[rsp\+riz\*2\] +[ ]*[a-f0-9]+: 8b 04 a4 mov eax,DWORD PTR \[rsp\+riz\*4\] +[ ]*[a-f0-9]+: 8b 04 e4 mov eax,DWORD PTR \[rsp\+riz\*8\] +[ ]*[a-f0-9]+: 8b 04 25 e2 ff ff ff mov eax,DWORD PTR ds:0xffffffffffffffe2 +[ ]*[a-f0-9]+: 8b 04 65 e2 ff ff ff mov eax,DWORD PTR \[riz\*2-0x1e\] +[ ]*[a-f0-9]+: 8b 04 a5 e2 ff ff ff mov eax,DWORD PTR \[riz\*4-0x1e\] +[ ]*[a-f0-9]+: 8b 04 e5 e2 ff ff ff mov eax,DWORD PTR \[riz\*8-0x1e\] +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov eax,DWORD PTR ds:0x1e +[ ]*[a-f0-9]+: 8b 04 65 1e 00 00 00 mov eax,DWORD PTR \[riz\*2\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 a5 1e 00 00 00 mov eax,DWORD PTR \[riz\*4\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 e5 1e 00 00 00 mov eax,DWORD PTR \[riz\*8\+0x1e\] +[ ]*[a-f0-9]+: 8b 04 23 mov eax,DWORD PTR \[rbx\+riz\*1\] +[ ]*[a-f0-9]+: 8b 04 23 mov eax,DWORD PTR \[rbx\+riz\*1\] [ ]*[a-f0-9]+: 8b 04 63 mov eax,DWORD PTR \[rbx\+riz\*2\] [ ]*[a-f0-9]+: 8b 04 a3 mov eax,DWORD PTR \[rbx\+riz\*4\] [ ]*[a-f0-9]+: 8b 04 e3 mov eax,DWORD PTR \[rbx\+riz\*8\] [ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[rsp\] [ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[rsp\] +[ ]*[a-f0-9]+: 8b 04 24 mov eax,DWORD PTR \[rsp\] [ ]*[a-f0-9]+: 8b 04 64 mov eax,DWORD PTR \[rsp\+riz\*2\] [ ]*[a-f0-9]+: 8b 04 a4 mov eax,DWORD PTR \[rsp\+riz\*4\] [ ]*[a-f0-9]+: 8b 04 e4 mov eax,DWORD PTR \[rsp\+riz\*8\] diff --git a/gas/testsuite/gas/i386/x86-64-sib.d b/gas/testsuite/gas/i386/x86-64-sib.d index 32e02be..f6d7315 100644 --- a/gas/testsuite/gas/i386/x86-64-sib.d +++ b/gas/testsuite/gas/i386/x86-64-sib.d @@ -7,13 +7,45 @@ Disassembly of section .text: 0+ <foo>: +[ ]*[a-f0-9]+: 8b 1c 25 e2 ff ff ff mov 0xffffffffffffffe2,%ebx +[ ]*[a-f0-9]+: 8b 1c 25 e2 ff ff ff mov 0xffffffffffffffe2,%ebx +[ ]*[a-f0-9]+: 8b 04 25 e2 ff ff ff mov 0xffffffffffffffe2,%eax +[ ]*[a-f0-9]+: 8b 04 65 e2 ff ff ff mov -0x1e\(,%riz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a5 e2 ff ff ff mov -0x1e\(,%riz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e5 e2 ff ff ff mov -0x1e\(,%riz,8\),%eax +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov 0x1e,%eax +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov 0x1e,%eax +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov 0x1e,%eax +[ ]*[a-f0-9]+: 8b 04 65 1e 00 00 00 mov 0x1e\(,%riz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a5 1e 00 00 00 mov 0x1e\(,%riz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e5 1e 00 00 00 mov 0x1e\(,%riz,8\),%eax [ ]*[a-f0-9]+: 8b 03 mov \(%rbx\),%eax [ ]*[a-f0-9]+: 8b 04 23 mov \(%rbx,%riz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 23 mov \(%rbx,%riz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 63 mov \(%rbx,%riz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a3 mov \(%rbx,%riz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e3 mov \(%rbx,%riz,8\),%eax +[ ]*[a-f0-9]+: 8b 04 24 mov \(%rsp\),%eax +[ ]*[a-f0-9]+: 8b 04 24 mov \(%rsp\),%eax +[ ]*[a-f0-9]+: 8b 04 64 mov \(%rsp,%riz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a4 mov \(%rsp,%riz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e4 mov \(%rsp,%riz,8\),%eax +[ ]*[a-f0-9]+: 8b 04 25 e2 ff ff ff mov 0xffffffffffffffe2,%eax +[ ]*[a-f0-9]+: 8b 04 65 e2 ff ff ff mov -0x1e\(,%riz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a5 e2 ff ff ff mov -0x1e\(,%riz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e5 e2 ff ff ff mov -0x1e\(,%riz,8\),%eax +[ ]*[a-f0-9]+: 8b 04 25 1e 00 00 00 mov 0x1e,%eax +[ ]*[a-f0-9]+: 8b 04 65 1e 00 00 00 mov 0x1e\(,%riz,2\),%eax +[ ]*[a-f0-9]+: 8b 04 a5 1e 00 00 00 mov 0x1e\(,%riz,4\),%eax +[ ]*[a-f0-9]+: 8b 04 e5 1e 00 00 00 mov 0x1e\(,%riz,8\),%eax +[ ]*[a-f0-9]+: 8b 04 23 mov \(%rbx,%riz,1\),%eax +[ ]*[a-f0-9]+: 8b 04 23 mov \(%rbx,%riz,1\),%eax [ ]*[a-f0-9]+: 8b 04 63 mov \(%rbx,%riz,2\),%eax [ ]*[a-f0-9]+: 8b 04 a3 mov \(%rbx,%riz,4\),%eax [ ]*[a-f0-9]+: 8b 04 e3 mov \(%rbx,%riz,8\),%eax [ ]*[a-f0-9]+: 8b 04 24 mov \(%rsp\),%eax [ ]*[a-f0-9]+: 8b 04 24 mov \(%rsp\),%eax +[ ]*[a-f0-9]+: 8b 04 24 mov \(%rsp\),%eax [ ]*[a-f0-9]+: 8b 04 64 mov \(%rsp,%riz,2\),%eax [ ]*[a-f0-9]+: 8b 04 a4 mov \(%rsp,%riz,4\),%eax [ ]*[a-f0-9]+: 8b 04 e4 mov \(%rsp,%riz,8\),%eax diff --git a/gas/testsuite/gas/i386/x86-64-sib.s b/gas/testsuite/gas/i386/x86-64-sib.s index 26ab395..38f4241 100644 --- a/gas/testsuite/gas/i386/x86-64-sib.s +++ b/gas/testsuite/gas/i386/x86-64-sib.s @@ -3,7 +3,20 @@ .text .allow_index_reg foo: + mov -30,%ebx + mov -30(,%riz),%ebx + mov -30(,%riz,1),%eax + mov -30(,%riz,2),%eax + mov -30(,%riz,4),%eax + mov -30(,%riz,8),%eax + mov 30,%eax + mov 30(,%riz),%eax + mov 30(,%riz,1),%eax + mov 30(,%riz,2),%eax + mov 30(,%riz,4),%eax + mov 30(,%riz,8),%eax mov (%rbx),%eax + mov (%rbx,%riz),%eax mov (%rbx,%riz,1),%eax mov (%rbx,%riz,2),%eax mov (%rbx,%riz,4),%eax @@ -13,4 +26,24 @@ foo: mov (%rsp,%riz,2),%eax mov (%rsp,%riz,4),%eax mov (%rsp,%riz,8),%eax + .intel_syntax noprefix + mov eax,DWORD PTR [riz*1-30] + mov eax,DWORD PTR [riz*2-30] + mov eax,DWORD PTR [riz*4-30] + mov eax,DWORD PTR [riz*8-30] + mov eax,DWORD PTR [riz*1+30] + mov eax,DWORD PTR [riz*2+30] + mov eax,DWORD PTR [riz*4+30] + mov eax,DWORD PTR [riz*8+30] + mov eax,DWORD PTR [rbx+riz] + mov eax,DWORD PTR [rbx+riz*1] + mov eax,DWORD PTR [rbx+riz*2] + mov eax,DWORD PTR [rbx+riz*4] + mov eax,DWORD PTR [rbx+riz*8] + mov eax,DWORD PTR [rsp] + mov eax,DWORD PTR [rsp+riz] + mov eax,DWORD PTR [rsp+riz*1] + mov eax,DWORD PTR [rsp+riz*2] + mov eax,DWORD PTR [rsp+riz*4] + mov eax,DWORD PTR [rsp+riz*8] .p2align 4 diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 88be05e..584e24c 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,5 +1,9 @@ 2007-09-20 H.J. Lu <hongjiu.lu@intel.com> + * i386-dis.c (OP_E_extended): Display eiz for [eiz*1 + offset]. + +2007-09-20 H.J. Lu <hongjiu.lu@intel.com> + PR 658 * 386-dis.c (index64): New. (index32): Likewise. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 9a45e91..ecb428f 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -6314,6 +6314,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex) int havesib; int havebase; int haveindex; + int needindex; int base; int index = 0; int scale = 0; @@ -6368,7 +6369,15 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex) break; } - havedisp = havebase || (havesib && (haveindex || scale != 0)); + /* In 32bit mode, we need index register to tell [offset] from + [eiz*1 + offset]. */ + needindex = (havesib + && !havebase + && !haveindex + && address_mode == mode_32bit); + havedisp = (havebase + || needindex + || (havesib && (haveindex || scale != 0))); if (!intel_syntax) if (modrm.mod != 0 || (base & 7) == 5) @@ -6402,6 +6411,7 @@ OP_E_extended (int bytemode, int sizeflag, int has_drex) /* ESP/RSP won't allow index. If base isn't ESP/RSP, print index to tell base + index from base. */ if (scale != 0 + || needindex || haveindex || (havebase && base != ESP_REG_NUM)) { |