diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index 411f6ab2e..ec87fc55c 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -4793,6 +4793,10 @@ void OpDispatchBuilder::UMWaitOp(OpcodeArgs) { } void OpDispatchBuilder::CLZeroOp(OpcodeArgs) { + if (!CTX->HostFeatures.SupportsCLZERO) { + UnimplementedOp(Op); + return; + } Ref DestMem = LoadSource(GPRClass, Op, Op->Src[0], Op->Flags, {.LoadData = false}); _CacheLineZero(DestMem); } @@ -4943,10 +4947,6 @@ void OpDispatchBuilder::InstallHostSpecificOpcodeHandlers() { }; #undef OPD - constexpr static DispatchTableEntry SecondaryModRMExtensionOp_CLZero[] = { - {((3 << 3) | 4), 1, &OpDispatchBuilder::CLZeroOp}, - }; - #define OPD(map_select, pp, opcode) (((map_select - 1) << 10) | (pp << 8) | (opcode)) static constexpr DispatchTableEntry AVXTable[] = { {OPD(1, 0b00, 0x10), 1, &OpDispatchBuilder::VMOVUPS_VMOVUPDOp}, @@ -5369,10 +5369,6 @@ void OpDispatchBuilder::InstallHostSpecificOpcodeHandlers() { }; #undef OPD - if (CTX->HostFeatures.SupportsCLZERO) { - InstallToTable(FEXCore::X86Tables::SecondModRMTableOps, SecondaryModRMExtensionOp_CLZero); - } - if (CTX->HostFeatures.SupportsAVX && CTX->HostFeatures.SupportsSVE256) { InstallToTable(FEXCore::X86Tables::VEXTableOps, AVXTable); InstallToTable(FEXCore::X86Tables::VEXTableGroupOps, VEXTableGroupOps); diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher/SecondaryModRMTables.h b/FEXCore/Source/Interface/Core/OpcodeDispatcher/SecondaryModRMTables.h index cacc438b7..738684769 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher/SecondaryModRMTables.h +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher/SecondaryModRMTables.h @@ -17,6 +17,7 @@ constexpr DispatchTableEntry OpDispatch_SecondaryModRMTables[] = { // REG /7 {((3 << 3) | 0), 1, &OpDispatchBuilder::PermissionRestrictedOp}, {((3 << 3) | 1), 1, &OpDispatchBuilder::RDTSCPOp}, + {((3 << 3) | 4), 1, &OpDispatchBuilder::CLZeroOp}, }; } // namespace FEXCore::IR diff --git a/FEXCore/Source/Interface/Core/X86Tables/SecondaryModRMTables.cpp b/FEXCore/Source/Interface/Core/X86Tables/SecondaryModRMTables.cpp index a161ac2a5..b8d5a8930 100644 --- a/FEXCore/Source/Interface/Core/X86Tables/SecondaryModRMTables.cpp +++ b/FEXCore/Source/Interface/Core/X86Tables/SecondaryModRMTables.cpp @@ -12,7 +12,7 @@ $end_info$ namespace FEXCore::X86Tables { using namespace InstFlags; -std::array SecondModRMTableOps = []() consteval { +constexpr std::array SecondModRMTableOps = []() consteval { std::array Table{}; constexpr U8U8InfoStruct SecondaryModRMExtensionOpTable[] = { // REG /1 diff --git a/FEXCore/Source/Interface/Core/X86Tables/X86Tables.h b/FEXCore/Source/Interface/Core/X86Tables/X86Tables.h index 7d7036286..4986df1f1 100644 --- a/FEXCore/Source/Interface/Core/X86Tables/X86Tables.h +++ b/FEXCore/Source/Interface/Core/X86Tables/X86Tables.h @@ -493,7 +493,7 @@ extern const std::array OpSizeModOps; extern const std::array PrimaryInstGroupOps; extern const std::array SecondInstGroupOps; -extern std::array SecondModRMTableOps; +extern const std::array SecondModRMTableOps; extern std::array X87Ops; extern const std::array DDDNowOps; extern const std::array H0F38TableOps;