aboutsummaryrefslogtreecommitdiff
path: root/opcodes
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 /opcodes
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 'opcodes')
-rw-r--r--opcodes/ChangeLog6
-rw-r--r--opcodes/i386-dis.c18
2 files changed, 8 insertions, 16 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index b8c1586..fb1fc36 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ * i386-dis.c (last_active_prefix): Removed.
+ (ckprefix): Don't set last_active_prefix.
+ (NOTRACK_Fixup): Don't check last_active_prefix.
+
2017-08-31 Nick Clifton <nickc@redhat.com>
* po/fr.po: Updated French translation.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index a3ce08d..edf5345 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -3169,7 +3169,6 @@ static int last_data_prefix;
static int last_addr_prefix;
static int last_rex_prefix;
static int last_seg_prefix;
-static int last_active_prefix;
static int fwait_prefix;
/* The active segment register prefix. */
static int active_seg_prefix;
@@ -12303,7 +12302,6 @@ ckprefix (void)
last_addr_prefix = -1;
last_rex_prefix = -1;
last_seg_prefix = -1;
- last_active_prefix = -1;
fwait_prefix = -1;
active_seg_prefix = 0;
for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
@@ -12416,10 +12414,7 @@ ckprefix (void)
return 1;
}
if (*codep != FWAIT_OPCODE)
- {
- last_active_prefix = i;
- all_prefixes[i++] = *codep;
- }
+ all_prefixes[i++] = *codep;
rex = newrex;
codep++;
length++;
@@ -16820,17 +16815,8 @@ NOTRACK_Fixup (int bytemode ATTRIBUTE_UNUSED,
if (active_seg_prefix == PREFIX_DS
&& (address_mode != mode_64bit || last_data_prefix < 0))
{
- /* NOTRACK prefix is only valid on indirect branch instructions
- and it must be the last prefix before REX prefix and opcode.
+ /* NOTRACK prefix is only valid on indirect branch instructions.
NB: DATA prefix is unsupported for Intel64. */
- if (last_active_prefix >= 0)
- {
- int notrack_prefix = last_active_prefix;
- if (last_rex_prefix == last_active_prefix)
- notrack_prefix--;
- if (all_prefixes[notrack_prefix] != NOTRACK_PREFIX_OPCODE)
- return;
- }
active_seg_prefix = 0;
all_prefixes[last_seg_prefix] = NOTRACK_PREFIX;
}