Skip to content

Remove tzcnt from audited BMI1 instructions #1380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2025
Merged

Remove tzcnt from audited BMI1 instructions #1380

merged 2 commits into from
May 8, 2025

Conversation

topolarity
Copy link
Contributor

@topolarity topolarity commented May 6, 2025

By happy-accident, older CPU's decode this instruction in a backwards-compatible way for non-zero inputs 1, so it can be used even without feature support. In fact, compilers will emit this instruction in some circumstances even when BMI1 is not technically available on your architecture.

I hit this on JuliaPackaging/Yggdrasil#11124

Footnotes

  1. https://stackoverflow.com/questions/61422827/does-x64-support-imply-bmi1-support

As it turns out [^1], compilers will emit this instruction in some
circumstances even when BMI1 is not technically available on your
architecture, since by happy-accident older CPU's decode this
instruction in backward-compatible way for non-zero inputs.

[^1]: https://stackoverflow.com/questions/61422827/does-x64-support-imply-bmi1-support
@giordano
Copy link
Member

giordano commented May 6, 2025

It'd be better to update the script https://github.com/JuliaPackaging/BinaryBuilder.jl/blob/2a5e7117be9ade099cd1092e7a444bdcffc37500/contrib/generate_instructions_list.jl which generates that file, otherwise this change risks of being overwritten.

Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

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

Thanks!

@giordano giordano merged commit 6c8ab20 into master May 8, 2025
10 checks passed
@giordano giordano deleted the ct/rm-tzcnt branch May 8, 2025 15:00
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