* [PATCH] x86: Intel mode opcode prefix handling
@ 2005-05-06 12:03 Jan Beulich
0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2005-05-06 12:03 UTC (permalink / raw)
To: binutils
[-- Attachment #1: Type: text/plain, Size: 2097 bytes --]
This supresses acceptance of the AT&T style prefix separator in Intel mode,
and adds the MASM-style prefixes ht/hnt to complement (yet again in Intel
mode) the GNU AT&T extensions of suffixing branches with ,pt or ,pn.
Built and tested on i686-pc-linux-gnu and x86_64-unknown-linux-gnu.
Jan
gas/
2005-05-06 Jan Beulich <jbeulich@novell.com>
* config/tc-i386.c (parse_insn): Disallow use of prefix separator
and comma in Intel mode.
include/opcode/
2005-05-06 Jan Beulich <jbeulich@novell.com>
* i386.h (i386_optab): Add ht and hnt.
--- /home/jbeulich/src/binutils/mainline/2005-05-06/gas/config/tc-i386.c 2005-05-06 08:24:28.000000000 +0200
+++ 2005-05-06/gas/config/tc-i386.c 2005-05-06 11:45:55.861726528 +0200
@@ -1606,8 +1606,9 @@ parse_insn (line, mnemonic)
}
if (!is_space_char (*l)
&& *l != END_OF_INSN
- && *l != PREFIX_SEPARATOR
- && *l != ',')
+ && (intel_syntax
+ || (*l != PREFIX_SEPARATOR
+ && *l != ',')))
{
as_bad (_("invalid character %s in mnemonic"),
output_invalid (*l));
@@ -1615,7 +1616,7 @@ parse_insn (line, mnemonic)
}
if (token_start == l)
{
- if (*l == PREFIX_SEPARATOR)
+ if (!intel_syntax && *l == PREFIX_SEPARATOR)
as_bad (_("expecting prefix; got nothing"));
else
as_bad (_("expecting mnemonic; got nothing"));
--- /home/jbeulich/src/binutils/mainline/2005-05-06/include/opcode/i386.h 2005-04-19 08:42:12.000000000 +0200
+++ 2005-05-06/include/opcode/i386.h 2005-05-06 11:46:07.741920464 +0200
@@ -876,6 +876,8 @@ static const template i386_optab[] =
{"repz", 0, 0xf3, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
{"repne", 0, 0xf2, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
{"repnz", 0, 0xf2, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
+{"ht", 0, 0x3e, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
+{"hnt", 0, 0x2e, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
{"rex", 0, 0x40, X, Cpu64, NoSuf|IsPrefix, { 0, 0, 0} },
{"rexz", 0, 0x41, X, Cpu64, NoSuf|IsPrefix, { 0, 0, 0} },
{"rexy", 0, 0x42, X, Cpu64, NoSuf|IsPrefix, { 0, 0, 0} },
[-- Attachment #2: binutils-mainline-x86-intel-prefix.patch --]
[-- Type: text/plain, Size: 2040 bytes --]
This supresses acceptance of the AT&T style prefix separator in Intel mode,
and adds the MASM-style prefixes ht/hnt to complement (yet again in Intel
mode) the GNU AT&T extensions of suffixing branches with ,pt or ,pn.
Built and tested on i686-pc-linux-gnu and x86_64-unknown-linux-gnu.
Jan
gas/
2005-05-06 Jan Beulich <jbeulich@novell.com>
* config/tc-i386.c (parse_insn): Disallow use of prefix separator
and comma in Intel mode.
include/opcode/
2005-05-06 Jan Beulich <jbeulich@novell.com>
* i386.h (i386_optab): Add ht and hnt.
--- /home/jbeulich/src/binutils/mainline/2005-05-06/gas/config/tc-i386.c 2005-05-06 08:24:28.000000000 +0200
+++ 2005-05-06/gas/config/tc-i386.c 2005-05-06 11:45:55.861726528 +0200
@@ -1606,8 +1606,9 @@ parse_insn (line, mnemonic)
}
if (!is_space_char (*l)
&& *l != END_OF_INSN
- && *l != PREFIX_SEPARATOR
- && *l != ',')
+ && (intel_syntax
+ || (*l != PREFIX_SEPARATOR
+ && *l != ',')))
{
as_bad (_("invalid character %s in mnemonic"),
output_invalid (*l));
@@ -1615,7 +1616,7 @@ parse_insn (line, mnemonic)
}
if (token_start == l)
{
- if (*l == PREFIX_SEPARATOR)
+ if (!intel_syntax && *l == PREFIX_SEPARATOR)
as_bad (_("expecting prefix; got nothing"));
else
as_bad (_("expecting mnemonic; got nothing"));
--- /home/jbeulich/src/binutils/mainline/2005-05-06/include/opcode/i386.h 2005-04-19 08:42:12.000000000 +0200
+++ 2005-05-06/include/opcode/i386.h 2005-05-06 11:46:07.741920464 +0200
@@ -876,6 +876,8 @@ static const template i386_optab[] =
{"repz", 0, 0xf3, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
{"repne", 0, 0xf2, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
{"repnz", 0, 0xf2, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
+{"ht", 0, 0x3e, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
+{"hnt", 0, 0x2e, X, 0, NoSuf|IsPrefix, { 0, 0, 0} },
{"rex", 0, 0x40, X, Cpu64, NoSuf|IsPrefix, { 0, 0, 0} },
{"rexz", 0, 0x41, X, Cpu64, NoSuf|IsPrefix, { 0, 0, 0} },
{"rexy", 0, 0x42, X, Cpu64, NoSuf|IsPrefix, { 0, 0, 0} },
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-05-06 12:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-06 12:03 [PATCH] x86: Intel mode opcode prefix handling Jan Beulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).