[PATCH] D100411: [WebAssembly] Use standard intrinsics for f32x4 and f64x2 ops
Thomas Lively via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 13 16:32:34 PDT 2021
tlively added a comment.
The Wasm rounding semantics (https://webassembly.github.io/spec/core/exec/numerics.html#op-fnearest) are essentially the same as the semantics for roundeven (https://llvm.org/docs/LangRef.html#llvm-roundeven-intrinsic, added to LLVM in May 2020), so that would be the logical ISD opcode to use. Nearbyint is less appropriate because its behavior is supposed to depend on the current rounding mode. Arguably this is fine because Wasm only has the one rounding mode, but roundeven is more unambiguously correct. However, the ISel for f32.nearest and f64.nearest predates roundeven being available in LLVM and uses nearbyint instead, so I'm just matching that here. If folks think it's a good idea, I will make a follow-up PR that switches to using roundeven for both scalar and SIMD ISel.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100411/new/
https://reviews.llvm.org/D100411
More information about the llvm-commits
mailing list