Skip to content

Remove no-asm gating when there is no alternative implementation #994

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 1 commit into from
Jul 27, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jul 25, 2025

Assembly-related configuration was added in 1621c6d ("Use
specialized-div-rem 1.0.0 for division algorithms") to account for
Cranelift not yet supporting assembly. This hasn't been relevant for a
while, so we no longer need to gate asm! behind this configuration.
Thus, remove cfg(not(feature = "no-asm")) in places where there is no
generic fallback.

There are other cases, however, where setting the no-asm configuration
enables testing of generic version of builtins when there are platform-
specific implementations available; these cases are left unchanged. This
could be improved in the future by exposing both versions for testing
rather than using a configuration and running the entire testsuite
twice.

This is the compiler-builtins portion of
rust-lang/rust#144471.

@tgross35 tgross35 requested a review from Amanieu July 25, 2025 23:00
@tgross35
Copy link
Contributor Author

On second thought, maybe it is a good thing to provide a way to require the generic implementations when they exist, so there is a way to keep testing them on platforms that have asm versions. We still don't need this for functions that only have an assembly implementation.

I'll update.

@tgross35 tgross35 changed the title Remove the no-asm feature Remove no-asm gating when there is no alternative implementation Jul 26, 2025
@tgross35 tgross35 enabled auto-merge (rebase) July 27, 2025 21:29
Assembly-related configuration was added in 1621c6d ("Use
`specialized-div-rem` 1.0.0 for division algorithms") to account for
Cranelift not yet supporting assembly. This hasn't been relevant for a
while, so we no longer need to gate `asm!` behind this configuration.
Thus, remove `cfg(not(feature = "no-asm"))` in places where there is no
generic fallback.

There are other cases, however, where setting the `no-asm` configuration
enables testing of generic version of builtins when there are platform-
specific implementations available; these cases are left unchanged. This
could be improved in the future by exposing both versions for testing
rather than using a configuration and running the entire testsuite
twice.

This is the compiler-builtins portion of
rust-lang/rust#144471.
@tgross35 tgross35 merged commit b7cdb73 into rust-lang:master Jul 27, 2025
38 checks passed
@tgross35 tgross35 deleted the remove-no-asm branch July 27, 2025 21:41
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