Stream: git-wasmtime

Topic: wasmtime / PR #12321 x64: Fix lowering rules for `shld`


view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 16:20):

alexcrichton opened PR #12321 from alexcrichton:fix-shift-bug to bytecodealliance:main:

These failed to account for the edge case of 0/width(type) shifts where the shld instruction is no longer applicable. Guards are added to ensure that the shift amounts are both greater than zero.

This in theory shouldn't have much practical impact since shift-by-zero and shift-by-type-width are both optimized away in the mid-end. That means that this is only possible to expose with opt-level=0 which may help explain why this went undiscovered for ~1 year.

Closes #12318

<!--
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 (Jan 12 2026 at 16:20):

alexcrichton requested fitzgen for a review on PR #12321.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 16:20):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 16:20):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 16:57):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 18:18):

alexcrichton updated PR #12321.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 18:19):

alexcrichton commented on PR #12321:

@cfallin mind double-checking the Winch-specific commit I added? Looks like Winch's encoding of shift-by-32 was using the immediate form of the instruction but that's not compatible with AArch64's encoding so it ended up encoding an illegal instruction.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 18:30):

cfallin submitted PR review:

Latest commit to Winch looks fine too!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 12 2026 at 19:01):

alexcrichton merged PR #12321.


Last updated: Jan 29 2026 at 13:25 UTC