bongjunj opened PR #11637 from bongjunj:fold-shifts-over-and to bytecodealliance:main:
<!--
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
-->This adds
(rule (simplify (ushr ty (band ty (ishl ty x y) z) y)) (band ty x (ushr ty z y))).
bongjunj requested abrown for a review on PR #11637.
bongjunj requested wasmtime-compiler-reviewers for a review on PR #11637.
github-actions[bot] commented on PR #11637:
Subscribe to Label Action
cc @cfallin, @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "isle"Thus the following users have been cc'd because of the following labels:
- cfallin: isle
- fitzgen: isle
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!
We can do the equivalent with
sshras well, right? Would you be willing to do a follow up PR adding that rule?
bongjunj commented on PR #11637:
Thank you for the comment. I will add the rule in this PR.
bongjunj commented on PR #11637:
@fitzgen
The verifier rejects the
sshrcase.Verification failed for <unnamed rule>, width 8 (simplify (sshr [ty|8] (band [ty|8] (ishl [ty|8] [x|#x01] [y|#x07]) [z|#x80]) [y|#x07])) => (band [ty|8] [x|#x01] (sshr [ty|8] [z|#x80] [y|#x07])) #xff => #x01I've tried the other cases of
ushr, sshrandsshr, ushr.
But this rule is correct only whenbandfolds twoushrs.
bongjunj updated PR #11637.
bongjunj updated PR #11637.
fitzgen commented on PR #11637:
Thanks for checking!
fitzgen merged PR #11637.
Last updated: Dec 06 2025 at 06:05 UTC