Skip to content

Safe reading of CPUID#1277

Open
AntoinePrv wants to merge 7 commits intoxtensor-stack:masterfrom
AntoinePrv:cpuid-safe
Open

Safe reading of CPUID#1277
AntoinePrv wants to merge 7 commits intoxtensor-stack:masterfrom
AntoinePrv:cpuid-safe

Conversation

@AntoinePrv
Copy link
Contributor

@AntoinePrv AntoinePrv commented Mar 23, 2026

Not implemented previously in xsimd, CPUID requires to first check which leaves are available before calling it, otherwise the value returned may be invalid.

  • Before reading leaf < 0x80000000, check leaf 0 EAX
  • Before reading leaf > 0x80000000, check leaf 0x80000000 EAX
  • Before reading leaf 7 subleaf 1, check leaf 7 EAX

@AntoinePrv AntoinePrv force-pushed the cpuid-safe branch 2 times, most recently from 3f1c905 to ba6d557 Compare March 24, 2026 10:51
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