diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp index 349a235d64..50f7fe721b 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp @@ -26,12 +26,12 @@ namespace bool Interpreter::m_EndBlock; // function tables -Interpreter::_interpreterInstruction Interpreter::m_opTable[64]; -Interpreter::_interpreterInstruction Interpreter::m_opTable4[1024]; -Interpreter::_interpreterInstruction Interpreter::m_opTable19[1024]; -Interpreter::_interpreterInstruction Interpreter::m_opTable31[1024]; -Interpreter::_interpreterInstruction Interpreter::m_opTable59[32]; -Interpreter::_interpreterInstruction Interpreter::m_opTable63[1024]; +Interpreter::Instruction Interpreter::m_opTable[64]; +Interpreter::Instruction Interpreter::m_opTable4[1024]; +Interpreter::Instruction Interpreter::m_opTable19[1024]; +Interpreter::Instruction Interpreter::m_opTable31[1024]; +Interpreter::Instruction Interpreter::m_opTable59[32]; +Interpreter::Instruction Interpreter::m_opTable63[1024]; void Interpreter::RunTable4(UGeckoInstruction _inst) { m_opTable4 [_inst.SUBOP10](_inst); } void Interpreter::RunTable19(UGeckoInstruction _inst) { m_opTable19[_inst.SUBOP10](_inst); } diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter.h b/Source/Core/Core/PowerPC/Interpreter/Interpreter.h index b49f3664b9..fd8ee933c6 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter.h +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter.h @@ -273,13 +273,13 @@ public: static void sync(UGeckoInstruction _inst); static void isync(UGeckoInstruction _inst); - typedef void(*_interpreterInstruction)(UGeckoInstruction instCode); - static _interpreterInstruction m_opTable[64]; - static _interpreterInstruction m_opTable4[1024]; - static _interpreterInstruction m_opTable19[1024]; - static _interpreterInstruction m_opTable31[1024]; - static _interpreterInstruction m_opTable59[32]; - static _interpreterInstruction m_opTable63[1024]; + using Instruction = void (*)(UGeckoInstruction instCode); + static Instruction m_opTable[64]; + static Instruction m_opTable4[1024]; + static Instruction m_opTable19[1024]; + static Instruction m_opTable31[1024]; + static Instruction m_opTable59[32]; + static Instruction m_opTable63[1024]; // singleton static Interpreter* getInstance(); diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp index 9135e5915b..f5d455dd09 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp @@ -2,14 +2,15 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/PowerPC/Gekko.h" +#include "Core/PowerPC/PPCTables.h" +#include "Core/PowerPC/Interpreter/Interpreter.h" #include "Core/PowerPC/Interpreter/Interpreter_Tables.h" -typedef void (*_Instruction) (UGeckoInstruction instCode); - struct GekkoOPTemplate { int opcode; - _Instruction Inst; + Interpreter::Instruction Inst; GekkoOPInfo opinfo; }; diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.h b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.h index 4368d5b643..595ef038d1 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.h +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.h @@ -4,10 +4,6 @@ #pragma once -#include "../Gekko.h" -#include "../PPCTables.h" -#include "Core/PowerPC/Interpreter/Interpreter.h" - namespace InterpreterTables { void InitTables(); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index a901b23653..0cfcc614af 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -240,7 +240,7 @@ void Jit64::FallBackToInterpreter(UGeckoInstruction inst) MOV(32, PPCSTATE(pc), Imm32(js.compilerPC)); MOV(32, PPCSTATE(npc), Imm32(js.compilerPC + 4)); } - Interpreter::_interpreterInstruction instr = GetInterpreterOp(inst); + Interpreter::Instruction instr = GetInterpreterOp(inst); ABI_PushRegistersAndAdjustStack({}, 0); ABI_CallFunctionC((void*)instr, inst.hex); ABI_PopRegistersAndAdjustStack({}, 0); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.h b/Source/Core/Core/PowerPC/Jit64/Jit.h index 06f8a6e524..a4449ae256 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.h +++ b/Source/Core/Core/PowerPC/Jit64/Jit.h @@ -151,6 +151,7 @@ public: void UpdateRoundingMode(); // OPCODES + using Instruction = void (Jit64::*)(UGeckoInstruction instCode); void FallBackToInterpreter(UGeckoInstruction _inst); void DoNothing(UGeckoInstruction _inst); void HLEFunction(UGeckoInstruction _inst); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp index 4f2046f5c8..e7cbb7d3c8 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.cpp @@ -2,18 +2,16 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/PowerPC/Gekko.h" #include "Core/PowerPC/Jit64/Jit.h" #include "Core/PowerPC/Jit64/Jit64_Tables.h" -// Should be moved in to the Jit class -typedef void (Jit64::*_Instruction) (UGeckoInstruction instCode); - -static _Instruction dynaOpTable[64]; -static _Instruction dynaOpTable4[1024]; -static _Instruction dynaOpTable19[1024]; -static _Instruction dynaOpTable31[1024]; -static _Instruction dynaOpTable59[32]; -static _Instruction dynaOpTable63[1024]; +static Jit64::Instruction dynaOpTable[64]; +static Jit64::Instruction dynaOpTable4[1024]; +static Jit64::Instruction dynaOpTable19[1024]; +static Jit64::Instruction dynaOpTable31[1024]; +static Jit64::Instruction dynaOpTable59[32]; +static Jit64::Instruction dynaOpTable63[1024]; void Jit64::DynaRunTable4(UGeckoInstruction _inst) {(this->*dynaOpTable4 [_inst.SUBOP10])(_inst);} void Jit64::DynaRunTable19(UGeckoInstruction _inst) {(this->*dynaOpTable19[_inst.SUBOP10])(_inst);} void Jit64::DynaRunTable31(UGeckoInstruction _inst) {(this->*dynaOpTable31[_inst.SUBOP10])(_inst);} @@ -23,8 +21,7 @@ void Jit64::DynaRunTable63(UGeckoInstruction _inst) {(this->*dynaOpTable63[_inst struct GekkoOPTemplate { int opcode; - _Instruction Inst; - //GekkoOPInfo opinfo; // Doesn't need opinfo, Interpreter fills it out + Jit64::Instruction Inst; }; static GekkoOPTemplate primarytable[] = diff --git a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.h b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.h index fd8a6a8030..012d335ffe 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.h +++ b/Source/Core/Core/PowerPC/Jit64/Jit64_Tables.h @@ -4,12 +4,10 @@ #pragma once -#include "Core/PowerPC/Gekko.h" -#include "Core/PowerPC/PPCTables.h" -#include "Core/PowerPC/Jit64/Jit.h" +namespace PPCAnalyst { struct CodeOp; } namespace Jit64Tables { - void CompileInstruction(PPCAnalyst::CodeOp & op); + void CompileInstruction(PPCAnalyst::CodeOp& op); void InitTables(); } diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.h b/Source/Core/Core/PowerPC/Jit64IL/JitIL.h index 3efb1f3905..e9c59fe3e4 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.h +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.h @@ -87,6 +87,7 @@ public: void WriteCode(u32 exitAddress); // OPCODES + using Instruction = void (JitIL::*)(UGeckoInstruction instCode); void FallBackToInterpreter(UGeckoInstruction _inst) override; void DoNothing(UGeckoInstruction _inst) override; void HLEFunction(UGeckoInstruction _inst) override; @@ -96,5 +97,4 @@ public: void DynaRunTable31(UGeckoInstruction _inst) override; void DynaRunTable59(UGeckoInstruction _inst) override; void DynaRunTable63(UGeckoInstruction _inst) override; - }; diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.cpp b/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.cpp index 8333f3f9dc..ec721d19d4 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.cpp @@ -2,17 +2,17 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include "Core/PowerPC/Gekko.h" +#include "Core/PowerPC/PPCTables.h" +#include "Core/PowerPC/Jit64IL/JitIL.h" #include "Core/PowerPC/Jit64IL/JitIL_Tables.h" -// Should be moved in to the Jit class -typedef void (JitIL::*_Instruction) (UGeckoInstruction instCode); - -static _Instruction dynaOpTable[64]; -static _Instruction dynaOpTable4[1024]; -static _Instruction dynaOpTable19[1024]; -static _Instruction dynaOpTable31[1024]; -static _Instruction dynaOpTable59[32]; -static _Instruction dynaOpTable63[1024]; +static JitIL::Instruction dynaOpTable[64]; +static JitIL::Instruction dynaOpTable4[1024]; +static JitIL::Instruction dynaOpTable19[1024]; +static JitIL::Instruction dynaOpTable31[1024]; +static JitIL::Instruction dynaOpTable59[32]; +static JitIL::Instruction dynaOpTable63[1024]; void JitIL::DynaRunTable4(UGeckoInstruction _inst) {(this->*dynaOpTable4 [_inst.SUBOP10])(_inst);} void JitIL::DynaRunTable19(UGeckoInstruction _inst) {(this->*dynaOpTable19[_inst.SUBOP10])(_inst);} @@ -20,13 +20,10 @@ void JitIL::DynaRunTable31(UGeckoInstruction _inst) {(this->*dynaOpTable31[_inst void JitIL::DynaRunTable59(UGeckoInstruction _inst) {(this->*dynaOpTable59[_inst.SUBOP5 ])(_inst);} void JitIL::DynaRunTable63(UGeckoInstruction _inst) {(this->*dynaOpTable63[_inst.SUBOP10])(_inst);} - - struct GekkoOPTemplate { int opcode; - _Instruction Inst; - //GekkoOPInfo opinfo; // Doesn't need opinfo, Interpreter fills it out + JitIL::Instruction Inst; }; static GekkoOPTemplate primarytable[] = diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.h b/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.h index 25d58ae377..79cf143a69 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.h +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL_Tables.h @@ -4,12 +4,10 @@ #pragma once -#include "Core/PowerPC/Gekko.h" -#include "Core/PowerPC/PPCTables.h" -#include "Core/PowerPC/Jit64IL/JitIL.h" +namespace PPCAnalyst { struct CodeOp; } namespace JitILTables { - void CompileInstruction(PPCAnalyst::CodeOp & op); + void CompileInstruction(PPCAnalyst::CodeOp& op); void InitTables(); } diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp index 3a26051146..345abe547a 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp @@ -70,7 +70,7 @@ void JitArm64::FallBackToInterpreter(UGeckoInstruction inst) gpr.Unlock(WA); } - Interpreter::_interpreterInstruction instr = GetInterpreterOp(inst); + Interpreter::Instruction instr = GetInterpreterOp(inst); MOVI2R(W0, inst.hex); MOVI2R(X30, (u64)instr); BLR(X30); diff --git a/Source/Core/Core/PowerPC/PPCTables.cpp b/Source/Core/Core/PowerPC/PPCTables.cpp index d54f689743..a7a185d288 100644 --- a/Source/Core/Core/PowerPC/PPCTables.cpp +++ b/Source/Core/Core/PowerPC/PPCTables.cpp @@ -63,7 +63,7 @@ GekkoOPInfo *GetOpInfo(UGeckoInstruction _inst) } } -Interpreter::_interpreterInstruction GetInterpreterOp(UGeckoInstruction _inst) +Interpreter::Instruction GetInterpreterOp(UGeckoInstruction _inst) { const GekkoOPInfo *info = m_infoTable[_inst.OPCD]; if ((info->type & 0xFFFFFF) == OPTYPE_SUBTABLE) diff --git a/Source/Core/Core/PowerPC/PPCTables.h b/Source/Core/Core/PowerPC/PPCTables.h index 82a9ac5d37..c7bfe1f446 100644 --- a/Source/Core/Core/PowerPC/PPCTables.h +++ b/Source/Core/Core/PowerPC/PPCTables.h @@ -100,7 +100,7 @@ extern GekkoOPInfo *m_allInstructions[512]; extern int m_numInstructions; GekkoOPInfo *GetOpInfo(UGeckoInstruction _inst); -Interpreter::_interpreterInstruction GetInterpreterOp(UGeckoInstruction _inst); +Interpreter::Instruction GetInterpreterOp(UGeckoInstruction _inst); namespace PPCTables {