afonso360 opened PR #7181 from afonso360:riscv-fminmax
to bytecodealliance:main
:
:wave: Hey,
This PR improves our lowerings for
fmin
andfmax
and moves them to ISLE.The native
fmin/fmax
instructions in RISC-V almost match the WASM semantics, they correctly order-0.0 < +0.0
, however they return the non-NaN input if there is one. This does not match the semantics of the instruction so we fixup this case manually.This codegen can be further improved using the
fminm
/fmaxm
instructions available in theZfa
extension which I'm planing on implementing next.
afonso360 requested cfallin for a review on PR #7181.
afonso360 requested wasmtime-compiler-reviewers for a review on PR #7181.
cfallin submitted PR review:
LGTM, thanks! The
fadd
trick to get a NaN is clever.It's too bad the semantics are just a tad off -- especially without a true select/cmove instruction to use in the fixup!
cfallin submitted PR review:
LGTM, thanks! The
fadd
trick to get a NaN is clever.It's too bad the semantics are just a tad off -- especially without a true select/cmove instruction to use in the fixup!
cfallin created PR review comment:
s/NaN of/one of/ ?
afonso360 updated PR #7181.
afonso360 has enabled auto merge for PR #7181.
afonso360 merged PR #7181.
Last updated: Dec 23 2024 at 13:07 UTC