rahulchaphalkar opened PR #10273 from rahulchaphalkar:sse-orpd-manual-rebase to bytecodealliance:main:
This PR adds
xmmregisters for SSE instructions, and 1 SSE instructionorpd. Includes 2 new locationsxmmandrm128and the relevant logic.
rahulchaphalkar requested abrown for a review on PR #10273.
rahulchaphalkar requested wasmtime-compiler-reviewers for a review on PR #10273.
github-actions[bot] commented on PR #10273:
Subscribe to Label Action
cc @cfallin, @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "cranelift:area:x64", "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>
abrown submitted PR review:
This all makes sense to me. I think the main thing here is to fix CI; the minor refactoring I suggest below shouldn't significantly change this, but #10276 may.
abrown created PR review comment:
Don't you want something like
.all(|&op| matches!(op.location.kind(), OperandKind::Imm(_) | OperandKind::FixedReg(_) | OperandKind::XmmReg(_))?
abrown created PR review comment:
xmm | m128 => format!("self.{self}.to_string()"),
abrown created PR review comment:
A thought: if we move all of the XMM bits to their own module,
xmm.rs, then we don't need this variant here and we can separate the GPR and XMM logic from the pretty-printing below. It's a bit confusing that we askreg::enc::to_stringto print register 0 sometimes as%raxand other times as%xmm0. If we separate this out, then we could refactor togpr::enc::to_string(enc: u8, size: OperandSize)andxmm::enc::to_string(enc: u8).
abrown created PR review comment:
Perhaps add a quote to the SSE section below:
Some SSE2/SSE3/SSSE3/SSE4 instructions and instructions using a three-byte sequence of primary opcode bytes may use 66H as a mandatory prefix to express distinct functionality.
abrown created PR review comment:
We can just call this
XmmandXmmMemand I'll try to remember to renameRegtoGpr; or alternatively, we might be able to just fit the XMM versions underOperandKind::RegandOperandKind::RegMem...
abrown created PR review comment:
This generated code looks a lot like the
Reg*versions; that adds some points to keeping the XMM bits under theReg*kinds. we can always use the locations to figure out whether to emit theGpr*orXmm*types.
rahulchaphalkar updated PR #10273.
rahulchaphalkar updated PR #10273.
rahulchaphalkar updated PR #10273.
rahulchaphalkar updated PR #10273.
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Changed to check if 128 bits
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Done
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Folded the xmm bits under reg
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Folded xmm bits under reg. It does add several match statements in different places to check 128 bits.
rahulchaphalkar edited PR review comment.
rahulchaphalkar edited PR review comment.
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Folded xmm bits under reg.
rahulchaphalkar commented on PR #10273:
Thanks for the review, @abrown. I've addressed all comments. I'll now look at resolving conflicts.
rahulchaphalkar updated PR #10273.
rahulchaphalkar updated PR #10273.
rahulchaphalkar updated PR #10273.
rahulchaphalkar updated PR #10273.
rahulchaphalkar commented on PR #10273:
@abrown I've rebased latest main, please take a look.
abrown created PR review comment:
XmmMem::Xmm(xmm) => enc::to_string(xmm.enc()).to_owned(),
abrown created PR review comment:
abrown submitted PR review:
Makes sense to me with a couple small refactorings.
abrown created PR review comment:
We should be able to get rid of this now, right? Perhaps this becomes a
panic!("no need to generate a size for XMM-sized access").
abrown created PR review comment:
Some(size) => reg::enc::to_string(self.enc(), size),
rahulchaphalkar updated PR #10273.
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Done
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Done
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
I need
encfrom xmm module, similar tolet base = reg::enc::to_string(base.enc(), Size::Quadword);needs enc from reg. I could just douse crate::xmm::encbut its easier to distinguish betweenreg::encandxmm::encthis way I think.
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
From above comment, I need to have
use crate::xmm
abrown submitted PR review.
abrown created PR review comment:
Oh, ok, I thought we were already in
xmm.rshere. In that case, why not just use the existingto_stringfunction?XmmMem::Xmm(xmm) => xmm.to_string(),
rahulchaphalkar submitted PR review.
rahulchaphalkar created PR review comment:
Andrew and I had a chat, and we're going to leave this as is for now. There is some work to be done on
to_stringfront inapi.rsinAsReg, wheresizeis an optional argument.
abrown merged PR #10273.
Last updated: Dec 13 2025 at 19:03 UTC