rust-lang / rust-lang/portable-simd
Fast round
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.1k
- Forks
- 108
- Avg merge
- 22h 53m
- Merged PRs (30d)
- 3
Description
.round() function is very slow compared to platform-native intrinsic on AVX (https://godbolt.org/z/3sdd9jrvW) because it provides a platform-agnostic behavior. Although there are many use cases when the exact behavior on half-way values or INFs and NaNs doesn't matter.
I think adding somewhat like round_fast function is reasonable.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing .round() implementation and comparing its generated AVX code with the linked Godbolt example. Define the platform-native fast-round behavior, including how it handles halfway values, infinities, and NaNs, then add round_fast with coverage showing that the requested faster path is available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100