aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-05-19 09:19:10 +0200
committerJan Beulich <jbeulich@suse.com>2023-05-19 09:19:10 +0200
commit1e66f4c55f83ba4d27330312aefdd4fbdf56cb43 (patch)
tree99ade918365855bc2929f37c5aa094d5277552bf
parent5cc007751cdb8ea713c98294e37cd447c12c9bab (diff)
downloadgdb-1e66f4c55f83ba4d27330312aefdd4fbdf56cb43.zip
gdb-1e66f4c55f83ba4d27330312aefdd4fbdf56cb43.tar.gz
gdb-1e66f4c55f83ba4d27330312aefdd4fbdf56cb43.tar.bz2
x86: permit all relational operators in insn operands
Oddly enough == and != were not permitted, because of '=' not having been listed in operand_special_chars[].
-rw-r--r--gas/config/tc-i386.c2
-rw-r--r--gas/testsuite/gas/i386/cond.d17
-rw-r--r--gas/testsuite/gas/i386/cond.s10
-rw-r--r--gas/testsuite/gas/i386/i386.exp1
4 files changed, 29 insertions, 1 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index f9482a0..ca3626e 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -547,7 +547,7 @@ static char operand_chars[256];
#define is_space_char(x) ((x) == ' ')
/* All non-digit non-letter characters that may occur in an operand. */
-static char operand_special_chars[] = "%$-+(,)*._~/<>|&^!:[@]";
+static char operand_special_chars[] = "%$-+(,)*._~/<>|&^!=:[@]";
/* md_assemble() always leaves the strings it's passed unaltered. To
effect this we maintain a stack of saved characters that we've smashed
diff --git a/gas/testsuite/gas/i386/cond.d b/gas/testsuite/gas/i386/cond.d
new file mode 100644
index 0000000..8c31342
--- /dev/null
+++ b/gas/testsuite/gas/i386/cond.d
@@ -0,0 +1,17 @@
+#objdump: -dw
+#name: x86 conditional operators in insn operands
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <cond>:
+ +[a-f0-9]+: b8 01 00 00 00 + mov +\$(0x)?1,%eax
+ +[a-f0-9]+: b9 ff ff ff ff + mov +\$0xffffffff,%ecx
+ +[a-f0-9]+: ba ff ff ff ff + mov +\$0xffffffff,%edx
+ +[a-f0-9]+: bb ff ff ff ff + mov +\$0xffffffff,%ebx
+ +[a-f0-9]+: bc ff ff ff ff + mov +\$0xffffffff,%esp
+ +[a-f0-9]+: bd ff ff ff ff + mov +\$0xffffffff,%ebp
+ +[a-f0-9]+: be ff ff ff ff + mov +\$0xffffffff,%esi
+ +[a-f0-9]+: bf ff ff ff ff + mov +\$0xffffffff,%edi
+#pass
diff --git a/gas/testsuite/gas/i386/cond.s b/gas/testsuite/gas/i386/cond.s
new file mode 100644
index 0000000..8aea7cf
--- /dev/null
+++ b/gas/testsuite/gas/i386/cond.s
@@ -0,0 +1,10 @@
+ .text
+cond:
+ mov $!0, %eax
+ mov $1 <> 0, %ecx
+ mov $1 != 0, %edx
+ mov $0 == 0, %ebx
+ mov $0 < 1, %esp
+ mov $0 <= 0, %ebp
+ mov $1 > 0, %esi
+ mov $0 >= 0, %edi
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 62796c7..dc29b51 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -755,6 +755,7 @@ run_dump_test pr19498
run_list_test "nop-bad-1" ""
run_list_test "unspec" ""
run_dump_test "fp"
+run_dump_test "cond"
run_dump_test pr30248
if {[is_elf_format] || [istarget "*-*-vxworks*"]} then {
run_list_test_stdin "list-1" "-al"