diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index ab7fc983c..a8f70f7ad 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -5223,8 +5223,8 @@ void OpDispatchBuilder::InstallHostSpecificOpcodeHandlers() { {OPD(2, 0b01, 0x03), 1, &OpDispatchBuilder::VPHADDSWOp}, {OPD(2, 0b01, 0x04), 1, &OpDispatchBuilder::VPMADDUBSWOp}, - {OPD(2, 0b01, 0x05), 1, &OpDispatchBuilder::Bind<&OpDispatchBuilder::VPHSUBOp, 2>}, - {OPD(2, 0b01, 0x06), 1, &OpDispatchBuilder::Bind<&OpDispatchBuilder::VPHSUBOp, 4>}, + {OPD(2, 0b01, 0x05), 1, &OpDispatchBuilder::Bind<&OpDispatchBuilder::VPHSUBOp, OpSize::i16Bit>}, + {OPD(2, 0b01, 0x06), 1, &OpDispatchBuilder::Bind<&OpDispatchBuilder::VPHSUBOp, OpSize::i32Bit>}, {OPD(2, 0b01, 0x07), 1, &OpDispatchBuilder::VPHSUBSWOp}, {OPD(2, 0b01, 0x08), 1, &OpDispatchBuilder::VPSIGN}, diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.h b/FEXCore/Source/Interface/Core/OpcodeDispatcher.h index fdd134d47..be85c38f0 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.h +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.h @@ -635,7 +635,7 @@ public: void VPHADDSWOp(OpcodeArgs); - void VPHSUBOp(OpcodeArgs, size_t ElementSize); + void VPHSUBOp(OpcodeArgs, IR::OpSize ElementSize); void VPHSUBSWOp(OpcodeArgs); void VPINSRBOp(OpcodeArgs); @@ -832,7 +832,7 @@ public: void MOVBEOp(OpcodeArgs); template void HSUBP(OpcodeArgs); - template + template void PHSUB(OpcodeArgs); void PHADDS(OpcodeArgs); @@ -1391,7 +1391,7 @@ private: Ref PHMINPOSUWOpImpl(OpcodeArgs); - Ref PHSUBOpImpl(OpSize Size, Ref Src1, Ref Src2, size_t ElementSize); + Ref PHSUBOpImpl(OpSize Size, Ref Src1, Ref Src2, IR::OpSize ElementSize); Ref PHSUBSOpImpl(OpSize Size, Ref Src1, Ref Src2); diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher/H0F38Tables.h b/FEXCore/Source/Interface/Core/OpcodeDispatcher/H0F38Tables.h index 056d1acdf..2f4e9ee5b 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher/H0F38Tables.h +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher/H0F38Tables.h @@ -19,10 +19,10 @@ constexpr std::tuple OpDis {OPD(PF_38_66, 0x03), 1, &OpDispatchBuilder::PHADDS}, {OPD(PF_38_NONE, 0x04), 1, &OpDispatchBuilder::PMADDUBSW}, {OPD(PF_38_66, 0x04), 1, &OpDispatchBuilder::PMADDUBSW}, - {OPD(PF_38_NONE, 0x05), 1, &OpDispatchBuilder::PHSUB<2>}, - {OPD(PF_38_66, 0x05), 1, &OpDispatchBuilder::PHSUB<2>}, - {OPD(PF_38_NONE, 0x06), 1, &OpDispatchBuilder::PHSUB<4>}, - {OPD(PF_38_66, 0x06), 1, &OpDispatchBuilder::PHSUB<4>}, + {OPD(PF_38_NONE, 0x05), 1, &OpDispatchBuilder::PHSUB}, + {OPD(PF_38_66, 0x05), 1, &OpDispatchBuilder::PHSUB}, + {OPD(PF_38_NONE, 0x06), 1, &OpDispatchBuilder::PHSUB}, + {OPD(PF_38_66, 0x06), 1, &OpDispatchBuilder::PHSUB}, {OPD(PF_38_NONE, 0x07), 1, &OpDispatchBuilder::PHSUBS}, {OPD(PF_38_66, 0x07), 1, &OpDispatchBuilder::PHSUBS}, {OPD(PF_38_NONE, 0x08), 1, &OpDispatchBuilder::PSIGN}, diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp index 0a873fbfb..b8d3b6de2 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp @@ -3390,13 +3390,13 @@ void OpDispatchBuilder::VHSUBPOp(OpcodeArgs, size_t ElementSize) { StoreResult(FPRClass, Op, Dest, OpSize::iInvalid); } -Ref OpDispatchBuilder::PHSUBOpImpl(OpSize Size, Ref Src1, Ref Src2, size_t ElementSize) { +Ref OpDispatchBuilder::PHSUBOpImpl(OpSize Size, Ref Src1, Ref Src2, IR::OpSize ElementSize) { auto Even = _VUnZip(Size, ElementSize, Src1, Src2); auto Odd = _VUnZip2(Size, ElementSize, Src1, Src2); return _VSub(Size, ElementSize, Even, Odd); } -template +template void OpDispatchBuilder::PHSUB(OpcodeArgs) { Ref Src1 = LoadSource(FPRClass, Op, Op->Dest, Op->Flags); Ref Src2 = LoadSource(FPRClass, Op, Op->Src[0], Op->Flags); @@ -3404,10 +3404,10 @@ void OpDispatchBuilder::PHSUB(OpcodeArgs) { StoreResult(FPRClass, Op, Result, OpSize::iInvalid); } -template void OpDispatchBuilder::PHSUB<2>(OpcodeArgs); -template void OpDispatchBuilder::PHSUB<4>(OpcodeArgs); +template void OpDispatchBuilder::PHSUB(OpcodeArgs); +template void OpDispatchBuilder::PHSUB(OpcodeArgs); -void OpDispatchBuilder::VPHSUBOp(OpcodeArgs, size_t ElementSize) { +void OpDispatchBuilder::VPHSUBOp(OpcodeArgs, IR::OpSize ElementSize) { const auto DstSize = GetDstSize(Op); const auto Is256Bit = DstSize == Core::CPUState::XMM_AVX_REG_SIZE; diff --git a/FEXCore/Source/Interface/IR/IR.json b/FEXCore/Source/Interface/IR/IR.json index 8bbb09976..17dcab721 100644 --- a/FEXCore/Source/Interface/IR/IR.json +++ b/FEXCore/Source/Interface/IR/IR.json @@ -2130,7 +2130,7 @@ "NumElements": "RegisterSize / ElementSize" }, - "FPR = VSub u8:#RegisterSize, u8:#ElementSize, FPR:$Vector1, FPR:$Vector2": { + "FPR = VSub OpSize:#RegisterSize, OpSize:#ElementSize, FPR:$Vector1, FPR:$Vector2": { "DestSize": "RegisterSize", "NumElements": "RegisterSize / ElementSize" },