aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2020-06-25 09:26:28 +0200
committerJan Beulich <jbeulich@suse.com>2020-06-25 09:26:28 +0200
commit0b9404fd37c99dc322ae0502d8af6f7c07eb558d (patch)
treed2f79f5d2542a54661f86905da615730ab7fdb41 /gas/config
parenta5aeccd9d33b8cea1ca9145fdeb1be4978cadaeb (diff)
downloadfsf-binutils-gdb-0b9404fd37c99dc322ae0502d8af6f7c07eb558d.zip
fsf-binutils-gdb-0b9404fd37c99dc322ae0502d8af6f7c07eb558d.tar.gz
fsf-binutils-gdb-0b9404fd37c99dc322ae0502d8af6f7c07eb558d.tar.bz2
x86-64: REX prefix is invalid with VEX etc
Just like for the data size prefix (see commit 7a8655d2bbdc ["x86: don't abort() upon DATA16 prefix on (E)VEX encoded insn"]), any form of REX prefix is invalid with VEX/XOP/EVEX.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index c84192e..f1a7a34 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4893,10 +4893,20 @@ md_assemble (char *line)
return;
}
+ /* Check for explicit REX prefix. */
+ if (i.prefix[REX_PREFIX] || i.rex_encoding)
+ {
+ as_bad (_("REX prefix invalid with `%s'"), i.tm.name);
+ return;
+ }
+
if (i.tm.opcode_modifier.vex)
build_vex_prefix (t);
else
build_evex_prefix ();
+
+ /* The individual REX.RXBW bits got consumed. */
+ i.rex &= REX_OPCODE;
}
/* Handle conversion of 'int $3' --> special int3 insn. XOP or FMA4
@@ -9275,9 +9285,6 @@ output_insn (void)
if (*q)
switch (j)
{
- case REX_PREFIX:
- /* REX byte is encoded in VEX prefix. */
- break;
case SEG_PREFIX:
case ADDR_PREFIX:
FRAG_APPEND_1_CHAR (*q);