https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113149
--- Comment #1 from Ed Catmur <ed at catmur dot uk> --- >From b4ca8bf55100eddeaa14a52f1bc8e73fac565d83 Mon Sep 17 00:00:00 2001 From: Ed Catmur <e...@catmur.uk> Date: Tue, 26 Dec 2023 11:46:26 -0600 Subject: [PATCH] Swap P_PROC_AVX2 with P_X86_64_V3, etc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113149 Any processor with feature priority P_PROC_AVX2 necessarily supports at least all of the x86-64-v3 psABI level, but almost certainly supports more instructions; e.g. Haswell supports pclmul and rdrnd. So if there are multiversion targets for arch=x86-64-v3 and e.g. arch=haswell, the target for the specific processor should be preferred. Similarly, swap P_PROC_AVX512F with P_X86_64_V4. --- gcc/common/config/i386/i386-cpuinfo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/common/config/i386/i386-cpuinfo.h b/gcc/common/config/i386/i386-cpuinfo.h index 38fa7650de28f..593d71626e440 100644 --- a/gcc/common/config/i386/i386-cpuinfo.h +++ b/gcc/common/config/i386/i386-cpuinfo.h @@ -141,11 +141,11 @@ enum feature_priority P_PROC_FMA, P_BMI2, P_AVX2, - P_PROC_AVX2, P_X86_64_V3, + P_PROC_AVX2, P_AVX512F, - P_PROC_AVX512F, P_X86_64_V4, + P_PROC_AVX512F, P_PROC_DYNAMIC };