Skip to content

Fix avx512vp cpuid#1355

Merged
serge-sans-paille merged 1 commit into
xtensor-stack:masterfrom
AntoinePrv:cpu-avx512vl
May 21, 2026
Merged

Fix avx512vp cpuid#1355
serge-sans-paille merged 1 commit into
xtensor-stack:masterfrom
AntoinePrv:cpu-avx512vl

Conversation

@AntoinePrv
Copy link
Copy Markdown
Contributor

@AntoinePrv AntoinePrv commented May 21, 2026

This will properly apply the chain
leaf1:osxsave -> xcr0:[xy]mm
With proper default if osxsave is not set.

Previously only this checks for saving zmm registers (avx512_enabled) so this would get deactivted every time 512 bits registers get deactivated (which would be one motivation for using smaller registers).

@serge-sans-paille I think you might have gotten the first implementation wrong, no?

Comment on lines +860 to +865
inline bool avx_128() const noexcept
{
// Avx 128 bit instructions use the same xmm registers from SSE so checking if those
// are enabled is sufficient.
return sse_enabled() && leaf1().all_bits_set<x86_cpuid_leaf1::ecx::avx>();
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding a comment

Comment on lines +877 to +882
inline bool avx2_128() const noexcept
{
// Avx 128 bit instructions use the same xmm registers from SSE so checking if those
// are enabled is sufficient.
return sse_enabled() && leaf7().all_bits_set<x86_cpuid_leaf7::ebx::avx2>();
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, this is just one extra comment

@serge-sans-paille
Copy link
Copy Markdown
Contributor

Thanks!

@serge-sans-paille serge-sans-paille merged commit 4198b3d into xtensor-stack:master May 21, 2026
89 checks passed
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