x64: Add support for the pblendw instruction (#6023)
This commit adds another case for `shuffle` lowering to the x64 backend
for the `{,v}pblendw` instruction. This instruction selects 16-bit
values from either of the inputs corresponding to an immediate 8-bit-mask where
each bit selects the corresponding lane from the inputs.
This commit is contained in:
@@ -918,6 +918,7 @@
|
||||
Punpcklqdq
|
||||
Pshuflw
|
||||
Pshufhw
|
||||
Pblendw
|
||||
))
|
||||
|
||||
(type CmpOpcode extern
|
||||
@@ -1290,6 +1291,7 @@
|
||||
Vpextrw
|
||||
Vpextrd
|
||||
Vpextrq
|
||||
Vpblendw
|
||||
))
|
||||
|
||||
(type Avx512Opcode extern
|
||||
@@ -2967,6 +2969,14 @@
|
||||
(if-let $true (has_avx))
|
||||
(xmm_rmr_blend_vex (AvxOpcode.Vpblendvb) src1 src2 mask))
|
||||
|
||||
;; Helper for creating `pblendw` instructions.
|
||||
(decl x64_pblendw (Xmm XmmMem u8) Xmm)
|
||||
(rule 0 (x64_pblendw src1 src2 imm)
|
||||
(xmm_rm_r_imm (SseOpcode.Pblendw) src1 src2 imm (OperandSize.Size32)))
|
||||
(rule 1 (x64_pblendw src1 src2 imm)
|
||||
(if-let $true (has_avx))
|
||||
(xmm_rmr_imm_vex (AvxOpcode.Vpblendw) src1 src2 imm))
|
||||
|
||||
;; Helper for creating a `movsd` instruction which creates a new vector
|
||||
;; register where the upper 64-bits are from the first operand and the low
|
||||
;; 64-bits are from the second operand.
|
||||
|
||||
Reference in New Issue
Block a user