saulecabrera opened PR #12501 from saulecabrera:winch-aarch64-fix-shift to bytecodealliance:main:
Fixes https://github.com/bytecodealliance/wasmtime/issues/12423
Prior to this commit, calculating the ALUOp for the rotate left operation included a negation side-effect on the rotate operands. In the case of shift with immediate, the implementation was wrongly performing the negation on the
rnregister rather than using the immediate value, which resulted in the mis-compilation described in the issue below.This commit ensures that the conversion from the shift kind to the ALUOp is side-effect free.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
saulecabrera requested fitzgen for a review on PR #12501.
saulecabrera requested wasmtime-core-reviewers for a review on PR #12501.
saulecabrera requested wasmtime-compiler-reviewers for a review on PR #12501.
saulecabrera edited PR #12501:
Fixes https://github.com/bytecodealliance/wasmtime/issues/12423
Prior to this commit, calculating the ALUOp for the rotate left operation included a negation side-effect on the rotate operands. In the case of shift with immediate, the implementation was wrongly performing the negation on the
rnregister rather than using the immediate value, which resulted in the miscompilation described in the issue below.This commit ensures that the conversion from the shift kind to the ALUOp is side-effect free.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
github-actions[bot] added the label winch on PR #12501.
github-actions[bot] commented on PR #12501:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "winch"Thus the following users have been cc'd because of the following labels:
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
fitzgen submitted PR review:
Thanks!
fitzgen added PR #12501 winch(aarch64): Remove side effect from shift kind to ALUOp calculation to the merge queue.
fitzgen merged PR #12501.
fitzgen removed PR #12501 winch(aarch64): Remove side effect from shift kind to ALUOp calculation from the merge queue.
Last updated: Feb 24 2026 at 04:36 UTC