Skip to content

Conversation

@alexcrichton
Copy link
Member

Backport of #12321

* x64: Fix lowering rules for `shld`

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 bytecodealliance#12318

* Fix Winch's encoding of shift-by-32
@alexcrichton alexcrichton requested review from a team as code owners January 12, 2026 19:10
@alexcrichton alexcrichton requested review from cfallin and dicej and removed request for a team January 12, 2026 19:10
@alexcrichton alexcrichton enabled auto-merge (squash) January 12, 2026 19:11
@alexcrichton alexcrichton merged commit 7e98de5 into bytecodealliance:release-41.0.0 Jan 12, 2026
174 checks passed
@alexcrichton alexcrichton deleted the backport41 branch January 12, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants