-
Notifications
You must be signed in to change notification settings - Fork 1.5k
x64: Migrate some blend-related instructions #10975
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
This commit migrates the `pblendvb`, `blendvps`, `blendvpd`, and AVX versions of each to the new assembler. This required a few minor features in the assembler: * The fixed physical `xmm0` register is now a `Location` * The "/is4" encoding format for VEX instructions is supported * The `Fixed` type now supports both xmm and gpr registers (minor update to its `to_string` method). In the end this enables deleting `XmmRmRBlend` and `XmmRmRBlendVex`. (yay!)
; pblendvb %xmm1, %xmm7, %xmm1 | ||
; pblendvb %xmm0, %xmm7, %xmm1 |
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'll note that there's no actual register allocation changes here, this is just an artifact of how the instruction used to be printed. The xmm0 argument was omitted by default and the src/destination, which are required to be the same register, were printed twice.
@@ -36,5 +36,12 @@ pub fn list() -> Vec<Inst> { | |||
|
|||
inst("movddup", fmt("A", [w(xmm1), r(xmm_m64)]), rex([0xF2, 0x0F, 0x12]).r(), _64b | compat | sse3), | |||
inst("vmovddup", fmt("A", [w(xmm1), r(xmm_m64)]), vex(L128)._f2()._0f().op(0x12).r(), _64b | compat | avx), | |||
|
|||
inst("pblendvb", fmt("RM", [rw(xmm1), r(align(xmm_m128)), r(xmm0)]), rex([0x66, 0x0F, 0x38, 0x10]).r(), _64b | compat | sse41), |
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.
inst("pblendvb", fmt("RM", [rw(xmm1), r(align(xmm_m128)), r(xmm0)]), rex([0x66, 0x0F, 0x38, 0x10]).r(), _64b | compat | sse41), | |
inst("pblendvb", fmt("RM", [rw(xmm1), r(align(xmm_m128)), r(implicit(xmm0))]), rex([0x66, 0x0F, 0x38, 0x10]).r(), _64b | compat | sse41), |
Don't we want this to be implicit?
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 originally thought so yeah but apparently Capstone disassembles this with %xmm0
show it shows up in the instruction listing. It looks like even Intel-style disassembly shows xmm0
as well, so for whatever reason while it's implicit on instructions like div
it's not implicit here...
This commit migrates the
pblendvb
,blendvps
,blendvpd
, and AVX versions of each to the new assembler. This required a few minor features in the assembler:xmm0
register is now aLocation
Fixed
type now supports both xmm and gpr registers (minor update to itsto_string
method).In the end this enables deleting
XmmRmRBlend
andXmmRmRBlendVex
. (yay!)