x86: Optimize with EVEX128 encoding for AVX512VL
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 9 Mar 2018 03:57:35 +0000 (19:57 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 9 Mar 2018 03:57:48 +0000 (19:57 -0800)
commit0089daceaba4338046932e65a1b5882065416633
tree779e5859464843e858b513e0eedbec3c07c949a6
parent567a3e54d211ab8d09119f99fed10b57db895450
x86: Optimize with EVEX128 encoding for AVX512VL

We can optimize AVX512 instructions with EVEX128 only if AVX512VL is
enabled:

1. Instruction is an AVX512VL instruction. Or
2. AVX512VL is enabled explicitly by -march=+avx512vl/".arch .avx512vl".

We should optimize EVEX instructions with EVEX128 encoding when pseudo
{evex} prefix is used.

* config/tc-i386.c (set_cpu_arch): Set cpu_arch_isa_flags.
(md_parse_option): Likewise.
(optimize_encoding): Check i.tm.cpu_flags and cpu_arch_isa_flags
for cpuavx512vl instead of cpu_arch_flags.  Optimize EVEX with
EVEX128 when EVEX encoding is required.
* testsuite/gas/i386/i386.exp: Run optimize-4, optimize-5,
x86-64-optimize-5 and x86-64-optimize-6.
* testsuite/gas/i386/optimize-1.d: Updated.
* testsuite/gas/i386/x86-64-optimize-2.d: Likewise.
* testsuite/gas/i386/optimize-4.d: New file.
* testsuite/gas/i386/optimize-4.s: Likewise.
* testsuite/gas/i386/optimize-5.d: Likewise.
* testsuite/gas/i386/optimize-5.s: Likewise.
* testsuite/gas/i386/x86-64-optimize-5.d: Likewise.
* testsuite/gas/i386/x86-64-optimize-5.s: Likewise.
* testsuite/gas/i386/x86-64-optimize-6.d: Likewise.
* testsuite/gas/i386/x86-64-optimize-6.s: Likewise.
13 files changed:
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/optimize-1.d
gas/testsuite/gas/i386/optimize-4.d [new file with mode: 0644]
gas/testsuite/gas/i386/optimize-4.s [new file with mode: 0644]
gas/testsuite/gas/i386/optimize-5.d [new file with mode: 0644]
gas/testsuite/gas/i386/optimize-5.s [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-optimize-2.d
gas/testsuite/gas/i386/x86-64-optimize-5.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-optimize-5.s [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-optimize-6.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-optimize-6.s [new file with mode: 0644]