Stream: git-wasmtime

Topic: wasmtime / PR #7181 riscv64: Improve `f{min,max}` codegen


view this post on Zulip Wasmtime GitHub notifications bot (Oct 06 2023 at 23:08):

afonso360 opened PR #7181 from afonso360:riscv-fminmax to bytecodealliance:main:

:wave: Hey,

This PR improves our lowerings for fmin and fmax 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 the Zfa extension which I'm planing on implementing next.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 06 2023 at 23:08):

afonso360 requested cfallin for a review on PR #7181.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 06 2023 at 23:08):

afonso360 requested wasmtime-compiler-reviewers for a review on PR #7181.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 06 2023 at 23:27):

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!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 06 2023 at 23:27):

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!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 06 2023 at 23:27):

cfallin created PR review comment:

s/NaN of/one of/ ?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 06 2023 at 23:59):

afonso360 updated PR #7181.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2023 at 00:12):

afonso360 has enabled auto merge for PR #7181.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 07 2023 at 01:28):

afonso360 merged PR #7181.


Last updated: Nov 22 2024 at 17:03 UTC