diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 8 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 8 | ||||
-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 | 4 |
5 files changed, 26 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index ecd0794..d766fd1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2021-06-15 Jan Beulich <jbeulich@suse.com> + + * config/tc-i386.c (i386_att_operand): Re-introduce (now + properly named) parens_not_balanced. + * testsuite/gas/i386/sib.s: Add more cases. + * testsuite/gas/i386/sib.d, testsuite/gas/i386/sib-intel.d: + Adjust expectations. + 2021-06-14 Jan Beulich <jbeulich@suse.com> * read.c (emit_expr_with_reloc): Fold three as_warn(). diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index b3f9f31..8585380 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -11566,15 +11566,19 @@ i386_att_operand (char *operand_string) if (*base_string == ')') { char *temp_string; + unsigned int parens_not_balanced = 1; /* We've already checked that the number of left & right ()'s are equal, so this loop will not be infinite. */ do { base_string--; + if (*base_string == ')') + parens_not_balanced++; + if (*base_string == '(') + parens_not_balanced--; } - while (*base_string != '(' && *base_string != ')' - && *base_string != '"'); + while (parens_not_balanced && *base_string != '"'); temp_string = base_string; diff --git a/gas/testsuite/gas/i386/sib-intel.d b/gas/testsuite/gas/i386/sib-intel.d index 27709eb..ccd2ea9 100644 --- a/gas/testsuite/gas/i386/sib-intel.d +++ b/gas/testsuite/gas/i386/sib-intel.d @@ -30,6 +30,10 @@ Disassembly of section .text: [ ]*[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 00 mov eax,DWORD PTR \[eax\+eax\*1\] +[ ]*[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 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 0ece418..151935c 100644 --- a/gas/testsuite/gas/i386/sib.d +++ b/gas/testsuite/gas/i386/sib.d @@ -29,6 +29,10 @@ Disassembly of section .text: [ ]*[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 00 mov \(%eax,%eax,1\),%eax +[ ]*[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 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 430da42..c0e007f 100644 --- a/gas/testsuite/gas/i386/sib.s +++ b/gas/testsuite/gas/i386/sib.s @@ -26,6 +26,10 @@ foo: mov (%esp,%eiz,2),%eax mov (%esp,%eiz,4),%eax mov (%esp,%eiz,8),%eax + mov (%eax, %eax, (1 << 0)), %eax + mov (%eax, %eax, (1 << 1)), %eax + mov (%eax, %eax, (1 << 2)), %eax + mov (%eax, %eax, (1 << 3)), %eax .intel_syntax noprefix mov eax,DWORD PTR [eiz*1-30] mov eax,DWORD PTR [eiz*2-30] |