From f91407f0120ac4f3a8d9ea647f1bd44030654f7b Mon Sep 17 00:00:00 2001 From: Yegor Yefremov Date: Thu, 17 Sep 2026 09:53:25 +0200 Subject: [PATCH] arch/Config.in.x86: add BR2_X86_CPU_HAS_XOP The AMD Bulldozer family (bdver1 to bdver4, i.e. bulldozer, piledriver, steamroller and excavator) is the only x86 family implementing the XOP instruction set, together with the equally Bulldozer-specific FMA4 and LWP extensions, and TBM starting with bdver2. All of them were dropped again with Zen. This can be verified with: $ gcc -march=bdver1 -Q --help=target | grep -E '\-m(xop|fma4|tbm|lwp)' -mfma4 [enabled] -mlwp [enabled] -mtbm [disabled] -mxop [enabled] $ gcc -march=bdver2 -Q --help=target | grep -E '\-m(xop|fma4|tbm|lwp)' -mfma4 [enabled] -mlwp [enabled] -mtbm [enabled] -mxop [enabled] with bdver3 and bdver4 behaving like bdver2. Add a hidden BR2_X86_CPU_HAS_XOP capability symbol and select it from those four CPU variants, so that packages which cannot cope with this instruction set can depend on it, instead of listing the CPU variants one by one. The first user is host-qemu, whose TCG engine does not implement XOP. Signed-off-by: Yegor Yefremov Assisted-by: Claude:claude-opus-5 Signed-off-by: Thomas Petazzoni --- arch/Config.in.x86 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/Config.in.x86 b/arch/Config.in.x86 index 3c4a725360..51b157409f 100644 --- a/arch/Config.in.x86 +++ b/arch/Config.in.x86 @@ -20,6 +20,14 @@ config BR2_X86_CPU_HAS_AVX config BR2_X86_CPU_HAS_AVX2 bool +# BR2_X86_CPU_HAS_XOP is selected by the AMD Bulldozer family (bdver1 +# to bdver4), which is the only family implementing XOP. On those CPUs, +# gcc also enables the equally Bulldozer-specific FMA4 and LWP +# extensions (and TBM starting with bdver2). Those extensions were +# dropped again with Zen. +config BR2_X86_CPU_HAS_XOP + bool + # BR2_X86_CPU_HAS_AVX512 implies the following AVX512 extensions: # AVX512F, AVX512BW, AVX512CD, AVX512DQ, AVX512VL # This subset is common to Intel Xeon (excl Xeon Phi), AMD Zen 4, and @@ -604,6 +612,7 @@ config BR2_x86_bulldozer select BR2_X86_CPU_HAS_SSSE3 select BR2_X86_CPU_HAS_SSE4 select BR2_X86_CPU_HAS_SSE42 + select BR2_X86_CPU_HAS_XOP config BR2_x86_piledriver bool "piledriver" select BR2_X86_CPU_HAS_MMX @@ -613,6 +622,7 @@ config BR2_x86_piledriver select BR2_X86_CPU_HAS_SSSE3 select BR2_X86_CPU_HAS_SSE4 select BR2_X86_CPU_HAS_SSE42 + select BR2_X86_CPU_HAS_XOP config BR2_x86_steamroller bool "steamroller" select BR2_X86_CPU_HAS_MMX @@ -622,6 +632,7 @@ config BR2_x86_steamroller select BR2_X86_CPU_HAS_SSSE3 select BR2_X86_CPU_HAS_SSE4 select BR2_X86_CPU_HAS_SSE42 + select BR2_X86_CPU_HAS_XOP select BR2_ARCH_NEEDS_GCC_AT_LEAST_4_8 config BR2_x86_excavator bool "excavator" @@ -634,6 +645,7 @@ config BR2_x86_excavator select BR2_X86_CPU_HAS_SSE42 select BR2_X86_CPU_HAS_AVX select BR2_X86_CPU_HAS_AVX2 + select BR2_X86_CPU_HAS_XOP select BR2_ARCH_NEEDS_GCC_AT_LEAST_4_9 config BR2_x86_zen bool "zen"