-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
x64: Add shuffle
specialization for palignr
#5999
Conversation
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 |
(xmm_rm_r_imm (SseOpcode.Palignr) | ||
src1 | ||
src2 | ||
imm | ||
size)) | ||
(rule 1 (x64_palignr src1 src2 imm size) | ||
(OperandSize.Size32))) |
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.
Why this change? Why always 32?
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 guess it was always passed 32, but I'm still a little confused why it was like that.
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.
@abrown do you perhaps remember why palignr
was always generated with OperandSize.Size32
? I'll admit I don't fully understand how OperandSize
maps to instructions all the time but I naively figured that it could be "constant folded" into the palignr
constructor, but a double-check would be good.
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.
Ah I remember now actually, this has to do with the rex flags when encoding where a 64-bit size forces the W bit to be set and otherwise W is unset. I believe the encoding of the palignr
instruction forces this to "unset" so for palignr
it should always be a non-64-bit size.
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.
Yeah, I think that sounds right. The OperandSize
isn't my invention and I recall having to work around it--I think things would be more clear if we hid OperandSize
completely or alternately surfaced it as REX.W
, which is more direct.
This commit adds specializations for the `palignr` instruction to the x64 backend to specialize some more patterns of byte shuffles.
This commit adds specializations for the
palignr
instruction to the x64 backend to specialize some more patterns of byte shuffles.