qsimd: Add CPUID leaf 7 sub-leaf 1 detection#130
Open
amanwalksdownthestreet wants to merge 1 commit intoqt:devfrom
Open
qsimd: Add CPUID leaf 7 sub-leaf 1 detection#130amanwalksdownthestreet wants to merge 1 commit intoqt:devfrom
amanwalksdownthestreet wants to merge 1 commit intoqt:devfrom
Conversation
detectProcessorFeatures() only queries CPUID leaf 7 sub-leaf 0, missing features in sub-leaf 1. When compiled with -march=native on CPUs with these features, the compiler sets __CMPCCXADD__ and __AVXIFMA__ macros, but runtime detection returns 0, failing the compatibility check at startup. Add cpuidFeatures07_01() to query sub-leaf 1.
7b2e3a7 to
f730a05
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building Qt with -march=native on CPUs with CPUID leaf 7 sub-leaf 1 features (Intel Lunar Lake, Arrow Lake, etc.) fails at runtime:
detectProcessorFeatures() only queries sub-leaf 0, so features in sub-leaf 1 are never detected. The compiler sets CMPCCXADD and AVXIFMA macros, but runtime returns 0 for those bits, failing the compatibility check.
This adds cpuidFeatures07_01() to query sub-leaf 1 and populate Leaf07_01EAX/Leaf07_01EDX.