alexcrichton opened PR #13071 from alexcrichton:load-fewer-bytes-again to bytecodealliance:main:
This commit fixes the x64 backend in Cranelift when sinking loads into band/bor/bxor instructions. If this happens for scalar types like
f32andf64this means that the generated instruction will load too many bytes, similar to #13011 for example. These rules aren't reachable from WebAssembly but are still good to have fixed.<!--
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
-->
alexcrichton requested uweigand for a review on PR #13071.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #13071.
github-actions[bot] added the label cranelift on PR #13071.
github-actions[bot] added the label cranelift:area:x64 on PR #13071.
theotherjimmy submitted PR review:
Seems sensible to me.
alexcrichton unassigned uweigand from PR #13071 x64: Fix sinking loads band/bor/bxor.
alexcrichton requested fitzgen for a review on PR #13071.
fitzgen submitted PR review:
This one might make sense to have
wasttests for that do the operation at the end of memory, so that if our memory access is too wide, we will (incorrectly) trap.
alexcrichton commented on PR #13071:
Agreed! However I haven't added those here because I don't think I can insofar as wasm can't reach these rules (bitops on floats). Given that I'm going to go ahead and merge but if you know of how these are reachable from wasm @fitzgen lemme know
alexcrichton added PR #13071 x64: Fix sinking loads band/bor/bxor to the merge queue.
alexcrichton merged PR #13071.
alexcrichton removed PR #13071 x64: Fix sinking loads band/bor/bxor from the merge queue.
fitzgen commented on PR #13071:
Agreed! However I haven't added those here because I don't think I can insofar as wasm can't reach these rules (bitops on floats). Given that I'm going to go ahead and merge but if you know of how these are reachable from wasm @fitzgen lemme know
I don't I was just thinking out loud
Last updated: May 03 2026 at 22:13 UTC