WebAssembly / WebAssembly/binaryen
Add sign bit tacking for floating points
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
Similar to known maximum bits getMaxBits for integers we could track sign for floats. It's quite useful and deterministic (except NaN ofc). This will allow you to do more optimizations for floating points. For example x + 0 -> x if we know x never has sign bits so -0 is not possible. LLVM already do this:
https://github.com/llvm/llvm-project/commit/727a891ec8c42b134dfd9ac8b830fb6072d34ef3
Also f64.sqrt(x) -> sNaN if we know hasSignBit(x) == 1 and etc
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 locating the existing getMaxBits integer analysis and compare its scope with the LLVM commit linked in the issue. Trace how floating-point facts reach optimizations such as x + 0 and f64.sqrt, then define completion by deterministic sign-bit tracking for floats while preserving the stated NaN caveat and enabling the described optimizations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, wasm
- Domain
- compilers, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100