Stream: git-wasmtime

Topic: wasmtime / PR #13347 riscv64: Refactor comparison-related...


view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 14:58):

alexcrichton opened PR #13347 from alexcrichton:refactor-riscv-traps to bytecodealliance:main:

This fixes a minor issue as well where the previous lowering of trapnz and trapz forgot to extend <64-bit values to the full register width for a comparison against zero.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 14:58):

alexcrichton requested cfallin for a review on PR #13347.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 14:58):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #13347.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 14:58):

alexcrichton requested wasmtime-core-reviewers for a review on PR #13347.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 15:16):

:thumbs_up: cfallin submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 15:16):

:speech_balloon: cfallin created PR review comment:

These new sign-extensions are unfortunate; any way we can avoid them?

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 16:26):

:memo: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 16:26):

:speech_balloon: alexcrichton created PR review comment:

Some of these are miscompiles being fixed from before because trapnz looked like:

(rule
  (lower (trapnz value @ (value_type (fits_in_64 _)) code))
    (gen_trapnz value code))

(decl gen_trapnz (XReg TrapCode) InstOutput)
(rule (gen_trapnz test trap_code)
  (gen_trapif (IntCC.NotEqual) test (zero_reg) trap_code))

which failed to sign-extend the value to the full register width for <64-bit values.

Otherwise though it's a similar situation to the x64 backend where there's a predicate for "is this Value already sign-extended" and it's filled in for some patterns. It's missing a pattern which will help a little, but I think in general, no, I don't think conditions like this one highlighted here can be removed

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 16:26):

alexcrichton added PR #13347 riscv64: Refactor comparison-related rules to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 16:52):

:check: alexcrichton merged PR #13347.

view this post on Zulip Wasmtime GitHub notifications bot (May 13 2026 at 16:52):

alexcrichton removed PR #13347 riscv64: Refactor comparison-related rules from the merge queue.


Last updated: Jun 01 2026 at 09:49 UTC