aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-03-09 08:54:32 +0100
committerJan Beulich <jbeulich@suse.com>2021-03-09 08:54:32 +0100
commit742732c7f0a989eaba7c1acac3ca5eeaa274df0e (patch)
tree32ec72bb67be1d97b75aac567debc8630c3aae09 /gas
parente93a3b27b23ca2850c01dfc8fdf1aa237d819193 (diff)
downloadbinutils-742732c7f0a989eaba7c1acac3ca5eeaa274df0e.zip
binutils-742732c7f0a989eaba7c1acac3ca5eeaa274df0e.tar.gz
binutils-742732c7f0a989eaba7c1acac3ca5eeaa274df0e.tar.bz2
x86: fold some prefix related attributes into a single one
RepPrefixOk, HLEPrefixOk, and NoTrackPrefixOk can't be specified together, so can share an enum-like field. IsLockable can be inferred from HLE setting and hence only needs specifying when neither of them is present.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-i386.c21
2 files changed, 19 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ee553fb..74811be 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,12 @@
2021-03-09 Jan Beulich <jbeulich@suse.com>
+ * config/tc-i386.c (check_hle): Replace HLEPrefix* by Prefix*.
+ (md_assemble): Replace use of repprefixok, islockable, and
+ notrackprefixok.
+ (i386_index_check): Replace use of repprefixok.
+
+2021-03-09 Jan Beulich <jbeulich@suse.com>
+
* testsuite/gas/i386/noreg64.s: Add sysexit.
* testsuite/gas/i386/x86-64-sysenter-amd.s: Split sysexit into
sysexitl and sysexitq.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 2aaffff..0790122 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4038,22 +4038,25 @@ process_immext (void)
static int
check_hle (void)
{
- switch (i.tm.opcode_modifier.hleprefixok)
+ switch (i.tm.opcode_modifier.prefixok)
{
default:
abort ();
- case HLEPrefixNone:
+ case PrefixLock:
+ case PrefixNone:
+ case PrefixNoTrack:
+ case PrefixRep:
as_bad (_("invalid instruction `%s' after `%s'"),
i.tm.name, i.hle_prefix);
return 0;
- case HLEPrefixLock:
+ case PrefixHLELock:
if (i.prefix[LOCK_PREFIX])
return 1;
as_bad (_("missing `lock' with `%s'"), i.hle_prefix);
return 0;
- case HLEPrefixAny:
+ case PrefixHLEAny:
return 1;
- case HLEPrefixRelease:
+ case PrefixHLERelease:
if (i.prefix[HLE_PREFIX] != XRELEASE_PREFIX_OPCODE)
{
as_bad (_("instruction `%s' after `xacquire' not allowed"),
@@ -4792,7 +4795,7 @@ md_assemble (char *line)
return;
/* Check if REP prefix is OK. */
- if (i.rep_prefix && !i.tm.opcode_modifier.repprefixok)
+ if (i.rep_prefix && i.tm.opcode_modifier.prefixok != PrefixRep)
{
as_bad (_("invalid instruction `%s' after `%s'"),
i.tm.name, i.rep_prefix);
@@ -4802,7 +4805,7 @@ md_assemble (char *line)
/* Check for lock without a lockable instruction. Destination operand
must be memory unless it is xchg (0x86). */
if (i.prefix[LOCK_PREFIX]
- && (!i.tm.opcode_modifier.islockable
+ && (i.tm.opcode_modifier.prefixok < PrefixLock
|| i.mem_operands == 0
|| (i.tm.base_opcode != 0x86
&& !(i.flags[i.operands - 1] & Operand_Mem))))
@@ -4830,7 +4833,7 @@ md_assemble (char *line)
as_bad (_("expecting valid branch instruction after `bnd'"));
/* Check NOTRACK prefix. */
- if (i.notrack_prefix && !i.tm.opcode_modifier.notrackprefixok)
+ if (i.notrack_prefix && i.tm.opcode_modifier.prefixok != PrefixNoTrack)
as_bad (_("expecting indirect branch instruction after `notrack'"));
if (i.tm.cpu_flags.bitfield.cpumpx)
@@ -11047,7 +11050,7 @@ i386_index_check (const char *operand_string)
kind = "string address";
- if (current_templates->start->opcode_modifier.repprefixok)
+ if (current_templates->start->opcode_modifier.prefixok == PrefixRep)
{
int es_op = current_templates->end[-1].opcode_modifier.isstring
- IS_STRING_ES_OP0;