[hjl@gnu-gram-1 testsuite]$ cat x.s vandnpd %zmm1, %zmm1, %zmm16 vandnpd %zmm17, %zmm17, %zmm1 [hjl@gnu-gram-1 testsuite]$ as -O2 -o x.o x.s [hjl@gnu-gram-1 testsuite]$ objdump -dw x.o x.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <.text>: 0: 62 e1 f5 48 55 c1 vandnpd %zmm1,%zmm1,%zmm16 6: 62 b1 f5 40 55 c9 vandnpd %zmm17,%zmm17,%zmm1 [hjl@gnu-gram-1 testsuite]$ They should be encoded with 128-bit EVEX. [hjl@gnu-gram-1 testsuite]$ cat > y.s vandnpd %ymm1, %ymm1, %ymm15 [hjl@gnu-gram-1 testsuite]$ as -O2 -march=+noavx -o y.o y.s [hjl@gnu-gram-1 testsuite]$ objdump -dw y.o y.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <.text>: 0: c5 71 55 f9 vandnpd %xmm1,%xmm1,%xmm15 [hjl@gnu-gram-1 testsuite]$ AVX shouldn't be used when AVX isn't available.
The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=dd22218cf26fa5d8beade7266de391a28e63527b commit dd22218cf26fa5d8beade7266de391a28e63527b Author: H.J. Lu <hjl.tools@gmail.com> Date: Sun Mar 17 07:25:08 2019 +0800 x86: Correctly optimize EVEX to 128-bit VEX/EVEX We can optimize 512-bit EVEX to 128-bit EVEX encoding for upper 16 vector registers only when AVX512VL is enabled. We can't optimize EVEX to 128-bit VEX encoding when AVX isn't enabled. PR gas/24352 * config/tc-i386.c (optimize_encoding): Encode 512-bit EVEX with 128-bit VEX encoding only when AVX is enabled and with 128-bit EVEX encoding only when AVX512VL is enabled. * testsuite/gas/i386/i386.exp: Run PR gas/24352 tests. * testsuite/gas/i386/optimize-6.s: New file. * testsuite/gas/i386/optimize-6a.d: Likewise. * testsuite/gas/i386/optimize-6b.d: Likewise. * testsuite/gas/i386/optimize-6c.d: Likewise. * testsuite/gas/i386/x86-64-optimize-7.s: Likewise. * testsuite/gas/i386/x86-64-optimize-7a.d: Likewise. * testsuite/gas/i386/x86-64-optimize-7b.d: Likewise. * testsuite/gas/i386/x86-64-optimize-7c.d: Likewise. * testsuite/gas/i386/x86-64-optimize-2.d: Updated.
The master branch has been updated by H.J. Lu <hjl@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7b1d7ca194544554f7d41aea7fdf7a69c232f15d commit 7b1d7ca194544554f7d41aea7fdf7a69c232f15d Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Mar 19 21:10:21 2019 +0800 x86: Correct EVEX to 128-bit EVEX optimization Since not all AVX512F processors support AVX512VL, we can optimize 512-bit EVEX to 128-bit EVEX encoding for upper 16 vector registers only when AVX512VL is enabled explicitly at command-line or via ".arch .avx512vl" directive. PR gas/24352 * config/tc-i386.c (optimize_encoding): Check only cpu_arch_flags.bitfield.cpuavx512vl. * testsuite/gas/i386/i386.exp: Run x86-64-optimize-2b. * testsuite/gas/i386/x86-64-optimize-2.d: Revert the last change. * testsuite/gas/i386/x86-64-optimize-2b.d: New file. * testsuite/gas/i386/x86-64-optimize-2b.s: Likewise.
Fixed for 2.33.