aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-09 05:31:30 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-09 05:32:11 -0700
commit4e9ac44a8925c7da81735ef24beb5456a0c0fa24 (patch)
tree268e6fd67c571fee5681c1b27e2c0144e34fcbd9 /gas/config
parent0a27fed72d4190cc70025c671b5133e6c58d9c09 (diff)
downloadgdb-4e9ac44a8925c7da81735ef24beb5456a0c0fa24.zip
gdb-4e9ac44a8925c7da81735ef24beb5456a0c0fa24.tar.gz
gdb-4e9ac44a8925c7da81735ef24beb5456a0c0fa24.tar.bz2
x86: Remove restriction on NOTRACK prefix position
Since the NOTRACK prefix is no longer required to be the last prefix before the REX prefix, restriction on the NOTRACK prefix position is removed from assembler as well as disassembler. Assembler encodes the NOTRACK prefix the same way as the DS segment register, which places it before other prefixes. Disassembler displays prefixes in the order they appear. gas/ * config/tc-i386.c (NOTRACK_PREFIX): Removed. (REX_PREFIX): Updated. (MAX_PREFIXES): Likewise. (parse_insn): Remove restriction on NOTRACK prefix position. * testsuite/gas/i386/notrack.s: Add tests with NOTRACK prefix before other prefixes. * testsuite/gas/i386/x86-64-notrack.s: Likewise. * testsuite/gas/i386/notrackbad.s: Remove tests with NOTRACK prefix before other prefixes. * testsuite/gas/i386/x86-64-notrackbad.s: Likewise. * testsuite/gas/i386/notrack-intel.d: Updated. * testsuite/gas/i386/notrack.d: Likewise. * testsuite/gas/i386/notrackbad.l: Likewise. * testsuite/gas/i386/x86-64-notrack-intel.d: Likewise. * testsuite/gas/i386/x86-64-notrack.d: Likewise. * testsuite/gas/i386/x86-64-notrackbad.l: Likewise. opcodes/ * i386-dis.c (last_active_prefix): Removed. (ckprefix): Don't set last_active_prefix. (NOTRACK_Fixup): Don't check last_active_prefix.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c59
1 files changed, 19 insertions, 40 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 456be9e..fdff301 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -66,11 +66,8 @@
#define HLE_PREFIX REP_PREFIX
#define BND_PREFIX REP_PREFIX
#define LOCK_PREFIX 5
-/* Only one of NOTRACK_PREFIX and SEG_PREFIX can be used at the same
- time. */
-#define NOTRACK_PREFIX 6
-#define REX_PREFIX 7 /* must come last. */
-#define MAX_PREFIXES 8 /* max prefixes per opcode */
+#define REX_PREFIX 6 /* must come last. */
+#define MAX_PREFIXES 7 /* max prefixes per opcode */
/* we define the syntax here (modulo base,index,scale syntax) */
#define REGISTER_PREFIX '%'
@@ -3978,42 +3975,24 @@ parse_insn (char *line, char *mnemonic)
else
{
/* Add prefix, checking for repeated prefixes. */
- enum PREFIX_GROUP p
- = add_prefix (current_templates->start->base_opcode);
- if (p == PREFIX_DS
- && current_templates->start->cpu_flags.bitfield.cpucet)
+ switch (add_prefix (current_templates->start->base_opcode))
{
- i.notrack_prefix = current_templates->start->name;
- /* Move NOTRACK_PREFIX_OPCODE to NOTRACK_PREFIX slot so
- that it is placed before others. */
- i.prefix[SEG_PREFIX] = 0;
- i.prefix[NOTRACK_PREFIX] = NOTRACK_PREFIX_OPCODE;
- }
- else
- {
- switch (p)
- {
- case PREFIX_EXIST:
- return NULL;
- case PREFIX_REP:
- if (current_templates->start->cpu_flags.bitfield.cpuhle)
- i.hle_prefix = current_templates->start->name;
- else if (current_templates->start->cpu_flags.bitfield.cpumpx)
- i.bnd_prefix = current_templates->start->name;
- else
- i.rep_prefix = current_templates->start->name;
- break;
- default:
- break;
- }
-
- if (i.notrack_prefix != NULL)
- {
- /* There must be no other prefixes after NOTRACK
- prefix. */
- as_bad (_("expecting no other prefixes after `notrack'"));
- return NULL;
- }
+ case PREFIX_EXIST:
+ return NULL;
+ case PREFIX_DS:
+ if (current_templates->start->cpu_flags.bitfield.cpucet)
+ i.notrack_prefix = current_templates->start->name;
+ break;
+ case PREFIX_REP:
+ if (current_templates->start->cpu_flags.bitfield.cpuhle)
+ i.hle_prefix = current_templates->start->name;
+ else if (current_templates->start->cpu_flags.bitfield.cpumpx)
+ i.bnd_prefix = current_templates->start->name;
+ else
+ i.rep_prefix = current_templates->start->name;
+ break;
+ default:
+ break;
}
}
/* Skip past PREFIX_SEPARATOR and reset token_start. */