Skip to content

Use rounding instructions on aarch64 #903

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TDecking
Copy link
Contributor

@TDecking TDecking commented May 2, 2025

This extends the use of dedicated rounding instructions to the remaining rounding related functions such as trunc.
This also fixes an incorrect use of the frintn instruction, which was used for the implementation of rint instead of roundeven.

ci: allow-many-extensive

@tgross35
Copy link
Contributor

tgross35 commented May 5, 2025

I had a similar change as part of the original diff for rust-lang/libm#459. The result was that we can omit these since we will have them in core soon (rust-lang/rust#138087) and LLVM will do a reasonable lowering from there.

Regarding rint: with Rust/LLVM we don't interact with fpenv and also don't make any guarantees about it to C code that calls Rust functions, so frintn is the most simple instruction to meet our uses of rint. There is a bit of discussion at rust-lang/libm#459 (comment).

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