diff --git a/common/emitter/implement/simd_moremovs.h b/common/emitter/implement/simd_moremovs.h index 0b498b3454..e8e1de2fef 100644 --- a/common/emitter/implement/simd_moremovs.h +++ b/common/emitter/implement/simd_moremovs.h @@ -119,6 +119,12 @@ namespace x86Emitter xImplSimd_DestRegSSE VPD; }; + struct xImplSimd_PBlend + { + xImplSimd_DestRegImmSSE W; + xImplSimd_DestRegSSE VB; + }; + // -------------------------------------------------------------------------------------- // xImplSimd_PMove // -------------------------------------------------------------------------------------- diff --git a/common/emitter/instructions.h b/common/emitter/instructions.h index 70a1e3953a..2e68794f59 100644 --- a/common/emitter/instructions.h +++ b/common/emitter/instructions.h @@ -500,6 +500,7 @@ namespace x86Emitter extern const xImplSimd_MovHL_RtoR xMOVLH; extern const xImplSimd_MovHL_RtoR xMOVHL; + extern const xImplSimd_PBlend xPBLEND; extern const xImplSimd_Blend xBLEND; extern const xImplSimd_PMove xPMOVSX; extern const xImplSimd_PMove xPMOVZX; diff --git a/common/emitter/simd.cpp b/common/emitter/simd.cpp index 03f536bdd4..c26b625234 100644 --- a/common/emitter/simd.cpp +++ b/common/emitter/simd.cpp @@ -556,12 +556,18 @@ namespace x86Emitter const xImplSimd_MovHL_RtoR xMOVLH = {0x16}; const xImplSimd_MovHL_RtoR xMOVHL = {0x12}; + const xImplSimd_PBlend xPBLEND = + { + {0x66, 0x0e3a}, // W + {0x66, 0x1038}, // VB + }; + const xImplSimd_Blend xBLEND = - { - {0x66, 0x0c3a}, // PS - {0x66, 0x0d3a}, // PD - {0x66, 0x1438}, // VPS - {0x66, 0x1538}, // VPD + { + {0x66, 0x0c3a}, // PS + {0x66, 0x0d3a}, // PD + {0x66, 0x1438}, // VPS + {0x66, 0x1538}, // VPD }; const xImplSimd_PMove xPMOVSX = {0x2038}; diff --git a/tests/ctest/common/x86emitter/codegen_tests_main.cpp b/tests/ctest/common/x86emitter/codegen_tests_main.cpp index 71c57c5a2d..9457737358 100644 --- a/tests/ctest/common/x86emitter/codegen_tests_main.cpp +++ b/tests/ctest/common/x86emitter/codegen_tests_main.cpp @@ -153,6 +153,8 @@ TEST(CodegenTests, SSETest) CODEGEN_TEST(xMOVAPS(ptr128[rax+r9], xmm8), "46 0f 29 04 08"); CODEGEN_TEST(xBLEND.PS(xmm0, xmm1, 0x55), "66 0f 3a 0c c1 55"); CODEGEN_TEST(xBLEND.PD(xmm8, xmm9, 0xaa), "66 45 0f 3a 0d c1 aa"); + 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(xEXTRACTPS(ptr32[base], xmm1, 2), "66 0f 3a 17 0d f6 ff ff ff 02"); CODEGEN_TEST(xMOVD(eax, xmm1), "66 0f 7e c8"); CODEGEN_TEST(xMOVD(eax, xmm10), "66 44 0f 7e d0");