https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85328
Bug ID: 85328 Summary: accessing ymm16 with non-avx512 instruction form Product: gcc Version: 8.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: zsojka at seznam dot cz Target Milestone: --- Created attachment 43902 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43902&action=edit reduced testcase Compiler output: $ x86_64-pc-linux-gnu-gcc -O3 -fno-caller-saves -mavx512f testcase.c /tmp/ccNXhuu3.s: Assembler messages: /tmp/ccNXhuu3.s:418: Error: unsupported instruction `vpand' The failing instruction is: ... vpand %ymm16, %ymm1, %ymm1 ... I tried both most recent GNU as and NASM (both from most recent GIT), but neither accept this form. Accessing ymm >= 16 is allowed only with the EVEX-prefixed VPANDD or VPANDQ. I am really not an expert in AVX512 instruction encoding, but gcc seems to be wrong here according to the assemblers I tested and Intel's SDM vol.2: only vpandd/vpandq are using the EVEX prefix, and you can use ymm >= 16 only with the EVEX prefix. (this can be generalized to other instructions, such as vpor, and maybe to other registers, such as xmm/zmm) $ x86_64-pc-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-259207-checking-yes-rtl-df-extra-nobootstrap-pr85177-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --disable-bootstrap --with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-259207-checking-yes-rtl-df-extra-nobootstrap-pr85177-amd64 Thread model: posix gcc version 8.0.1 20180407 (experimental) (GCC)