diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.h b/FEXCore/Source/Interface/Core/OpcodeDispatcher.h index 5867a8379..735c9de59 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.h +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.h @@ -872,7 +872,10 @@ public: void VectorVariableBlend(OpcodeArgs, IR::OpSize ElementSize); void PTestOpImpl(OpSize Size, Ref Dest, Ref Src); void PTestOp(OpcodeArgs); + + void AVXPHMINPOSUWOp(OpcodeArgs); void PHMINPOSUWOp(OpcodeArgs); + void DPPOp(OpcodeArgs, IR::OpSize ElementSize); void MPSADBWOp(OpcodeArgs); diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp index ee84ad248..3661bf939 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp @@ -4419,6 +4419,11 @@ Ref OpDispatchBuilder::PHMINPOSUWOpImpl(OpcodeArgs) { } void OpDispatchBuilder::PHMINPOSUWOp(OpcodeArgs) { + Ref Result = PHMINPOSUWOpImpl(Op); + StoreResult_WithAVXInsert(VectorOpType::SSE, RegClass::FPR, Op, Result); +} + +void OpDispatchBuilder::AVXPHMINPOSUWOp(OpcodeArgs) { Ref Result = PHMINPOSUWOpImpl(Op); StoreResultFPR(Op, Result); } diff --git a/FEXCore/Source/Interface/Core/X86Tables/VEXTables.cpp b/FEXCore/Source/Interface/Core/X86Tables/VEXTables.cpp index c82a5d6b8..366fc68c7 100644 --- a/FEXCore/Source/Interface/Core/X86Tables/VEXTables.cpp +++ b/FEXCore/Source/Interface/Core/X86Tables/VEXTables.cpp @@ -752,7 +752,7 @@ namespace AVX256 { {OPD(2, 0b01, 0x3F), 1, &OpDispatchBuilder::Bind<&OpDispatchBuilder::AVXVectorALUOp, IR::OP_VUMAX, OpSize::i32Bit>}, {OPD(2, 0b01, 0x40), 1, &OpDispatchBuilder::Bind<&OpDispatchBuilder::AVXVectorALUOp, IR::OP_VMUL, OpSize::i32Bit>}, - {OPD(2, 0b01, 0x41), 1, &OpDispatchBuilder::PHMINPOSUWOp}, + {OPD(2, 0b01, 0x41), 1, &OpDispatchBuilder::AVXPHMINPOSUWOp}, {OPD(2, 0b01, 0x45), 1, &OpDispatchBuilder::VPSRLVOp}, {OPD(2, 0b01, 0x46), 1, &OpDispatchBuilder::VPSRAVDOp}, {OPD(2, 0b01, 0x47), 1, &OpDispatchBuilder::VPSLLVOp}, diff --git a/unittests/ASM/SSELanePreservation/phminposuw.asm b/unittests/ASM/SSELanePreservation/phminposuw.asm new file mode 100644 index 000000000..c148bdafa --- /dev/null +++ b/unittests/ASM/SSELanePreservation/phminposuw.asm @@ -0,0 +1,25 @@ +%ifdef CONFIG +{ + "HostFeatures": ["AVX"], + "RegData": { + "XMM0": ["0x0000000000051278", "0x0000000000000000", "0xccdbcfc31f3ff0f3", "0x108390defebac4be"], + "XMM1": ["0x0000000000041278", "0x0000000000000000", "0", "0"], + "XMM2": ["0xc4be43cc1ad6970b", "0x4549bd7eb46a1278", "0xf793ef673dac6e4c", "0xbb7b5b3d85d34271"] + } +} +%endif + +vmovaps ymm0, [rel .data] +vmovaps ymm1, [rel .data + (1 * 32)] +vmovaps ymm2, [rel .data + (2 * 32)] + +phminposuw xmm0, xmm1 +vphminposuw xmm1, xmm2 + +hlt + +align 32 +.data: +dq 0xfdecd28fab3fa4a5, 0x7d7ccd8836d09fc2, 0xccdbcfc31f3ff0f3, 0x108390defebac4be +dq 0x43cc1ad6970b4549, 0xbd7eb46a1278f793, 0xef673dac6e4cbb7b, 0x5b3d85d342718be9 +dq 0xc4be43cc1ad6970b, 0x4549bd7eb46a1278, 0xf793ef673dac6e4c, 0xbb7b5b3d85d34271