Skip to content

fix(x86): require OS AVX support for F16C, VAES and VPCLMULQDQ - #473

Open
dennisimoo wants to merge 2 commits into
google:mainfrom
dennisimoo:codex/fix-f16c-os-support
Open

dennisimoo wants to merge 2 commits into
google:mainfrom
dennisimoo:codex/fix-f16c-os-support

Conversation

@dennisimoo

Copy link
Copy Markdown

F16C, VAES and VPCLMULQDQ were reported from their CPUID bits even when the OS
does not enable the required XMM/YMM state. A caller selecting instructions from
these flags could therefore select an unsupported path.

Move the three assignments into the existing os_preserves->avx_registers
block alongside AVX and FMA3. This follows the SIMD availability contract at the
top of the implementation; LLVM's host detection
also gates all three features on HasAVXSave. No public API changes.

The regression test advertises all three CPUID features and toggles OS register
support. All three negative assertions fail before the fix; both disabled and
enabled cases pass afterward.

Tested on x86-64 Linux with GCC 13:

cmake -S . -B /tmp/cpu-features-build -G Ninja -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build /tmp/cpu-features-build -j 2
ctest --test-dir /tmp/cpu-features-build --output-on-failure
/tmp/cpu-features-build/list_cpu_features --json

All four native test executables pass. This was found during source review, not
from a reported downstream incident. Prepared with AI assistance.

@dennisimoo

dennisimoo commented Sep 15, 2026

Copy link
Copy Markdown
Author

Fixed formatting in 6fe7b10 using CI’s formatter. All four local tests pass; CI awaits approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant