From c56717e058d827c53c4d7e00a3a13432881f93bd Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 22 Aug 2015 11:25:58 -0400 Subject: [PATCH] Core: Shorten the _interpreterInstruction typedef The class itself already acts as a namespace trailer, so '_interpreter' isn't necessary. This also gets rid of a duplicate typedef in the Interpreter_Tables. --- .../Core/Core/PowerPC/Interpreter/Interpreter.cpp | 12 ++++++------ Source/Core/Core/PowerPC/Interpreter/Interpreter.h | 14 +++++++------- .../PowerPC/Interpreter/Interpreter_Tables.cpp | 4 +--- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 2 +- Source/Core/Core/PowerPC/JitArm64/Jit.cpp | 2 +- Source/Core/Core/PowerPC/PPCTables.cpp | 2 +- Source/Core/Core/PowerPC/PPCTables.h | 2 +- 7 files changed, 18 insertions(+), 20 deletions(-) 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..5b1fda3560 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Tables.cpp @@ -4,12 +4,10 @@ #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/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/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 {