You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
Use core::arch intrinsics for for rint and rintf where possible #421
These functions don't have any arch-specialized versions right now. I believe they can be done with smaller code size and better performance on some targets:
AArch64 with target_feature=neon has frintn but the scalar versions don't seem to be exposed in core::arch. I guess the vector versions (e.g., vrndn_f32) are still an improvement over softfloat even if they need an unnecessary scalar->vector splat.
On x86 and x86_64, there's _mm_round_{sd,ss} and _MM_FROUND_TO_NEAREST_INT. But this requires SSE4.1 so it's not applicable unless someone happens to build libm from crates.io with appropriate RUSTFLAGS.
This would be very welcome, are you able to put up a PR? They just need to be exposed in math/arch and then select_implementation! in the relevant functions.
If you aren’t able to, I’ll try to get to this at some point.
I have very limited time for non-day job contributions, I think I'll be able to cobble together something from the godbolt experiments I did while writing this issue but if it gets more complicated I'll have to bail out and leave the rest to you.
Activity
tgross35 commentedon Jan 12, 2025
This would be very welcome, are you able to put up a PR? They just need to be exposed in
math/archand thenselect_implementation!in the relevant functions.If you aren’t able to, I’ll try to get to this at some point.
hanna-kruppe commentedon Jan 12, 2025
I have very limited time for non-day job contributions, I think I'll be able to cobble together something from the godbolt experiments I did while writing this issue but if it gets more complicated I'll have to bail out and leave the rest to you.