summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2018-03-08 08:45:56 +0100
committerJan Beulich <jbeulich@suse.com>2018-03-08 08:45:56 +0100
commitab592e757ed0a4117f68c6b722803e8ba108bf66 (patch)
tree548061083e88cd378047d7fe96e523af4845a97c
parentdb12e14ea0f35738dbde263a8d37610995227853 (diff)
downloadbinutils-gdb-ab592e757ed0a4117f68c6b722803e8ba108bf66.tar.gz
x86: change AVX512VL handling in cpu_flags_match()
In order to add an AVX512F counterpart to the present AVX checking, it is better to move the AVX512VL check out of the conditional it's currently in.
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/config/tc-i386.c16
2 files changed, 9 insertions, 11 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 144edef8f7e..bd58786864a 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,9 @@
2018-03-08 Jan Beulich <jbeulich@suse.com>
+ * config/tc-i386.c (cpu_flags_match): Move AVX512VL check ahead.
+
+2018-03-08 Jan Beulich <jbeulich@suse.com>
+
* config/tc-i386.c (CPU_FLAGS_32BIT_MATCH): Delete.
(cpu_flags_match): Use CPU_FLAGS_ARCH_MATCH instead of
CPU_FLAGS_32BIT_MATCH.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index dee36446f27..7f2bd2dace4 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1712,6 +1712,11 @@ cpu_flags_match (const insn_template *t)
/* This instruction is available only on some archs. */
i386_cpu_flags cpu = cpu_arch_flags;
+ /* AVX512VL is no standalone feature - match it and then strip it. */
+ if (x.bitfield.cpuavx512vl && !cpu.bitfield.cpuavx512vl)
+ return match;
+ x.bitfield.cpuavx512vl = 0;
+
cpu = cpu_flags_and (x, cpu);
if (!cpu_flags_all_zero (&cpu))
{
@@ -1724,17 +1729,6 @@ cpu_flags_match (const insn_template *t)
&& (!x.bitfield.cpupclmul || cpu.bitfield.cpupclmul))
match |= CPU_FLAGS_ARCH_MATCH;
}
- else if (x.bitfield.cpuavx512vl)
- {
- /* Match AVX512VL. */
- if (cpu.bitfield.cpuavx512vl)
- {
- /* Need another match. */
- cpu.bitfield.cpuavx512vl = 0;
- if (!cpu_flags_all_zero (&cpu))
- match |= CPU_FLAGS_ARCH_MATCH;
- }
- }
else
match |= CPU_FLAGS_ARCH_MATCH;
}