aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2008-01-05 17:07:25 +0000
committerH.J. Lu <hjl.tools@gmail.com>2008-01-05 17:07:25 +0000
commite1d4d8936fdd6f5bb05fd50a51a9dd723313487e (patch)
tree3fff257797c2a4fb3476d8709bd1d4cd72ff72cf /gas
parenta4d9b460bdb43dd457b972723d7823193d697249 (diff)
downloadgdb-e1d4d8936fdd6f5bb05fd50a51a9dd723313487e.zip
gdb-e1d4d8936fdd6f5bb05fd50a51a9dd723313487e.tar.gz
gdb-e1d4d8936fdd6f5bb05fd50a51a9dd723313487e.tar.bz2
gas/
2008-01-05 H.J. Lu <hongjiu.lu@intel.com> * doc/c-i386.texi: Update .att_mnemonic and .intel_mnemonic. * config/tc-i386.c (set_intel_mnemonic): Set intel_mnemonic only. (md_assemble): Remove Intel mode workaround. (match_template): Check support for old gcc, AT&T mnemonic and Intel Syntax. (md_parse_option): Don't set intel_mnemonic to 0 for OPTION_MOLD_GCC. gas/testsuite/ 2008-01-05 H.J. Lu <hongjiu.lu@intel.com> * gas/i386/intel.s: Add tests for fadd, faddp, fdiv, fdivp, fdivr, fdivrp, fmul, fmulp, fsub, fsubp, fsubr and fsubrp. * gas/i386/intel.d: Updated. * gas/i386/intel.e: Likewise. opcodes/ 2008-01-05 H.J. Lu <hongjiu.lu@intel.com> * i386-gen.c (opcode_modifiers): Rename IntelMnemonic to ATTSyntax. * i386-opc.h (IntelMnemonic): Renamed to .. (ATTSyntax): This (Opcode_Modifier_Max): Updated. (i386_opcode_modifier): Remove intelmnemonic. Add attsyntax and intelsyntax. * i386-opc.tbl: Remove IntelMnemonic and update with ATTSyntax on fsub, fubp, fsubr, fsubrp, div, fdivp, fdivr and fdivrp. * i386-tbl.h: Regenerated.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog12
-rw-r--r--gas/config/tc-i386.c54
-rw-r--r--gas/doc/c-i386.texi5
-rw-r--r--gas/testsuite/ChangeLog8
-rw-r--r--gas/testsuite/gas/i386/intel.d60
-rw-r--r--gas/testsuite/gas/i386/intel.e22
-rw-r--r--gas/testsuite/gas/i386/intel.s59
7 files changed, 163 insertions, 57 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 9fce86a..153e9de 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,15 @@
+2008-01-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * doc/c-i386.texi: Update .att_mnemonic and .intel_mnemonic.
+
+ * config/tc-i386.c (set_intel_mnemonic): Set intel_mnemonic
+ only.
+ (md_assemble): Remove Intel mode workaround.
+ (match_template): Check support for old gcc, AT&T mnemonic
+ and Intel Syntax.
+ (md_parse_option): Don't set intel_mnemonic to 0 for
+ OPTION_MOLD_GCC.
+
2008-01-04 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.h: Update copyright to 2008.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 0967530..bcf299f 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1495,37 +1495,7 @@ set_intel_syntax (int syntax_flag)
static void
set_intel_mnemonic (int mnemonic_flag)
{
- /* Find out if register prefixing is specified. */
- int ask_naked_reg = 0;
-
- SKIP_WHITESPACE ();
- if (!is_end_of_line[(unsigned char) *input_line_pointer])
- {
- char *string = input_line_pointer;
- int e = get_symbol_end ();
-
- if (strcmp (string, "prefix") == 0)
- ask_naked_reg = 1;
- else if (strcmp (string, "noprefix") == 0)
- ask_naked_reg = -1;
- else
- as_bad (_("bad argument to syntax directive."));
- *input_line_pointer = e;
- }
- demand_empty_rest_of_line ();
-
- /* intel_mnemonic implies intel_syntax. */
- intel_mnemonic = intel_syntax = mnemonic_flag;
-
- if (ask_naked_reg == 0)
- allow_naked_reg = (intel_mnemonic
- && (bfd_get_symbol_leading_char (stdoutput) != '\0'));
- else
- allow_naked_reg = (ask_naked_reg < 0);
-
- identifier_chars['%'] = intel_mnemonic && allow_naked_reg ? '%' : 0;
- identifier_chars['$'] = intel_mnemonic ? '$' : 0;
- register_prefix = allow_naked_reg ? "" : "%";
+ intel_mnemonic = mnemonic_flag;
}
static void
@@ -2205,12 +2175,6 @@ md_assemble (line)
if (intel_syntax)
{
- /* Undo AT&T Mnemonic brokenness when in Intel mode. See
- i386-opc.tbl. */
- if (!intel_mnemonic
- && (i.tm.base_opcode & 0xfffffde0) == 0xdce0)
- i.tm.base_opcode ^= Opcode_FloatR;
-
/* Zap movzx and movsx suffix. The suffix may have been set from
"word ptr" or "byte ptr" on the source operand, but we'll use
the suffix later to choose the destination register. */
@@ -3035,15 +2999,16 @@ match_template (void)
if (i.operands != t->operands)
continue;
- /* Check AT&T mnemonic and old gcc support. */
- if (t->opcode_modifier.attmnemonic
- && (intel_mnemonic
- || (!old_gcc
- && t->opcode_modifier.oldgcc)))
+ /* Check old gcc support. */
+ if (!old_gcc && t->opcode_modifier.oldgcc)
+ continue;
+
+ /* Check AT&T mnemonic. */
+ if (intel_mnemonic && t->opcode_modifier.attmnemonic)
continue;
- /* Check Intel mnemonic. */
- if (!intel_mnemonic && t->opcode_modifier.intelmnemonic)
+ /* Check Intel syntax. */
+ if (intel_syntax && t->opcode_modifier.attsyntax)
continue;
/* Check the suffix, except for some instructions in intel mode. */
@@ -7134,7 +7099,6 @@ md_parse_option (int c, char *arg)
case OPTION_MOLD_GCC:
old_gcc = 1;
- intel_mnemonic = 0;
break;
default:
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index 16640d2..3b1a2ca 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -139,8 +139,7 @@ take precedent.
@cindex @samp{-mnaked-reg} option, x86-64
@item -mnaked-reg
This opetion specifies that registers don't require a @samp{%} prefix.
-The @code{.att_mnemonic}, @code{.intel_mnemonic}, @code{.att_syntax} and
-@code{.intel_syntax} directives will take precedent.
+The @code{.att_syntax} and @code{.intel_syntax} directives will take precedent.
@end table
@@ -329,8 +328,6 @@ convention.
@code{.intel_mnemonic} selects Intel mnemonic with Intel syntax, and
@code{.att_mnemonic} switches back to the usual AT&T mnemonic with AT&T
syntax for compatibility with the output of @code{@value{GCC}}.
-Either of these directives may have an optional argument, @code{prefix},
-or @code{noprefix} specifying whether registers require a @samp{%} prefix.
Several x87 instructions, @samp{fadd}, @samp{fdiv}, @samp{fdivp},
@samp{fdivr}, @samp{fdivrp}, @samp{fmul}, @samp{fsub}, @samp{fsubp},
@samp{fsubr} and @samp{fsubrp}, are implemented in AT&T System V/386
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 757120f..315e2dd 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gas/i386/intel.s: Add tests for fadd, faddp, fdiv, fdivp,
+ fdivr, fdivrp, fmul, fmulp, fsub, fsubp, fsubr and fsubrp.
+
+ * gas/i386/intel.d: Updated.
+ * gas/i386/intel.e: Likewise.
+
2008-01-04 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/rexw.d: New.
diff --git a/gas/testsuite/gas/i386/intel.d b/gas/testsuite/gas/i386/intel.d
index f8a96df..5a764b4 100644
--- a/gas/testsuite/gas/i386/intel.d
+++ b/gas/testsuite/gas/i386/intel.d
@@ -630,4 +630,62 @@ Disassembly of section .text:
a8b: b3 47 [ ]*mov \$0x47,%bl
a8d: 0f ad d0 [ ]*shrd %cl,%edx,%eax
a90: 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\)
+[ ]*[a-f0-9]+: d8 03 fadds \(%ebx\)
+[ ]*[a-f0-9]+: dc 03 faddl \(%ebx\)
+[ ]*[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\)
+[ ]*[a-f0-9]+: d8 33 fdivs \(%ebx\)
+[ ]*[a-f0-9]+: dc 33 fdivl \(%ebx\)
+[ ]*[a-f0-9]+: de f9 fdivrp %st,%st\(1\)
+[ ]*[a-f0-9]+: de fb fdivrp %st,%st\(3\)
+[ ]*[a-f0-9]+: de fb fdivrp %st,%st\(3\)
+[ ]*[a-f0-9]+: de fb fdivrp %st,%st\(3\)
+[ ]*[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\)
+[ ]*[a-f0-9]+: d8 3b fdivrs \(%ebx\)
+[ ]*[a-f0-9]+: dc 3b fdivrl \(%ebx\)
+[ ]*[a-f0-9]+: de f1 fdivp %st,%st\(1\)
+[ ]*[a-f0-9]+: de f3 fdivp %st,%st\(3\)
+[ ]*[a-f0-9]+: de f3 fdivp %st,%st\(3\)
+[ ]*[a-f0-9]+: de f3 fdivp %st,%st\(3\)
+[ ]*[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\)
+[ ]*[a-f0-9]+: d8 0b fmuls \(%ebx\)
+[ ]*[a-f0-9]+: dc 0b fmull \(%ebx\)
+[ ]*[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\)
+[ ]*[a-f0-9]+: d8 23 fsubs \(%ebx\)
+[ ]*[a-f0-9]+: dc 23 fsubl \(%ebx\)
+[ ]*[a-f0-9]+: de e9 fsubrp %st,%st\(1\)
+[ ]*[a-f0-9]+: de eb fsubrp %st,%st\(3\)
+[ ]*[a-f0-9]+: de eb fsubrp %st,%st\(3\)
+[ ]*[a-f0-9]+: de eb fsubrp %st,%st\(3\)
+[ ]*[a-f0-9]+: d8 eb fsubr %st\(3\),%st
+[ ]*[a-f0-9]+: d8 eb fsubr %st\(3\),%st
+[ ]*[a-f0-9]+: dc e3 fsub %st,%st\(3\)
+[ ]*[a-f0-9]+: d8 2b fsubrs \(%ebx\)
+[ ]*[a-f0-9]+: dc 2b fsubrl \(%ebx\)
+[ ]*[a-f0-9]+: de e1 fsubp %st,%st\(1\)
+[ ]*[a-f0-9]+: de e3 fsubp %st,%st\(3\)
+[ ]*[a-f0-9]+: de e3 fsubp %st,%st\(3\)
+[ ]*[a-f0-9]+: de e3 fsubp %st,%st\(3\)
+#pass
diff --git a/gas/testsuite/gas/i386/intel.e b/gas/testsuite/gas/i386/intel.e
index 9a38e09..8ad6331 100644
--- a/gas/testsuite/gas/i386/intel.e
+++ b/gas/testsuite/gas/i386/intel.e
@@ -1,7 +1,17 @@
.*: Assembler messages:
-.*:154: Warning: Treating .\[0x90909090\]. as memory reference
-.*:155: Warning: Treating .\[0x90909090\]. as memory reference
-.*:156: Warning: Treating .\[0x90909090\]. as memory reference
-.*:157: Warning: Treating .\[0x90909090\]. as memory reference
-.*:492: Warning: Treating .\[0x90909090\]. as memory reference
-.*:493: Warning: Treating .\[0x90909090\]. as memory reference
+.*:154: Warning: Treating `\[0x90909090\]' as memory reference
+.*:155: Warning: Treating `\[0x90909090\]' as memory reference
+.*:156: Warning: Treating `\[0x90909090\]' as memory reference
+.*:157: Warning: Treating `\[0x90909090\]' as memory reference
+.*:492: Warning: Treating `\[0x90909090\]' as memory reference
+.*:493: Warning: Treating `\[0x90909090\]' as memory reference
+.*:631: Warning: translating to `faddp'
+.*:640: Warning: translating to `fdivp'
+.*:649: Warning: translating to `fdivp st,st\(3\)'
+.*:650: Warning: translating to `fdivrp'
+.*:659: Warning: translating to `fdivrp st,st\(3\)'
+.*:660: Warning: translating to `fmulp'
+.*:669: Warning: translating to `fsubp'
+.*:670: Warning: translating to `fsubrp'
+.*:678: Warning: translating to `fsubp st,st\(3\)'
+.*:688: Warning: translating to `fsubrp st,st\(3\)'
diff --git a/gas/testsuite/gas/i386/intel.s b/gas/testsuite/gas/i386/intel.s
index 061414b..855b419 100644
--- a/gas/testsuite/gas/i386/intel.s
+++ b/gas/testsuite/gas/i386/intel.s
@@ -628,4 +628,61 @@ rot5:
shrd eax, edx, cl
shld eax, edx, cl
- .p2align 4,0
+fadd
+fadd st(3)
+fadd st,st(3)
+fadd st(3),st
+fadd DWORD PTR [ebx]
+fadd QWORD PTR [ebx]
+faddp
+faddp st(3)
+faddp st(3),st
+fdiv
+fdiv st(3)
+fdiv st,st(3)
+fdiv st(3),st
+fdiv DWORD PTR [ebx]
+fdiv QWORD PTR [ebx]
+fdivp
+fdivp st(3)
+fdivp st(3),st
+fdivp st,st(3)
+fdivr
+fdivr st(3)
+fdivr st,st(3)
+fdivr st(3),st
+fdivr DWORD PTR [ebx]
+fdivr QWORD PTR [ebx]
+fdivrp
+fdivrp st(3)
+fdivrp st(3),st
+fdivrp st,st(3)
+fmul
+fmul st(3)
+fmul st,st(3)
+fmul st(3),st
+fmul DWORD PTR [ebx]
+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
+fsub DWORD PTR [ebx]
+fsub QWORD PTR [ebx]
+fsubp
+fsubp st(3)
+fsubp st,st(3)
+fsubp st(3),st
+fsubr st(3)
+fsubr st,st(3)
+fsubr st(3),st
+fsubr DWORD PTR [ebx]
+fsubr QWORD PTR [ebx]
+fsubrp
+fsubrp st(3)
+fsubrp st(3),st
+fsubrp st,st(3)