aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-12-15 12:04:39 +0100
committerJan Beulich <jbeulich@suse.com>2023-12-15 12:04:39 +0100
commit7d3182d6aad5f456305892641c761460275cec46 (patch)
treef3afdd57aeb335180587d4a17e88376c9ec1ea14 /gas
parent4f53c99c998bccac241aca9e540c4f55acdc7da2 (diff)
downloadgdb-7d3182d6aad5f456305892641c761460275cec46.zip
gdb-7d3182d6aad5f456305892641c761460275cec46.tar.gz
gdb-7d3182d6aad5f456305892641c761460275cec46.tar.bz2
x86: Intel syntax implies Intel mnemonics
As noted in the context of d53e6b98a259 ("x86/Intel: correct disassembly of fsub*/fdiv*") there's no such thing as Intel syntax without Intel mnemonics. Enforce this on the assembler side, and disentangle command line option handling on the disassembler side accordingly. As a result in the opcode table specifying ATTMnemonic|ATTSyntax becomes redundant with just ATTMnemonic. Drop the now meaningless ATTSyntax and remove the then no longer accessible templates.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-i386-intel.c4
-rw-r--r--gas/config/tc-i386.c9
-rw-r--r--gas/testsuite/gas/i386/compat-intel.d42
-rw-r--r--gas/testsuite/gas/i386/compat-intel2.d2
-rw-r--r--gas/testsuite/gas/i386/intel-intel.d7
-rw-r--r--gas/testsuite/gas/i386/intel.d7
-rw-r--r--gas/testsuite/gas/i386/intel.e7
-rw-r--r--gas/testsuite/gas/i386/intel.s6
8 files changed, 30 insertions, 54 deletions
diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c
index f9400c0..aff1ee6 100644
--- a/gas/config/tc-i386-intel.c
+++ b/gas/config/tc-i386-intel.c
@@ -824,7 +824,9 @@ i386_intel_operand (char *operand_string, int got_a_float)
unsigned int op = t->operands - 1 - this_operand;
/* Easy checks to skip templates which won't match anyway. */
- if (this_operand >= t->operands || t->opcode_modifier.attsyntax)
+ if (this_operand >= t->operands
+ || t->opcode_modifier.attsyntax
+ || t->opcode_modifier.attmnemonic)
continue;
switch (suffix)
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 3f1b39b..d3014da 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7052,13 +7052,14 @@ match_template (char mnem_suffix)
/* Check AT&T mnemonic. */
specific_error = progress (unsupported_with_intel_mnemonic);
- if (intel_mnemonic && t->opcode_modifier.attmnemonic)
+ if (!intel_syntax && intel_mnemonic && t->opcode_modifier.attmnemonic)
continue;
/* Check AT&T/Intel syntax. */
specific_error = progress (unsupported_syntax);
- if ((intel_syntax && t->opcode_modifier.attsyntax)
- || (!intel_syntax && t->opcode_modifier.intelsyntax))
+ if (intel_syntax
+ ? t->opcode_modifier.attsyntax || t->opcode_modifier.attmnemonic
+ : t->opcode_modifier.intelsyntax)
continue;
/* Check Intel64/AMD64 ISA. */
@@ -15223,7 +15224,7 @@ md_show_usage (FILE *stream)
else
fprintf (stream, _("(default: intel)\n"));
fprintf (stream, _("\
- use AT&T/Intel mnemonic\n"));
+ use AT&T/Intel mnemonic (AT&T syntax only)\n"));
fprintf (stream, _("\
-msyntax=[att|intel] (default: att)\n\
use AT&T/Intel syntax\n"));
diff --git a/gas/testsuite/gas/i386/compat-intel.d b/gas/testsuite/gas/i386/compat-intel.d
index cbe3c19..100dd8a 100644
--- a/gas/testsuite/gas/i386/compat-intel.d
+++ b/gas/testsuite/gas/i386/compat-intel.d
@@ -1,4 +1,4 @@
-#as: -mmnemonic=att
+#as: -mmnemonic=intel
#objdump: -d -Mintel-mnemonic
#name: i386 float Intel mnemonic
#source: compat.s
@@ -8,24 +8,24 @@
Disassembly of section .text:
0+ <.text>:
-[ ]*[a-f0-9]+: dc e3 fsubr st\(3\),st
-[ ]*[a-f0-9]+: d8 e3 fsub st,st\(3\)
-[ ]*[a-f0-9]+: de e1 fsubrp st\(1\),st
-[ ]*[a-f0-9]+: de e3 fsubrp st\(3\),st
-[ ]*[a-f0-9]+: de e3 fsubrp st\(3\),st
-[ ]*[a-f0-9]+: dc eb fsub st\(3\),st
-[ ]*[a-f0-9]+: d8 eb fsubr st,st\(3\)
-[ ]*[a-f0-9]+: de e9 fsubp st\(1\),st
-[ ]*[a-f0-9]+: de eb fsubp st\(3\),st
-[ ]*[a-f0-9]+: de eb fsubp st\(3\),st
-[ ]*[a-f0-9]+: dc f3 fdivr st\(3\),st
-[ ]*[a-f0-9]+: d8 f3 fdiv st,st\(3\)
-[ ]*[a-f0-9]+: de f1 fdivrp st\(1\),st
-[ ]*[a-f0-9]+: de f3 fdivrp st\(3\),st
-[ ]*[a-f0-9]+: de f3 fdivrp st\(3\),st
-[ ]*[a-f0-9]+: dc fb fdiv st\(3\),st
-[ ]*[a-f0-9]+: d8 fb fdivr st,st\(3\)
-[ ]*[a-f0-9]+: de f9 fdivp st\(1\),st
-[ ]*[a-f0-9]+: de fb fdivp st\(3\),st
-[ ]*[a-f0-9]+: de fb fdivp st\(3\),st
+[ ]*[a-f0-9]+: dc eb fsub %st,%st\(3\)
+[ ]*[a-f0-9]+: d8 e3 fsub %st\(3\),%st
+[ ]*[a-f0-9]+: de e9 fsubp %st,%st\(1\)
+[ ]*[a-f0-9]+: de eb fsubp %st,%st\(3\)
+[ ]*[a-f0-9]+: de eb fsubp %st,%st\(3\)
+[ ]*[a-f0-9]+: dc e3 fsubr %st,%st\(3\)
+[ ]*[a-f0-9]+: d8 eb fsubr %st\(3\),%st
+[ ]*[a-f0-9]+: de e1 fsubrp %st,%st\(1\)
+[ ]*[a-f0-9]+: de e3 fsubrp %st,%st\(3\)
+[ ]*[a-f0-9]+: de e3 fsubrp %st,%st\(3\)
+[ ]*[a-f0-9]+: dc fb fdiv %st,%st\(3\)
+[ ]*[a-f0-9]+: d8 f3 fdiv %st\(3\),%st
+[ ]*[a-f0-9]+: de f9 fdivp %st,%st\(1\)
+[ ]*[a-f0-9]+: de fb fdivp %st,%st\(3\)
+[ ]*[a-f0-9]+: de fb fdivp %st,%st\(3\)
+[ ]*[a-f0-9]+: dc f3 fdivr %st,%st\(3\)
+[ ]*[a-f0-9]+: d8 fb fdivr %st\(3\),%st
+[ ]*[a-f0-9]+: de f1 fdivrp %st,%st\(1\)
+[ ]*[a-f0-9]+: de f3 fdivrp %st,%st\(3\)
+[ ]*[a-f0-9]+: de f3 fdivrp %st,%st\(3\)
#pass
diff --git a/gas/testsuite/gas/i386/compat-intel2.d b/gas/testsuite/gas/i386/compat-intel2.d
index 035e0ca..0d493f3 100644
--- a/gas/testsuite/gas/i386/compat-intel2.d
+++ b/gas/testsuite/gas/i386/compat-intel2.d
@@ -1,5 +1,5 @@
#as: -mmnemonic=intel
-#objdump: -d -Mintel-mnemonic
+#objdump: -d -Mintel
#name: i386 float Intel mnemonic (2)
#source: compat.s
diff --git a/gas/testsuite/gas/i386/intel-intel.d b/gas/testsuite/gas/i386/intel-intel.d
index 4e96969..ee6d88c 100644
--- a/gas/testsuite/gas/i386/intel-intel.d
+++ b/gas/testsuite/gas/i386/intel-intel.d
@@ -2,7 +2,6 @@
#objdump: -dwMintel
#name: i386 intel
#source: intel.s
-#warning_output: intel.e
.*: +file format .*
@@ -635,7 +634,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: b3 47 + mov bl,0x47
[ ]*[a-f0-9]+: 0f ad d0 + shrd eax,edx,cl
[ ]*[a-f0-9]+: 0f a5 d0 + shld eax,edx,cl
-[ ]*[a-f0-9]+: de c1 + faddp st\(1\),st
[ ]*[a-f0-9]+: d8 c3 + fadd st,st\(3\)
[ ]*[a-f0-9]+: d8 c3 + fadd st,st\(3\)
[ ]*[a-f0-9]+: dc c3 + fadd st\(3\),st
@@ -644,7 +642,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: de c1 + faddp st\(1\),st
[ ]*[a-f0-9]+: de c3 + faddp st\(3\),st
[ ]*[a-f0-9]+: de c3 + faddp st\(3\),st
-[ ]*[a-f0-9]+: de f9 + fdivp st\(1\),st
[ ]*[a-f0-9]+: d8 f3 + fdiv st,st\(3\)
[ ]*[a-f0-9]+: d8 f3 + fdiv st,st\(3\)
[ ]*[a-f0-9]+: dc fb + fdiv st\(3\),st
@@ -654,7 +651,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: de fb + fdivp st\(3\),st
[ ]*[a-f0-9]+: de fb + fdivp st\(3\),st
[ ]*[a-f0-9]+: d8 f3 + fdiv st,st\(3\)
-[ ]*[a-f0-9]+: de f1 + fdivrp st\(1\),st
[ ]*[a-f0-9]+: d8 fb + fdivr st,st\(3\)
[ ]*[a-f0-9]+: d8 fb + fdivr st,st\(3\)
[ ]*[a-f0-9]+: dc f3 + fdivr st\(3\),st
@@ -664,7 +660,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: de f3 + fdivrp st\(3\),st
[ ]*[a-f0-9]+: de f3 + fdivrp st\(3\),st
[ ]*[a-f0-9]+: d8 fb + fdivr st,st\(3\)
-[ ]*[a-f0-9]+: de c9 + fmulp st\(1\),st
[ ]*[a-f0-9]+: d8 cb + fmul st,st\(3\)
[ ]*[a-f0-9]+: d8 cb + fmul st,st\(3\)
[ ]*[a-f0-9]+: dc cb + fmul st\(3\),st
@@ -673,8 +668,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: de c9 + fmulp st\(1\),st
[ ]*[a-f0-9]+: de cb + fmulp st\(3\),st
[ ]*[a-f0-9]+: de cb + fmulp st\(3\),st
-[ ]*[a-f0-9]+: de e9 + fsubp st\(1\),st
-[ ]*[a-f0-9]+: de e1 + fsubrp st\(1\),st
[ ]*[a-f0-9]+: d8 e3 + fsub st,st\(3\)
[ ]*[a-f0-9]+: d8 e3 + fsub st,st\(3\)
[ ]*[a-f0-9]+: dc eb + fsub st\(3\),st
diff --git a/gas/testsuite/gas/i386/intel.d b/gas/testsuite/gas/i386/intel.d
index c3e45c2..1ac6ae9 100644
--- a/gas/testsuite/gas/i386/intel.d
+++ b/gas/testsuite/gas/i386/intel.d
@@ -1,7 +1,6 @@
#as: -J
#objdump: -dw
#name: i386 intel (AT&T disassembly)
-#warning_output: intel.e
.*: +file format .*
@@ -634,7 +633,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: b3 47 [ ]*mov \$0x47,%bl
[ ]*[a-f0-9]+: 0f ad d0 [ ]*shrd %cl,%edx,%eax
[ ]*[a-f0-9]+: 0f a5 d0 [ ]*shld %cl,%edx,%eax
-[ ]*[a-f0-9]+: de c1 faddp %st,%st\(1\)
[ ]*[a-f0-9]+: d8 c3 fadd %st\(3\),%st
[ ]*[a-f0-9]+: d8 c3 fadd %st\(3\),%st
[ ]*[a-f0-9]+: dc c3 fadd %st,%st\(3\)
@@ -643,7 +641,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: de c1 faddp %st,%st\(1\)
[ ]*[a-f0-9]+: de c3 faddp %st,%st\(3\)
[ ]*[a-f0-9]+: de c3 faddp %st,%st\(3\)
-[ ]*[a-f0-9]+: de f9 fdivrp %st,%st\(1\)
[ ]*[a-f0-9]+: d8 f3 fdiv %st\(3\),%st
[ ]*[a-f0-9]+: d8 f3 fdiv %st\(3\),%st
[ ]*[a-f0-9]+: dc fb fdivr %st,%st\(3\)
@@ -653,7 +650,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: de fb fdivrp %st,%st\(3\)
[ ]*[a-f0-9]+: de fb fdivrp %st,%st\(3\)
[ ]*[a-f0-9]+: d8 f3 fdiv %st\(3\),%st
-[ ]*[a-f0-9]+: de f1 fdivp %st,%st\(1\)
[ ]*[a-f0-9]+: d8 fb fdivr %st\(3\),%st
[ ]*[a-f0-9]+: d8 fb fdivr %st\(3\),%st
[ ]*[a-f0-9]+: dc f3 fdiv %st,%st\(3\)
@@ -663,7 +659,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: de f3 fdivp %st,%st\(3\)
[ ]*[a-f0-9]+: de f3 fdivp %st,%st\(3\)
[ ]*[a-f0-9]+: d8 fb fdivr %st\(3\),%st
-[ ]*[a-f0-9]+: de c9 fmulp %st,%st\(1\)
[ ]*[a-f0-9]+: d8 cb fmul %st\(3\),%st
[ ]*[a-f0-9]+: d8 cb fmul %st\(3\),%st
[ ]*[a-f0-9]+: dc cb fmul %st,%st\(3\)
@@ -672,8 +667,6 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: de c9 fmulp %st,%st\(1\)
[ ]*[a-f0-9]+: de cb fmulp %st,%st\(3\)
[ ]*[a-f0-9]+: de cb fmulp %st,%st\(3\)
-[ ]*[a-f0-9]+: de e9 fsubrp %st,%st\(1\)
-[ ]*[a-f0-9]+: de e1 fsubp %st,%st\(1\)
[ ]*[a-f0-9]+: d8 e3 fsub %st\(3\),%st
[ ]*[a-f0-9]+: d8 e3 fsub %st\(3\),%st
[ ]*[a-f0-9]+: dc eb fsubr %st,%st\(3\)
diff --git a/gas/testsuite/gas/i386/intel.e b/gas/testsuite/gas/i386/intel.e
deleted file mode 100644
index 2e47970..0000000
--- a/gas/testsuite/gas/i386/intel.e
+++ /dev/null
@@ -1,7 +0,0 @@
-.*: Assembler messages:
-.*:635: Warning: translating to `faddp'
-.*:644: Warning: translating to `fdivp'
-.*:654: Warning: translating to `fdivrp'
-.*:664: Warning: translating to `fmulp'
-.*:673: Warning: translating to `fsubp'
-.*:674: Warning: translating to `fsubrp'
diff --git a/gas/testsuite/gas/i386/intel.s b/gas/testsuite/gas/i386/intel.s
index 922f260..9f816d9 100644
--- a/gas/testsuite/gas/i386/intel.s
+++ b/gas/testsuite/gas/i386/intel.s
@@ -632,7 +632,6 @@ rot5:
shrd eax, edx, cl
shld eax, edx, cl
-fadd
fadd st(3)
fadd st,st(3)
fadd st(3),st
@@ -641,7 +640,6 @@ fadd QWORD PTR [ebx]
faddp
faddp st(3)
faddp st(3),st
-fdiv
fdiv st(3)
fdiv st,st(3)
fdiv st(3),st
@@ -651,7 +649,6 @@ fdivp
fdivp st(3)
fdivp st(3),st
fdiv st,st(3)
-fdivr
fdivr st(3)
fdivr st,st(3)
fdivr st(3),st
@@ -661,7 +658,6 @@ fdivrp
fdivrp st(3)
fdivrp st(3),st
fdivr st,st(3)
-fmul
fmul st(3)
fmul st,st(3)
fmul st(3),st
@@ -670,8 +666,6 @@ fmul QWORD PTR [ebx]
fmulp
fmulp st(3)
fmulp st(3),st
-fsub
-fsubr
fsub st(3)
fsub st,st(3)
fsub st(3),st