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 3 times, most recently from ba6d557 to 25a1cf8 Compare March 24, 2026 12:17
@AntoinePrv
Copy link
Contributor Author

@serge-sans-paille this one is ready too

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