diff options
author | Jan Beulich <jbeulich@suse.com> | 2022-10-05 09:16:24 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2022-10-05 09:16:24 +0200 |
commit | e87fb6a6d0cdfc0e9c471b7825c20c238c2cf506 (patch) | |
tree | 4e96772ab18b992195cbb0a848ca006adbfb9e11 /gas/testsuite | |
parent | bb5cb85b465a9327fb0cf48ebe4b7ab661ed0971 (diff) | |
download | gdb-e87fb6a6d0cdfc0e9c471b7825c20c238c2cf506.zip gdb-e87fb6a6d0cdfc0e9c471b7825c20c238c2cf506.tar.gz gdb-e87fb6a6d0cdfc0e9c471b7825c20c238c2cf506.tar.bz2 |
x86/gas: support quoted address scale factor in AT&T syntax
An earlier attempt (e68c3d59acd0 ["x86: better respect quotes in
parse_operands()"]) needed undoing (cc0f96357e0b ["x86: permit
parenthesized expressions again as addressing scale factor"]) as far its
effect here went. As indicated back then, the issue is the backwards
scanning of the operand string to find the matching opening parenthesis.
Switch to forward scanning, finding the last outermost unquoted opening
parenthesis (which is the one matching the trailing closing one).
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/i386/sib-intel.d | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/sib.d | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/sib.s | 8 |
3 files changed, 16 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/sib-intel.d b/gas/testsuite/gas/i386/sib-intel.d index ccd2ea9..0688a5f 100644 --- a/gas/testsuite/gas/i386/sib-intel.d +++ b/gas/testsuite/gas/i386/sib-intel.d @@ -34,6 +34,10 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 8b 04 40 mov eax,DWORD PTR \[eax\+eax\*2\] [ ]*[a-f0-9]+: 8b 04 80 mov eax,DWORD PTR \[eax\+eax\*4\] [ ]*[a-f0-9]+: 8b 04 c0 mov eax,DWORD PTR \[eax\+eax\*8\] +[ ]*[a-f0-9]+: 8b 14 08 mov edx,DWORD PTR \[eax\+ecx\*1\] +[ ]*[a-f0-9]+: 8b 14 48 mov edx,DWORD PTR \[eax\+ecx\*2\] +[ ]*[a-f0-9]+: 8b 14 88 mov edx,DWORD PTR \[eax\+ecx\*4\] +[ ]*[a-f0-9]+: 8b 14 c8 mov edx,DWORD PTR \[eax\+ecx\*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\] diff --git a/gas/testsuite/gas/i386/sib.d b/gas/testsuite/gas/i386/sib.d index 151935c..f578d3d 100644 --- a/gas/testsuite/gas/i386/sib.d +++ b/gas/testsuite/gas/i386/sib.d @@ -33,6 +33,10 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 8b 04 40 mov \(%eax,%eax,2\),%eax [ ]*[a-f0-9]+: 8b 04 80 mov \(%eax,%eax,4\),%eax [ ]*[a-f0-9]+: 8b 04 c0 mov \(%eax,%eax,8\),%eax +[ ]*[a-f0-9]+: 8b 14 08 mov \(%eax,%ecx,1\),%edx +[ ]*[a-f0-9]+: 8b 14 48 mov \(%eax,%ecx,2\),%edx +[ ]*[a-f0-9]+: 8b 14 88 mov \(%eax,%ecx,4\),%edx +[ ]*[a-f0-9]+: 8b 14 c8 mov \(%eax,%ecx,8\),%edx [ ]*[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 diff --git a/gas/testsuite/gas/i386/sib.s b/gas/testsuite/gas/i386/sib.s index c0e007f..16afb00 100644 --- a/gas/testsuite/gas/i386/sib.s +++ b/gas/testsuite/gas/i386/sib.s @@ -30,6 +30,14 @@ foo: mov (%eax, %eax, (1 << 1)), %eax mov (%eax, %eax, (1 << 2)), %eax mov (%eax, %eax, (1 << 3)), %eax + .equ "scale(1)", 1 + mov (%eax, %ecx, "scale(1)"), %edx + .equiv "scale[2]", 2 + mov (%eax, %ecx, "scale[2]"), %edx + .eqv "scale{4}", 4 + mov (%eax, %ecx, "scale{4}"), %edx + .set "scale<8>", 8 + mov (%eax, %ecx, "scale<8>"), %edx .intel_syntax noprefix mov eax,DWORD PTR [eiz*1-30] mov eax,DWORD PTR [eiz*2-30] |