Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Replace calls to core::arch intrinsics with assembly #534

Merged
merged 2 commits into from
Apr 9, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Apr 9, 2025

Some backends may replace calls to core::arch with multiple calls to sqrt 1, which becomes recursive. Help mitigate this by replacing the call with assembly.

Results in the same assembly as the current implementation when built with optimizations.

Some backends may replace calls to `core::arch` with multiple calls to
`sqrt` [1], which becomes recursive. Help mitigate this by replacing the
call with assembly.

Results in the same assembly as the current implementation when built
with optimizations.

[1]: rust-lang/compiler-builtins#649
@tgross35 tgross35 marked this pull request as ready for review April 9, 2025 02:05
@tgross35 tgross35 enabled auto-merge (rebase) April 9, 2025 02:46
@tgross35 tgross35 merged commit 4eb6705 into rust-lang:master Apr 9, 2025
35 checks passed
@tgross35 tgross35 deleted the x86-sqrt-asm branch April 9, 2025 17:38
tgross35 added a commit to tgross35/compiler-builtins that referenced this pull request Apr 9, 2025
Includes [1] and [2], which should resolve problems cg_gcc has using
scalar math operations as a fallback for vector operations.

[1]: rust-lang/libm#459
[2]: rust-lang/libm#534
tgross35 added a commit to rust-lang/compiler-builtins that referenced this pull request Apr 9, 2025
Includes [1] and [2], which should resolve problems cg_gcc has using
scalar math operations as a fallback for vector operations.

[1]: rust-lang/libm#459
[2]: rust-lang/libm#534
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant