GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
i386

Fix zen6 AVX512BMM cpuid check

Correctly detects AVX512BMM support for Zen 6 CPUs.

This commit corrects the CPU identification for the AVX512BMM instruction set on AMD Zen 6 processors. Previously, the bit_AVX512BMM flag was incorrectly checked against the standard CPUID leaf. This patch moves the detection to the extended features section of CPUID, aligning with how newer instruction sets are exposed. New compile-time and run-time tests are added to verify the fix for __builtin_cpu_supports('avx512bmm').

In Details

The bit_AVX512BMM feature flag, which is part of the extended CPUID information (leaf 7, ECX), was previously checked against the standard CPUID leaf 1. This commit moves the check to the correct location within the extended features section in cpuinfo.h and cpuid.h. This ensures that the __builtin_cpu_supports("avx512bmm") intrinsic correctly reports availability for processors like AMD's Zen 6.

For Context
AVX512BMM
An instruction set extension for x86 processors that provides advanced bit manipulation instructions, particularly useful for AI and machine learning workloads.
CPUID
An x86 instruction that allows software to identify the processor's capabilities and features. Information is returned in registers based on input values to the instruction.
Zen 6
The sixth generation of AMD's Zen microarchitecture, featuring performance improvements and new instruction set support.
__builtin_cpu_supports
A GCC intrinsic function that allows code to query at runtime whether the processor supports a given CPU feature string (e.g., 'avx2', 'avx512f').
Filed Under: x86cpu featureamdavx512