diff --git a/common/emitter/instructions.h b/common/emitter/instructions.h index 4b1d4ffcdf..4a9e2e8484 100644 --- a/common/emitter/instructions.h +++ b/common/emitter/instructions.h @@ -499,8 +499,8 @@ namespace x86Emitter extern const xImplSimd_PMove xPMOVSX; extern const xImplSimd_PMove xPMOVZX; - extern const xImplSimd_DestRegSSE xMOVSLDUP; - extern const xImplSimd_DestRegSSE xMOVSHDUP; + extern const xImplSimd_2Arg xMOVSLDUP; + extern const xImplSimd_2Arg xMOVSHDUP; extern void xINSERTPS(const xRegisterSSE& dst, const xRegisterSSE& src1, const xRegisterSSE& src2, u8 imm8); extern void xINSERTPS(const xRegisterSSE& dst, const xRegisterSSE& src1, const xIndirect32& src2, u8 imm8); diff --git a/common/emitter/simd.cpp b/common/emitter/simd.cpp index d1661d41b1..bc5cc90068 100644 --- a/common/emitter/simd.cpp +++ b/common/emitter/simd.cpp @@ -777,10 +777,10 @@ namespace x86Emitter const xImplSimd_PMove xPMOVZX = {SIMDInstructionInfo(0x30).p66().m0f38().mov()}; // [SSE-3] - const xImplSimd_DestRegSSE xMOVSLDUP = {0xf3, 0x12}; + const xImplSimd_2Arg xMOVSLDUP = {SIMDInstructionInfo(0x12).pf3()}; // [SSE-3] - const xImplSimd_DestRegSSE xMOVSHDUP = {0xf3, 0x16}; + const xImplSimd_2Arg xMOVSHDUP = {SIMDInstructionInfo(0x16).pf3()}; ////////////////////////////////////////////////////////////////////////////////////////// // MMX Mov Instructions (MOVD, MOVQ, MOVSS). diff --git a/tests/ctest/common/x86emitter/codegen_tests_main.cpp b/tests/ctest/common/x86emitter/codegen_tests_main.cpp index 44705ac199..93194b5f37 100644 --- a/tests/ctest/common/x86emitter/codegen_tests_main.cpp +++ b/tests/ctest/common/x86emitter/codegen_tests_main.cpp @@ -370,6 +370,11 @@ TEST(CodegenTests, SSETest) CODEGEN_TEST(xPBLEND.W(xmm0, xmm1, 0x55), "66 0f 3a 0e c1 55"); CODEGEN_TEST(xPBLEND.VB(xmm1, xmm2), "66 0f 38 10 ca"); + CODEGEN_TEST(xMOVSLDUP(xmm1, xmm2), "f3 0f 12 ca"); + CODEGEN_TEST(xMOVSLDUP(xmm1, ptr[r8]), "f3 41 0f 12 08"); + CODEGEN_TEST(xMOVSHDUP(xmm9, xmm1), "f3 44 0f 16 c9"); + CODEGEN_TEST(xMOVSHDUP(xmm9, xmm8), "f3 45 0f 16 c8"); + CODEGEN_TEST(xPMOVSX.BW(xmm0, ptr[rax]), "66 0f 38 20 00"); CODEGEN_TEST(xPMOVZX.BW(xmm4, ptr[r8]), "66 41 0f 38 30 20"); CODEGEN_TEST(xPMOVSX.BD(xmm3, xmm4), "66 0f 38 21 dc"); @@ -637,6 +642,11 @@ TEST(CodegenTests, AVXTest) CODEGEN_TEST(xPMOVSX.DQ(xmm2, xmm3), "c4 e2 79 25 d3"); CODEGEN_TEST(xPMOVZX.DQ(xmm4, xmm9), "c4 c2 79 35 e1"); + CODEGEN_TEST(xMOVSLDUP(xmm1, xmm2), "c5 fa 12 ca"); + CODEGEN_TEST(xMOVSLDUP(xmm1, ptr[r8]), "c4 c1 7a 12 08"); + CODEGEN_TEST(xMOVSHDUP(xmm9, xmm1), "c5 7a 16 c9"); + CODEGEN_TEST(xMOVSHDUP(xmm9, xmm8), "c4 41 7a 16 c8"); + CODEGEN_TEST(xVMOVAPS(xmm0, xmm1), "c5 f8 28 c1"); CODEGEN_TEST(xVMOVAPS(xmm0, ptr32[rdi]), "c5 f8 28 07"); CODEGEN_TEST(xVMOVAPS(ptr32[rdi], xmm0), "c5 f8 29 07");