From 20afcfb756e30b8fa84544ff141dc14364ffbcc5 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 20 Sep 2007 20:13:26 +0000 Subject: [PATCH] gas/testsuite/ 2007-09-20 H.J. Lu * 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. opcodes/ 2007-09-20 H.J. Lu * i386-dis.c (OP_E_extended): Display eiz for [eiz*1 + offset]. --- gas/testsuite/ChangeLog | 10 +++++++ gas/testsuite/gas/i386/sib-intel.d | 32 ++++++++++++++++++++++ gas/testsuite/gas/i386/sib.d | 32 ++++++++++++++++++++++ gas/testsuite/gas/i386/sib.s | 33 +++++++++++++++++++++++ gas/testsuite/gas/i386/x86-64-sib-intel.d | 32 ++++++++++++++++++++++ gas/testsuite/gas/i386/x86-64-sib.d | 32 ++++++++++++++++++++++ gas/testsuite/gas/i386/x86-64-sib.s | 33 +++++++++++++++++++++++ opcodes/ChangeLog | 4 +++ opcodes/i386-dis.c | 12 ++++++++- 9 files changed, 219 insertions(+), 1 deletion(-) diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 279a5d879f2..37f054c49e9 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2007-09-20 H.J. Lu + + * 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 PR 658 diff --git a/gas/testsuite/gas/i386/sib-intel.d b/gas/testsuite/gas/i386/sib-intel.d index 707f74ad098..27709ebb95e 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+ : +[ ]*[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 574a308e6f1..0ece4183af1 100644 --- a/gas/testsuite/gas/i386/sib.d +++ b/gas/testsuite/gas/i386/sib.d @@ -6,13 +6,45 @@ Disassembly of section .text: 0+ : +[ ]*[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 f11d6d2480f..430da42b73c 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 0dce66fabd4..1ae72eabaee 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+ : +[ ]*[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 32e02bef060..f6d73159c76 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+ : +[ ]*[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 26ab395d23c..38f4241a967 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 88be05e9a91..584e24c3437 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,7 @@ +2007-09-20 H.J. Lu + + * i386-dis.c (OP_E_extended): Display eiz for [eiz*1 + offset]. + 2007-09-20 H.J. Lu PR 658 diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 9a45e9100d8..ecb428fd8fc 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)) { -- 2.30.2