Skip to content

Conversation

@mhandb
Copy link
Contributor

@mhandb mhandb commented Dec 22, 2025

This pull request updates the initialization of AVX and AVX512 OS support detection in xsimd_cpuid.hpp. The change ensures that AVX and AVX512 are only considered enabled if the OS has explicitly enabled OSXSAVE.

Indeed, AVX and AVX512 strictly require the OS to enable OXSAVE otherwise we can face "illegal instruction"
https://wiki.osdev.org/SSE#AVX

For now I am using a local patch, but I would like to avoid to maintain it.

Let me know if this PR is good enough or if it needs any change.

AVX and AVX512 strictly require the OS to enable OXSAVE
otherwise we can face "illegal instruction" depending on the context state
@mhandb mhandb changed the title Fix default values for AVX and AVX512 depending on OSXSAVE Fix default values for AVX and AVX512 state depending on OSXSAVE Dec 22, 2025
@serge-sans-paille serge-sans-paille merged commit 6e9e932 into xtensor-stack:master Jan 5, 2026
56 of 59 checks passed
@serge-sans-paille
Copy link
Contributor

Thanks 🙇

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.

2 participants