diff --git a/cranelift/codegen/src/isa/x64/inst/args.rs b/cranelift/codegen/src/isa/x64/inst/args.rs index 0050a0a412..bf209919bf 100644 --- a/cranelift/codegen/src/isa/x64/inst/args.rs +++ b/cranelift/codegen/src/isa/x64/inst/args.rs @@ -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", diff --git a/cranelift/codegen/src/isa/x64/inst/emit.rs b/cranelift/codegen/src/isa/x64/inst/emit.rs index c7b5c7f83c..24ff06488a 100644 --- a/cranelift/codegen/src/isa/x64/inst/emit.rs +++ b/cranelift/codegen/src/isa/x64/inst/emit.rs @@ -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), diff --git a/cranelift/codegen/src/isa/x64/inst/emit_tests.rs b/cranelift/codegen/src/isa/x64/inst/emit_tests.rs index 06092d498a..6c2fe6f2d4 100644 --- a/cranelift/codegen/src/isa/x64/inst/emit_tests.rs +++ b/cranelift/codegen/src/isa/x64/inst/emit_tests.rs @@ -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((