From cebb032bd3fc6318c25018eb82225abfff0ebc73 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 19 Jun 2024 02:53:16 -0700 Subject: [PATCH] AVX128: Implement support for vphminposuw Reuses the non-AVX implementation since it only operates on 128-bits. --- FEXCore/Source/Interface/Core/OpcodeDispatcher.h | 2 ++ FEXCore/Source/Interface/Core/OpcodeDispatcher/AVX_128.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.h b/FEXCore/Source/Interface/Core/OpcodeDispatcher.h index 0c5f61df9..f239d3d32 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.h +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.h @@ -1135,6 +1135,8 @@ public: void AVX128_VPCMPISTRI(OpcodeArgs); void AVX128_VPCMPISTRM(OpcodeArgs); + void AVX128_PHMINPOSUW(OpcodeArgs); + // End of AVX 128-bit implementation void InvalidOp(OpcodeArgs); diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher/AVX_128.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher/AVX_128.cpp index e87cb3c8e..9a61f04c8 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher/AVX_128.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher/AVX_128.cpp @@ -312,7 +312,7 @@ void OpDispatchBuilder::InstallAVX128Handlers() { {OPD(2, 0b01, 0x3F), 1, &OpDispatchBuilder::AVX128_VectorALU}, {OPD(2, 0b01, 0x40), 1, &OpDispatchBuilder::AVX128_VectorALU}, - // TODO: {OPD(2, 0b01, 0x41), 1, &OpDispatchBuilder::PHMINPOSUWOp}, + {OPD(2, 0b01, 0x41), 1, &OpDispatchBuilder::AVX128_PHMINPOSUW}, {OPD(2, 0b01, 0x45), 1, &OpDispatchBuilder::AVX128_VPSRLV}, {OPD(2, 0b01, 0x46), 1, &OpDispatchBuilder::AVX128_VPSRAVD}, {OPD(2, 0b01, 0x47), 1, &OpDispatchBuilder::AVX128_VPSLLV}, @@ -1682,4 +1682,9 @@ void OpDispatchBuilder::AVX128_VPCMPISTRM(OpcodeArgs) { AVX128_StoreXMMRegister(0, LoadZeroVector(OpSize::i128Bit), true); } +void OpDispatchBuilder::AVX128_PHMINPOSUW(OpcodeArgs) { + Ref Result = PHMINPOSUWOpImpl(Op); + AVX128_StoreResult_WithOpSize(Op, Op->Dest, AVX128_Zext(Result)); +} + } // namespace FEXCore::IR