From 1a1ce42889866b8c2a913a94d69d62be7140f1de Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 18 Jan 2017 00:43:01 -0500 Subject: [PATCH 1/4] Interpreter_Tables: Use std::array for instruction tables --- .../Interpreter/Interpreter_Tables.cpp | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp index ee10a2c8fd..798c4bcd8a 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp @@ -2,9 +2,11 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "Core/PowerPC/Interpreter/Interpreter.h" +#include + #include "Common/MsgHandler.h" #include "Core/PowerPC/Gekko.h" +#include "Core/PowerPC/Interpreter/Interpreter.h" #include "Core/PowerPC/Interpreter/Interpreter_Tables.h" #include "Core/PowerPC/PPCTables.h" @@ -18,8 +20,8 @@ struct GekkoOPTemplate // clang-format off static GekkoOPInfo unknownopinfo = { "unknown_instruction", OPTYPE_UNKNOWN, FL_ENDBLOCK, 0, 0, 0, 0 }; -static GekkoOPTemplate primarytable[] = -{ +static std::array primarytable = +{{ {4, Interpreter::RunTable4, {"RunTable4", OPTYPE_SUBTABLE, 0, 0, 0, 0, 0}}, {19, Interpreter::RunTable19, {"RunTable19", OPTYPE_SUBTABLE, 0, 0, 0, 0, 0}}, {31, Interpreter::RunTable31, {"RunTable31", OPTYPE_SUBTABLE, 0, 0, 0, 0, 0}}, @@ -88,10 +90,10 @@ static GekkoOPTemplate primarytable[] = {61, Interpreter::psq_stu, {"psq_stu", OPTYPE_STOREPS, FL_IN_FLOAT_S | FL_OUT_A | FL_IN_A | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, //missing: 0, 1, 2, 5, 6, 9, 22, 30, 62, 58 -}; +}}; -static GekkoOPTemplate table4[] = -{ //SUBOP10 +static std::array table4 = +{{ //SUBOP10 {0, Interpreter::ps_cmpu0, {"ps_cmpu0", OPTYPE_PS, FL_IN_FLOAT_AB | FL_SET_CRn | FL_USE_FPU | FL_READ_FPRF | FL_SET_FPRF, 1, 0, 0, 0}}, {32, Interpreter::ps_cmpo0, {"ps_cmpo0", OPTYPE_PS, FL_IN_FLOAT_AB | FL_SET_CRn | FL_USE_FPU | FL_READ_FPRF | FL_SET_FPRF, 1, 0, 0, 0}}, {40, Interpreter::ps_neg, {"ps_neg", OPTYPE_PS, FL_OUT_FLOAT_D | FL_IN_FLOAT_B | FL_RC_BIT_F | FL_USE_FPU, 1, 0, 0, 0}}, @@ -106,10 +108,10 @@ static GekkoOPTemplate table4[] = {624, Interpreter::ps_merge11, {"ps_merge11", OPTYPE_PS, FL_OUT_FLOAT_D | FL_IN_FLOAT_AB | FL_RC_BIT_F | FL_USE_FPU, 1, 0, 0, 0}}, {1014, Interpreter::dcbz_l, {"dcbz_l", OPTYPE_SYSTEM, FL_IN_A0B | FL_LOADSTORE, 1, 0, 0, 0}}, -}; +}}; -static GekkoOPTemplate table4_2[] = -{ +static std::array table4_2 = +{{ {10, Interpreter::ps_sum0, {"ps_sum0", OPTYPE_PS, FL_OUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {11, Interpreter::ps_sum1, {"ps_sum1", OPTYPE_PS, FL_OUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {12, Interpreter::ps_muls0, {"ps_muls0", OPTYPE_PS, FL_OUT_FLOAT_D | FL_IN_FLOAT_AC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, @@ -127,19 +129,19 @@ static GekkoOPTemplate table4_2[] = {29, Interpreter::ps_madd, {"ps_madd", OPTYPE_PS, FL_OUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {30, Interpreter::ps_nmsub, {"ps_nmsub", OPTYPE_PS, FL_OUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {31, Interpreter::ps_nmadd, {"ps_nmadd", OPTYPE_PS, FL_OUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, -}; +}}; -static GekkoOPTemplate table4_3[] = -{ +static std::array table4_3 = +{{ {6, Interpreter::psq_lx, {"psq_lx", OPTYPE_LOADPS, FL_OUT_FLOAT_D | FL_IN_A0B | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, {7, Interpreter::psq_stx, {"psq_stx", OPTYPE_STOREPS, FL_IN_FLOAT_S | FL_IN_A0B | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, {38, Interpreter::psq_lux, {"psq_lux", OPTYPE_LOADPS, FL_OUT_FLOAT_D | FL_OUT_A | FL_IN_AB | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, {39, Interpreter::psq_stux, {"psq_stux", OPTYPE_STOREPS, FL_IN_FLOAT_S | FL_OUT_A | FL_IN_AB | FL_USE_FPU | FL_LOADSTORE, 1, 0, 0, 0}}, -}; +}}; -static GekkoOPTemplate table19[] = -{ +static std::array table19 = +{{ {528, Interpreter::bcctrx, {"bcctrx", OPTYPE_BRANCH, FL_ENDBLOCK, 1, 0, 0, 0}}, {16, Interpreter::bclrx, {"bclrx", OPTYPE_BRANCH, FL_ENDBLOCK, 1, 0, 0, 0}}, {257, Interpreter::crand, {"crand", OPTYPE_CR, FL_EVIL, 1, 0, 0, 0}}, @@ -155,11 +157,10 @@ static GekkoOPTemplate table19[] = {0, Interpreter::mcrf, {"mcrf", OPTYPE_SYSTEM, FL_EVIL | FL_SET_CRn, 1, 0, 0, 0}}, {50, Interpreter::rfi, {"rfi", OPTYPE_SYSTEM, FL_ENDBLOCK | FL_CHECKEXCEPTIONS, 2, 0, 0, 0}}, -}; +}}; - -static GekkoOPTemplate table31[] = -{ +static std::array table31 = +{{ {266, Interpreter::addx, {"addx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_AB | FL_RC_BIT, 1, 0, 0, 0}}, {778, Interpreter::addx, {"addox", OPTYPE_INTEGER, FL_OUT_D | FL_IN_AB | FL_RC_BIT | FL_SET_OE, 1, 0, 0, 0}}, {10, Interpreter::addcx, {"addcx", OPTYPE_INTEGER, FL_OUT_D | FL_IN_AB | FL_SET_CA | FL_RC_BIT, 1, 0, 0, 0}}, @@ -299,10 +300,10 @@ static GekkoOPTemplate table31[] = {854, Interpreter::eieio, {"eieio", OPTYPE_SYSTEM, 0, 1, 0, 0, 0}}, {306, Interpreter::tlbie, {"tlbie", OPTYPE_SYSTEM, FL_IN_B, 1, 0, 0, 0}}, {566, Interpreter::tlbsync, {"tlbsync", OPTYPE_SYSTEM, 0, 1, 0, 0, 0}}, -}; +}}; -static GekkoOPTemplate table59[] = -{ +static std::array table59 = +{{ {18, Interpreter::fdivsx, {"fdivsx", OPTYPE_SINGLEFP, FL_OUT_FLOAT_D | FL_IN_FLOAT_AB | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 17, 0, 0, 0}}, // TODO {20, Interpreter::fsubsx, {"fsubsx", OPTYPE_SINGLEFP, FL_OUT_FLOAT_D | FL_IN_FLOAT_AB | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {21, Interpreter::faddsx, {"faddsx", OPTYPE_SINGLEFP, FL_OUT_FLOAT_D | FL_IN_FLOAT_AB | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, @@ -312,10 +313,10 @@ static GekkoOPTemplate table59[] = {29, Interpreter::fmaddsx, {"fmaddsx", OPTYPE_SINGLEFP, FL_OUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {30, Interpreter::fnmsubsx, {"fnmsubsx", OPTYPE_SINGLEFP, FL_OUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {31, Interpreter::fnmaddsx, {"fnmaddsx", OPTYPE_SINGLEFP, FL_OUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, -}; +}}; -static GekkoOPTemplate table63[] = -{ +static std::array table63 = +{{ {264, Interpreter::fabsx, {"fabsx", OPTYPE_DOUBLEFP, FL_INOUT_FLOAT_D | FL_IN_FLOAT_B | FL_RC_BIT_F | FL_USE_FPU, 1, 0, 0, 0}}, // FIXME: fcmp modifies the FPRF flags, but if the flags are clobbered later, @@ -338,10 +339,10 @@ static GekkoOPTemplate table63[] = {38, Interpreter::mtfsb1x, {"mtfsb1x", OPTYPE_SYSTEMFP, FL_RC_BIT_F | FL_USE_FPU | FL_READ_FPRF | FL_SET_FPRF, 3, 0, 0, 0}}, {134, Interpreter::mtfsfix, {"mtfsfix", OPTYPE_SYSTEMFP, FL_RC_BIT_F | FL_USE_FPU | FL_READ_FPRF | FL_SET_FPRF, 3, 0, 0, 0}}, {711, Interpreter::mtfsfx, {"mtfsfx", OPTYPE_SYSTEMFP, FL_RC_BIT_F | FL_IN_FLOAT_B | FL_USE_FPU | FL_READ_FPRF | FL_SET_FPRF, 3, 0, 0, 0}}, -}; +}}; -static GekkoOPTemplate table63_2[] = -{ +static std::array table63_2 = +{{ {18, Interpreter::fdivx, {"fdivx", OPTYPE_DOUBLEFP, FL_INOUT_FLOAT_D | FL_IN_FLOAT_AB | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 31, 0, 0, 0}}, {20, Interpreter::fsubx, {"fsubx", OPTYPE_DOUBLEFP, FL_INOUT_FLOAT_D | FL_IN_FLOAT_AB | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {21, Interpreter::faddx, {"faddx", OPTYPE_DOUBLEFP, FL_INOUT_FLOAT_D | FL_IN_FLOAT_AB | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, @@ -352,7 +353,7 @@ static GekkoOPTemplate table63_2[] = {29, Interpreter::fmaddx, {"fmaddx", OPTYPE_DOUBLEFP, FL_INOUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {30, Interpreter::fnmsubx, {"fnmsubx", OPTYPE_DOUBLEFP, FL_INOUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, {31, Interpreter::fnmaddx, {"fnmaddx", OPTYPE_DOUBLEFP, FL_INOUT_FLOAT_D | FL_IN_FLOAT_ABC | FL_RC_BIT_F | FL_USE_FPU | FL_SET_FPRF, 1, 0, 0, 0}}, -}; +}}; // clang-format on namespace InterpreterTables From 6c61021eb190da0bc9244278e76e8f6d78ab4940 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 18 Jan 2017 01:17:37 -0500 Subject: [PATCH 2/4] PPCTables: Use std::array instead of raw C arrays --- .../PowerPC/Jit64/Jit_SystemRegisters.cpp | 6 ++-- .../JitArm64/JitArm64_SystemRegisters.cpp | 4 +-- Source/Core/Core/PowerPC/PPCTables.cpp | 31 ++++++++++--------- Source/Core/Core/PowerPC/PPCTables.h | 20 ++++++------ Source/Core/Core/PowerPC/PowerPC.h | 2 +- 5 files changed, 34 insertions(+), 29 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp index dbb96a8394..2127b1f62d 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_SystemRegisters.cpp @@ -484,7 +484,7 @@ void Jit64::mtcrf(UGeckoInstruction inst) } else { - MOV(64, R(RSCRATCH2), ImmPtr(m_crTable)); + MOV(64, R(RSCRATCH2), ImmPtr(m_crTable.data())); gpr.Lock(inst.RS); gpr.BindToRegister(inst.RS, true, false); for (int i = 0; i < 8; i++) @@ -531,7 +531,7 @@ void Jit64::mcrxr(UGeckoInstruction inst) // [SO OV CA 0] << 3 SHL(32, R(RSCRATCH), Imm8(4)); - MOV(64, R(RSCRATCH2), ImmPtr(m_crTable)); + MOV(64, R(RSCRATCH2), ImmPtr(m_crTable.data())); MOV(64, R(RSCRATCH), MRegSum(RSCRATCH, RSCRATCH2)); MOV(64, PPCSTATE(cr_val[inst.CRFD]), R(RSCRATCH)); @@ -623,7 +623,7 @@ void Jit64::mcrfs(UGeckoInstruction inst) } AND(32, R(RSCRATCH), Imm32(mask)); MOV(32, PPCSTATE(fpscr), R(RSCRATCH)); - LEA(64, RSCRATCH, M(&m_crTable)); + LEA(64, RSCRATCH, M(m_crTable.data())); MOV(64, R(RSCRATCH), MComplex(RSCRATCH, RSCRATCH2, SCALE_8, 0)); MOV(64, PPCSTATE(cr_val[inst.CRFD]), R(RSCRATCH)); } diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp index 7ee288e5d0..e683c2f0a5 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_SystemRegisters.cpp @@ -102,7 +102,7 @@ void JitArm64::mcrxr(UGeckoInstruction inst) // [SO OV CA 0] << 3 LSL(WA, WA, 4); - MOVP2R(XB, m_crTable); + MOVP2R(XB, m_crTable.data()); LDR(XB, XB, XA); STR(INDEX_UNSIGNED, XB, PPC_REG, PPCSTATE_OFF(cr_val[inst.CRFD])); @@ -636,7 +636,7 @@ void JitArm64::mtcrf(UGeckoInstruction inst) ARM64Reg XA = EncodeRegTo64(WA); ARM64Reg WB = gpr.GetReg(); ARM64Reg XB = EncodeRegTo64(WB); - MOVP2R(XB, m_crTable); + MOVP2R(XB, m_crTable.data()); for (int i = 0; i < 8; ++i) { if ((crm & (0x80 >> i)) != 0) diff --git a/Source/Core/Core/PowerPC/PPCTables.cpp b/Source/Core/Core/PowerPC/PPCTables.cpp index c932a5d608..fda50310d9 100644 --- a/Source/Core/Core/PowerPC/PPCTables.cpp +++ b/Source/Core/Core/PowerPC/PPCTables.cpp @@ -2,8 +2,12 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/PowerPC/PPCTables.h" + #include +#include #include +#include #include #include "Common/CommonTypes.h" @@ -13,25 +17,24 @@ #include "Core/PowerPC/Interpreter/Interpreter.h" #include "Core/PowerPC/Interpreter/Interpreter_Tables.h" #include "Core/PowerPC/JitInterface.h" -#include "Core/PowerPC/PPCTables.h" #include "Core/PowerPC/PowerPC.h" -GekkoOPInfo* m_infoTable[64]; -GekkoOPInfo* m_infoTable4[1024]; -GekkoOPInfo* m_infoTable19[1024]; -GekkoOPInfo* m_infoTable31[1024]; -GekkoOPInfo* m_infoTable59[32]; -GekkoOPInfo* m_infoTable63[1024]; +std::array m_infoTable; +std::array m_infoTable4; +std::array m_infoTable19; +std::array m_infoTable31; +std::array m_infoTable59; +std::array m_infoTable63; -GekkoOPInfo* m_allInstructions[512]; -int m_numInstructions; +std::array m_allInstructions; +size_t m_numInstructions; -const u64 m_crTable[16] = { +const std::array m_crTable = {{ PPCCRToInternal(0x0), PPCCRToInternal(0x1), PPCCRToInternal(0x2), PPCCRToInternal(0x3), PPCCRToInternal(0x4), PPCCRToInternal(0x5), PPCCRToInternal(0x6), PPCCRToInternal(0x7), PPCCRToInternal(0x8), PPCCRToInternal(0x9), PPCCRToInternal(0xA), PPCCRToInternal(0xB), PPCCRToInternal(0xC), PPCCRToInternal(0xD), PPCCRToInternal(0xE), PPCCRToInternal(0xF), -}; +}}; GekkoOPInfo* GetOpInfo(UGeckoInstruction _inst) { @@ -152,7 +155,7 @@ void PrintInstructionRunCounts() typedef std::pair OpInfo; std::vector temp; temp.reserve(m_numInstructions); - for (int i = 0; i < m_numInstructions; ++i) + for (size_t i = 0; i < m_numInstructions; ++i) { GekkoOPInfo* pInst = m_allInstructions[i]; temp.emplace_back(pInst->opname, pInst->runCount); @@ -175,7 +178,7 @@ void LogCompiledInstructions() File::IOFile f(StringFromFormat("%sinst_log%i.txt", File::GetUserPath(D_LOGS_IDX).c_str(), time), "w"); - for (int i = 0; i < m_numInstructions; i++) + for (size_t i = 0; i < m_numInstructions; i++) { GekkoOPInfo* pInst = m_allInstructions[i]; if (pInst->compileCount > 0) @@ -186,7 +189,7 @@ void LogCompiledInstructions() } f.Open(StringFromFormat("%sinst_not%i.txt", File::GetUserPath(D_LOGS_IDX).c_str(), time), "w"); - for (int i = 0; i < m_numInstructions; i++) + for (size_t i = 0; i < m_numInstructions; i++) { GekkoOPInfo* pInst = m_allInstructions[i]; if (pInst->compileCount == 0) diff --git a/Source/Core/Core/PowerPC/PPCTables.h b/Source/Core/Core/PowerPC/PPCTables.h index 1b564d6475..eada803ef5 100644 --- a/Source/Core/Core/PowerPC/PPCTables.h +++ b/Source/Core/Core/PowerPC/PPCTables.h @@ -4,6 +4,9 @@ #pragma once +#include +#include + #include "Core/PowerPC/Gekko.h" #include "Core/PowerPC/Interpreter/Interpreter.h" @@ -92,16 +95,15 @@ struct GekkoOPInfo int compileCount; u32 lastUse; }; -extern GekkoOPInfo* m_infoTable[64]; -extern GekkoOPInfo* m_infoTable4[1024]; -extern GekkoOPInfo* m_infoTable19[1024]; -extern GekkoOPInfo* m_infoTable31[1024]; -extern GekkoOPInfo* m_infoTable59[32]; -extern GekkoOPInfo* m_infoTable63[1024]; +extern std::array m_infoTable; +extern std::array m_infoTable4; +extern std::array m_infoTable19; +extern std::array m_infoTable31; +extern std::array m_infoTable59; +extern std::array m_infoTable63; -extern GekkoOPInfo* m_allInstructions[512]; - -extern int m_numInstructions; +extern std::array m_allInstructions; +extern size_t m_numInstructions; GekkoOPInfo* GetOpInfo(UGeckoInstruction _inst); Interpreter::Instruction GetInterpreterOp(UGeckoInstruction _inst); diff --git a/Source/Core/Core/PowerPC/PowerPC.h b/Source/Core/Core/PowerPC/PowerPC.h index c9216c5faf..885b8a5da2 100644 --- a/Source/Core/Core/PowerPC/PowerPC.h +++ b/Source/Core/Core/PowerPC/PowerPC.h @@ -325,7 +325,7 @@ inline u64 PPCCRToInternal(u8 value) } // convert flags into 64-bit CR values with a lookup table -extern const u64 m_crTable[16]; +extern const std::array m_crTable; // Warning: these CR operations are fairly slow since they need to convert from // PowerPC format (4 bit) to our internal 64 bit format. See the definition of From 06488477a98e67f53197588cb5a3000f3baab03d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 18 Jan 2017 02:17:10 -0500 Subject: [PATCH 3/4] Interpreter_Tables: Ensure all instructions fit within m_allInstruction at compile-time --- .../PowerPC/Interpreter/Interpreter_Tables.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp index 798c4bcd8a..eb1c62c9f8 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp @@ -4,7 +4,6 @@ #include -#include "Common/MsgHandler.h" #include "Core/PowerPC/Gekko.h" #include "Core/PowerPC/Interpreter/Interpreter.h" #include "Core/PowerPC/Interpreter/Interpreter_Tables.h" @@ -358,6 +357,15 @@ static std::array table63_2 = namespace InterpreterTables { +constexpr size_t TotalInstructionFunctionCount() +{ + return primarytable.size() + table4_2.size() + table4_3.size() + table4.size() + table31.size() + + table19.size() + table59.size() + table63.size() + table63_2.size(); +} + +static_assert(TotalInstructionFunctionCount() < m_allInstructions.size(), + "m_allInstructions is too small"); + void InitTables() { // once initialized, tables are read-only @@ -484,11 +492,6 @@ void InitTables() for (auto& tpl : table63_2) m_allInstructions[m_numInstructions++] = &tpl.opinfo; - if (m_numInstructions >= 512) - { - PanicAlert("m_allInstructions underdimensioned"); - } - initialized = true; } } From bba6a31eb613aabd03a391e1674a7304fb25c553 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 18 Jan 2017 02:36:19 -0500 Subject: [PATCH 4/4] Interpreter_Tables: Amend leftover comment --- Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp index eb1c62c9f8..29c41f73eb 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp @@ -494,5 +494,4 @@ void InitTables() initialized = true; } -} -// remove +} // namespace InterpreterTables