abrown requested wasmtime-compiler-reviewers for a review on PR #10417.
abrown requested fitzgen for a review on PR #10417.
abrown opened PR #10417 from abrown:assembler-fix-10408
to bytecodealliance:main
:
In [#10408], the new assembler re-opened an old issue related to unaligned loads with SSE instructions. SSE instructions expect 128-bit aligned loads when using the
m128
operand and fault if that is not the case. This had been fixed previously by disallowing load-sinking forXmmMem
([#4891]) but more recently we had adopted the use ofXmmMemAligned
incranelift-codegen
. Since [#10316] had no knowledge ofXmmMemAligned
(onlyXmmMem
), it caused the same kind fault--an OOB trap that was in fact an unaligned load.Why didn't CI catch this? Since all the CI machines have AVX and we do not explicitly test the SSE-only case, these unaligned, sunk loads would use the AVX lowering in CI. AVX loads handle unaligned accesses without a fault. This was only discovered during fuzzing when AVX was disabled (i.e.,
--target x86_64-unknown-linux-gnu
).To fix this, this change adopts the
XmmMemAligned
type in the generated assembler code. This is temporary, though: a more lasting fix should pass along an "alignment required" bit from the assembler AST. In the meantime, this closes #10408.[#10408]: https://github.com/bytecodealliance/wasmtime/issues/10408
[#4891]: https://github.com/bytecodealliance/wasmtime/pull/4891
[#10316]: https://github.com/bytecodealliance/wasmtime/pull/10316<!--
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
-->
abrown requested alexcrichton for a review on PR #10417.
fitzgen submitted PR review.
github-actions[bot] commented on PR #10417:
Subscribe to Label Action
cc @cfallin, @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:x64", "cranelift:meta", "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>
alexcrichton merged PR #10417.
Last updated: Apr 18 2025 at 09:03 UTC