CPU Backends: Make each CPU backend responsible for initializing its own

instruction tables

Previously, all of the internals that handled how the instruction tables
are initialized were exposed externally. However, this can all be made
private to each CPU backend.

If each backend has an Init() function, then this is where the instruction
tables should be initialized, it shouldn't be the responsibility of
external code to ensure internal validity.

This allows for getting rid of all the table initialization shenanigans
within JitInterface and PPCTables.
This commit is contained in:
Lioncash
2017-02-08 04:27:04 -05:00
parent 5da7d700ca
commit 1ce1304d0f
23 changed files with 44 additions and 171 deletions

View File

@ -22,14 +22,11 @@
#if _M_X86
#include "Core/PowerPC/Jit64/Jit.h"
#include "Core/PowerPC/Jit64/Jit64_Tables.h"
#include "Core/PowerPC/Jit64IL/JitIL.h"
#include "Core/PowerPC/Jit64IL/JitIL_Tables.h"
#endif
#if _M_ARM_64
#include "Core/PowerPC/JitArm64/Jit.h"
#include "Core/PowerPC/JitArm64/JitArm64_Tables.h"
#endif
namespace JitInterface
@ -70,31 +67,7 @@ CPUCoreBase* InitJitCore(int core)
g_jit->Init();
return ptr;
}
void InitTables(int core)
{
switch (core)
{
#if _M_X86
case PowerPC::CORE_JIT64:
Jit64Tables::InitTables();
break;
case PowerPC::CORE_JITIL64:
JitILTables::InitTables();
break;
#endif
#if _M_ARM_64
case PowerPC::CORE_JITARM64:
JitArm64Tables::InitTables();
break;
#endif
case PowerPC::CORE_CACHEDINTERPRETER:
// has no tables
break;
default:
PanicAlert("Unrecognizable cpu_core: %d", core);
break;
}
}
CPUCoreBase* GetCore()
{
return g_jit;