https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121606
Bug ID: 121606 Summary: -march=native on AVX10.1 capable host warns about -mno-evex512 Product: gcc Version: 15.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: marko.makela at mariadb dot com Target Milestone: --- The following test program throws a warning when built with -march=native on a system that supports AVX10.1. #include <immintrin.h> __attribute__((target("avx10.1"))) __m128i xor3(__m128i a,__m128i b,__m128i c) { return _mm_ternarylogic_epi64(a, b, c, 0xf0 ^ 0xcc ^ 0xaa); } s.c:3:1: warning: ‘-mno-evex512’ or ‘-mno-avx512XXX’ cannot disable AVX10 instructions when AVX10.1-512 is available in GCC 15, behavior will change to it will disable that part of AVX512 instructions since GCC 16 3 | { return _mm_ternarylogic_epi64(a, b, c, 0xf0 ^ 0xcc ^ 0xaa); } | ^ Curiously, this seems to contradict the output of the following: gcc-15 -march=native -Q --help=target|grep evex512 -mevex512 [enabled] Without -march=native there is no warning. In either case, the intrinsic correctly translates into vpternlogq 0x96 (ternary exclusive or). I am using the Debian package gcc-15, which reports its version as 15.2.0-1. The above code was extracted from https://github.com/dr-m/crc32_simd (file crc32_avx512.cc). That has been tested with GCC 11 through 14 when using the equivalent target("evex512,avx512f,avx512dq,avx512bw,avx512vl"). I just tested it with the Debian gcc-14 version 14.3.0-5. In case it matters, the host CPU is an AMD Ryzen AI 9 HX 370 w/ Radeon 890M (AMD Zen 5 microarchitecture).