WebAssembly / WebAssembly/binaryen
different behavior when opt `fsqrt` with negative number in arm64 and x64
Open
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
Literal will use std::sqrt to calculate f32.sqrt and f64.sqrt. It cause output wasm different when we build in arm64 and x64.
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 at the Literal handling described in the issue and trace how std::sqrt computes f32.sqrt and f64.sqrt when the fsqrt optimization is enabled. Reproduce the negative-number case on arm64 and x64, compare the generated WebAssembly, and identify the expected consistent behavior before adding a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, wasm
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100