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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits