Skip to content

Add efficient_bmi2 cpu feature#1354

Merged
AntoinePrv merged 1 commit into
xtensor-stack:masterfrom
AntoinePrv:cpu-bmi2
May 22, 2026
Merged

Add efficient_bmi2 cpu feature#1354
AntoinePrv merged 1 commit into
xtensor-stack:masterfrom
AntoinePrv:cpu-bmi2

Conversation

@AntoinePrv
Copy link
Copy Markdown
Contributor

No description provided.

@AntoinePrv AntoinePrv requested a review from JohanMabille May 21, 2026 16:59
auto ext_model = leaf1().get_range<eax::ext_model_start, eax::ext_model_end>();
auto family_id = leaf1().get_range<eax::family_id_start, eax::family_id_end>();
return (family_id == 15 || family_id == 6) ? ((ext_model << 4) + model) : model;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it would be great to add some testing for those.
I wonder if we could compare to the output of __builtin_cpu_is and __builtin_cpu_supports as a sanity check?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(can be in a follow-up)

@serge-sans-paille
Copy link
Copy Markdown
Contributor

LGTM

@serge-sans-paille
Copy link
Copy Markdown
Contributor

btw: thanks for quoting the wikipedia page, it helped a lot for the review

@AntoinePrv AntoinePrv merged commit 510b4f1 into xtensor-stack:master May 22, 2026
89 checks passed
@AntoinePrv
Copy link
Copy Markdown
Contributor Author

I think a good approach would be an optional executable that spit it all out as text.
Then we can easily compare with cpuinfo etc. Would also be useful for our user if they ever need to debug if we detect feature xxx.

@AntoinePrv AntoinePrv deleted the cpu-bmi2 branch May 22, 2026 08:34
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