aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2018-04-26 08:49:41 +0200
committerJan Beulich <jbeulich@suse.com>2018-04-26 08:49:41 +0200
commit1d3f82868db8881cd9ce79ad151fb0a7ebeb2c5a (patch)
treeee3c455995bb41865782217abed641a53569fdcf /gas/config
parentx86: CpuXSAVE is a prereq for various other features (diff)
downloadbinutils-gdb-1d3f82868db8881cd9ce79ad151fb0a7ebeb2c5a.tar.gz
binutils-gdb-1d3f82868db8881cd9ce79ad151fb0a7ebeb2c5a.tar.bz2
binutils-gdb-1d3f82868db8881cd9ce79ad151fb0a7ebeb2c5a.zip
x86: properly force / avoid forcing EVEX encoding
Pseudo prefixes are supposed to be a hint only - when the specific encoding can't be used to encode an insn, silently override it. But this overriding must only happen after the respective check, to avoid forcing EVEX encoding because of something that isn't a valid register name in the given context.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 723fc3e6c2e..a48cfc2fc9f 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -10180,17 +10180,15 @@ parse_real_register (char *reg_string, char **end_op)
&& (r->reg_num == RegEiz || r->reg_num == RegRiz))
return (const reg_entry *) NULL;
- /* Upper 16 vector register is only available with VREX in 64bit
- mode. */
- if ((r->reg_flags & RegVRex))
+ /* Upper 16 vector registers are only available with VREX in 64bit
+ mode, and require EVEX encoding. */
+ if (r->reg_flags & RegVRex)
{
- if (i.vec_encoding == vex_encoding_default)
- i.vec_encoding = vex_encoding_evex;
-
if (!cpu_arch_flags.bitfield.cpuvrex
- || i.vec_encoding != vex_encoding_evex
|| flag_code != CODE_64BIT)
return (const reg_entry *) NULL;
+
+ i.vec_encoding = vex_encoding_evex;
}
if (((r->reg_flags & (RegRex64 | RegRex))