[machinst x64]: add punpack[hl]bw instructions

This commit is contained in:
Andrew Brown
2020-11-11 10:05:14 -08:00
parent 8131b15921
commit 8ba92853be
3 changed files with 20 additions and 0 deletions

View File

@@ -482,6 +482,8 @@ pub enum SseOpcode {
Psubusb,
Psubusw,
Ptest,
Punpckhbw,
Punpcklbw,
Pxor,
Rcpss,
Roundss,
@@ -616,6 +618,8 @@ impl SseOpcode {
| SseOpcode::Psubsw
| SseOpcode::Psubusb
| SseOpcode::Psubusw
| SseOpcode::Punpckhbw
| SseOpcode::Punpcklbw
| SseOpcode::Pxor
| SseOpcode::Sqrtpd
| SseOpcode::Sqrtsd
@@ -783,6 +787,8 @@ impl fmt::Debug for SseOpcode {
SseOpcode::Psubusb => "psubusb",
SseOpcode::Psubusw => "psubusw",
SseOpcode::Ptest => "ptest",
SseOpcode::Punpckhbw => "punpckhbw",
SseOpcode::Punpcklbw => "punpcklbw",
SseOpcode::Pxor => "pxor",
SseOpcode::Rcpss => "rcpss",
SseOpcode::Roundss => "roundss",

View File

@@ -1826,6 +1826,8 @@ pub(crate) fn emit(
SseOpcode::Psubsw => (LegacyPrefixes::_66, 0x0FE9, 2),
SseOpcode::Psubusb => (LegacyPrefixes::_66, 0x0FD8, 2),
SseOpcode::Psubusw => (LegacyPrefixes::_66, 0x0FD9, 2),
SseOpcode::Punpckhbw => (LegacyPrefixes::_66, 0x0F68, 2),
SseOpcode::Punpcklbw => (LegacyPrefixes::_66, 0x0F60, 2),
SseOpcode::Pxor => (LegacyPrefixes::_66, 0x0FEF, 2),
SseOpcode::Subps => (LegacyPrefixes::None, 0x0F5C, 2),
SseOpcode::Subpd => (LegacyPrefixes::_66, 0x0F5C, 2),

View File

@@ -3157,6 +3157,18 @@ fn test_x64_emit() {
"packsswb %xmm11, %xmm2",
));
insns.push((
Inst::xmm_rm_r(SseOpcode::Punpckhbw, RegMem::reg(xmm3), w_xmm2),
"660F68D3",
"punpckhbw %xmm3, %xmm2",
));
insns.push((
Inst::xmm_rm_r(SseOpcode::Punpcklbw, RegMem::reg(xmm1), w_xmm8),
"66440F60C1",
"punpcklbw %xmm1, %xmm8",
));
// ========================================================
// XMM_RM_R: Integer Conversion
insns.push((