-
Notifications
You must be signed in to change notification settings - Fork 1.5k
x64: convert some SSE shift instructions #10762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fn is_imm8_xmm(&mut self, src: &XmmMemImm) -> Option<u8> { | ||
match src.clone().to_reg_mem_imm() { | ||
RegMemImm::Imm { simm32 } => Some(u8::try_from(simm32).ok()?), | ||
_ => None, | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really want to add this but, because of the type signatures of the inst.isle
constructors, I have to find a way to match on a XmmMemImm
instead of GprMemImm
. One alternative to adding this would be to have is_imm8
examine the more general RegMemImm
instead, but this would mean the constructor types would have to change. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Poking around it looks like these shifting instructions are the only ones using XmmMemImm
, so perhaps we could drop that type entirely? All the various helpers seem to be using mask_xmm_shift
and the current lowerings could dispatch to a helper taking the RegMemImm
result of mask_xmm_shift
which handles the *Imm
case to delegate to different constructors than when in the Reg
or Mem
case?
Subscribe to Label Action
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:
To subscribe or unsubscribe from this label, edit the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with Alex's suggestion -- thanks!
While reflecting on why bytecodealliance#10762 is hard, it seemed that the underlying problem to many ISLE matching issues is our inability to actually inspect the variants of the register specific versions of `RegMem` and `RegMemImm`. We had been wrapping instances of these `Reg*` types, but this change pushes the variants down to: `GprMem`, `GprMemImm`, `XmmMem`, `XmmMemAligned`, `XmmMemImm`, and `XmmMemAlignedImm`. With this, it should be possible to match directly on the variants in ISLE. This does not change any functionality.
that was the wrong button... |
No description provided.