abrown opened PR #10898 from abrown:asm-movlhps to bytecodealliance:main:
This change continues the push to convert all
mov-related instruction and convertsmovlhpsto use the new assembler (at least the SSE variant). In doing so, it discovers that we were incorrectly allowing anXmmMemas one of the operands; this is fixed to beXmmonly.<!--
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 updated PR #10898.
abrown submitted PR review.
abrown created PR review comment:
Note how we're gaining an extra
vmovsdhere because we were probably doing some internalemit-time matching to emitvmovhps.
abrown submitted PR review.
abrown created PR review comment:
The old version seems wrong... this _should_ be a
movsdI believe.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
It looks like
movhpshas the exact same encoding asmovlhps, which might be how this worked beforehand? Nevertheless from an assembler point of view I'd much rather match the Intel manual for sure.Perhaps though
XmmMemcould stay as an argument on some handwritten ISLE-helper and that delegates tomovlhpsandmovhpsas appropriate?
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Yeah definitely wrong,
XmmMemauto-converted toXmmalways loads 128-bits, and this is just an incorrect translation and means that on-the-boundary-of-linear-memory loads of f32/f64 will be incorrectly identified as out-of-bounds.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
For this, mind adding this test to this PR?
abrown submitted PR review.
abrown created PR review comment:
Yeah, the more I stare at the manual, it could be that they are truly the same instruction and we _should_ make that second operand an
xmm_m64. I suspect that the names were different for some historical reason and we'll just have to paper over the mnemonic difference with #10918 once that is done.
abrown updated PR #10898.
abrown updated PR #10898.
abrown submitted PR review.
abrown created PR review comment:
Ok, I ended up creating a separate instruction with the same encoding (avoids any customizations) and everything is fine. The only real user of
vmovhpsis Winch, though. I looked through the five uses ofx64_movlhpsinlower.isleand, unless I'm missing some auto-conversion somewhere, it appears to me that we are fine using themovlhpsreg-to-reg form and don't really needmovhpsin Cranelift.
abrown submitted PR review.
abrown created PR review comment:
Added. It doesn't fail, though?
abrown has marked PR #10898 as ready for review.
abrown requested alexcrichton for a review on PR #10898.
abrown requested wasmtime-compiler-reviewers for a review on PR #10898.
abrown requested wasmtime-core-reviewers for a review on PR #10898.
abrown submitted PR review.
abrown created PR review comment:
(Maybe it would have failed with the old version?)
alexcrichton submitted PR review.
alexcrichton commented on PR #10898:
github-actions[bot] commented on PR #10898:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:x64", "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>
abrown updated PR #10898.
abrown has enabled auto merge for PR #10898.
abrown updated PR #10898.
abrown merged PR #10898.
Last updated: Dec 06 2025 at 06:05 UTC