Skip to content

x86: Added some bmi1 and bmi2 intrinsics - #1347

Merged
mr-c merged 2 commits into
simd-everywhere:masterfrom
ethomag:x86-pext-pdep
Jan 4, 2026
Merged

mr-c merged 2 commits into
simd-everywhere:masterfrom
ethomag:x86-pext-pdep

Conversation

@ethomag

@ethomag ethomag commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Hi @mr-c, I tried to follow the already established structure , using x86/clmul.h as a template. There are three added x86 intrinsics present in the "bmi1" and "bmi2" feature sets of the ISA (as reported by lscpu on Linux). I bundled them into a new file (x86/bmi.h) and added SIMDE-prefixed feature test macros. Just like x86/clmul.h this new file is not included by default in any other file - so to use these new intrinsics one needs to explicitly include bmi.h. I have not added tests since I have not wrapped my head around how testing works, yet. But, I plan to do so in the future.

Comment thread simde/x86/bmi.h
@mr-c

mr-c commented Oct 16, 2025

Copy link
Copy Markdown
Collaborator

Thank you @ethomag! Let me know if you want help with the tests. They are a bit odd since you write them one way to generate the test matrices, and then you paste the values in.

@ethomag

ethomag commented Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

If I manage to write a test, can I run the test locally just for my local architecture somehow, before pushing ?

@mr-c

mr-c commented Oct 16, 2025

Copy link
Copy Markdown
Collaborator

If I manage to write a test, can I run the test locally just for my local architecture somehow, before pushing ?

Yes, please iterate on the tests locally so that they at least pass for you. If you need assistance we can schedule a video call and do some pair programming.

@mr-c

mr-c commented Oct 16, 2025

Copy link
Copy Markdown
Collaborator

Comment thread simde/x86/bmi.h Outdated
Comment thread simde/simde-arch.h Outdated
@mr-c

mr-c commented Oct 17, 2025

Copy link
Copy Markdown
Collaborator

Thank you @ethomag ! I will do some cleanups and merge 🙏

@ethomag

ethomag commented Oct 17, 2025

Copy link
Copy Markdown
Contributor Author

Thank you, Michael for your support and corrections. I would not have figured out the feature test macros by myself. And what a great testing framework you have set up, really easy to get going (once you read the tutorial :)).

As far as I know for now, I don't have any more updates in the pipe.

Have a great weekend!

@ethomag

ethomag commented Oct 17, 2025

Copy link
Copy Markdown
Contributor Author

One more question, when I do ninja install it builds all the tests, is there an easy way to install the headers without building the tests ?

@mr-c

mr-c commented Oct 17, 2025

Copy link
Copy Markdown
Collaborator

Thank you, Michael for your support and corrections. I would not have figured out the feature test macros by myself. And what a great testing framework you have set up, really easy to get going (once you read the tutorial :)).

:-D The SIMDe creator and major author is @nemequ ; he set up the testing framework

As far as I know for now, I don't have any more updates in the pipe.

Have a great weekend!

Thank you and you as well!

One more question, when I do ninja install it builds all the tests, is there an easy way to install the headers without building the tests ?

Yep, ninja/meson is just for developers. Since SIMDe is a header-only library, just copy the simde folder within your repo checkout to wherever you want it.

@ethomag ethomag closed this Oct 21, 2025
@ethomag

ethomag commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

Oops, maybe I closed it prematurely ?

@ethomag ethomag reopened this Oct 21, 2025
@mr-c
mr-c enabled auto-merge (rebase) January 3, 2026 12:19
@mr-c
mr-c merged commit 721c1d1 into simd-everywhere:master Jan 4, 2026
123 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