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:
Alex Crichton
2023-03-15 12:20:43 -05:00
committed by GitHub
parent fcddb9ca81
commit 6ed90f86c8
8 changed files with 132 additions and 14 deletions

View File

@@ -1125,6 +1125,7 @@ pub enum SseOpcode {
Punpcklqdq,
Pshuflw,
Pshufhw,
Pblendw,
}
impl SseOpcode {
@@ -1318,7 +1319,8 @@ impl SseOpcode {
| SseOpcode::Roundps
| SseOpcode::Roundpd
| SseOpcode::Roundss
| SseOpcode::Roundsd => SSE41,
| SseOpcode::Roundsd
| SseOpcode::Pblendw => SSE41,
SseOpcode::Pcmpgtq => SSE42,
}
@@ -1521,6 +1523,7 @@ impl fmt::Debug for SseOpcode {
SseOpcode::Punpckhqdq => "punpckhqdq",
SseOpcode::Pshuflw => "pshuflw",
SseOpcode::Pshufhw => "pshufhw",
SseOpcode::Pblendw => "pblendw",
};
write!(fmt, "{}", name)
}
@@ -1705,7 +1708,8 @@ impl AvxOpcode {
| AvxOpcode::Vpextrb
| AvxOpcode::Vpextrw
| AvxOpcode::Vpextrd
| AvxOpcode::Vpextrq => {
| AvxOpcode::Vpextrq
| AvxOpcode::Vpblendw => {
smallvec![InstructionSet::AVX]
}
}