PPCTables: Namespace all exposed functions

It's somewhat inconsistent to have two straggler functions outside the
namespace.
This commit is contained in:
Lioncash 2018-03-24 16:31:55 -04:00
parent 5369d3c9f1
commit 2381aeecc3
8 changed files with 12 additions and 11 deletions

View File

@ -241,7 +241,7 @@ void CachedInterpreter::Jit(u32 address)
if (endblock || memcheck) if (endblock || memcheck)
m_code.emplace_back(WritePC, ops[i].address); m_code.emplace_back(WritePC, ops[i].address);
m_code.emplace_back(GetInterpreterOp(ops[i].inst), ops[i].inst); m_code.emplace_back(PPCTables::GetInterpreterOp(ops[i].inst), ops[i].inst);
if (memcheck) if (memcheck)
m_code.emplace_back(CheckDSI, js.downcountAmount); m_code.emplace_back(CheckDSI, js.downcountAmount);
if (endblock) if (endblock)

View File

@ -193,7 +193,7 @@ int Interpreter::SingleStepInner()
last_pc = PC; last_pc = PC;
PC = NPC; PC = NPC;
GekkoOPInfo* opinfo = GetOpInfo(instCode); const GekkoOPInfo* opinfo = PPCTables::GetOpInfo(instCode);
return opinfo->numCycles; return opinfo->numCycles;
} }

View File

@ -287,7 +287,7 @@ void Jit64::FallBackToInterpreter(UGeckoInstruction inst)
MOV(32, PPCSTATE(pc), Imm32(js.compilerPC)); MOV(32, PPCSTATE(pc), Imm32(js.compilerPC));
MOV(32, PPCSTATE(npc), Imm32(js.compilerPC + 4)); MOV(32, PPCSTATE(npc), Imm32(js.compilerPC + 4));
} }
Interpreter::Instruction instr = GetInterpreterOp(inst); Interpreter::Instruction instr = PPCTables::GetInterpreterOp(inst);
ABI_PushRegistersAndAdjustStack({}, 0); ABI_PushRegistersAndAdjustStack({}, 0);
ABI_CallFunctionC(instr, inst.hex); ABI_CallFunctionC(instr, inst.hex);
ABI_PopRegistersAndAdjustStack({}, 0); ABI_PopRegistersAndAdjustStack({}, 0);

View File

@ -149,7 +149,7 @@ void JitArm64::FallBackToInterpreter(UGeckoInstruction inst)
gpr.Unlock(WA); gpr.Unlock(WA);
} }
Interpreter::Instruction instr = GetInterpreterOp(inst); Interpreter::Instruction instr = PPCTables::GetInterpreterOp(inst);
MOVI2R(W0, inst.hex); MOVI2R(W0, inst.hex);
MOVP2R(X30, instr); MOVP2R(X30, instr);
BLR(X30); BLR(X30);

View File

@ -239,8 +239,8 @@ void CompileExceptionCheck(ExceptionType type)
if (type == ExceptionType::FIFOWrite) if (type == ExceptionType::FIFOWrite)
{ {
// Check in case the code has been replaced since: do we need to do this? // Check in case the code has been replaced since: do we need to do this?
const ::OpType optype = GetOpInfo(PowerPC::HostRead_U32(PC))->type; const OpType optype = PPCTables::GetOpInfo(PowerPC::HostRead_U32(PC))->type;
if (optype != ::OpType::Store && optype != ::OpType::StoreFP && optype != ::OpType::StorePS) if (optype != OpType::Store && optype != OpType::StoreFP && optype != OpType::StorePS)
return; return;
} }
exception_addresses->insert(PC); exception_addresses->insert(PC);

View File

@ -726,7 +726,7 @@ u32 PPCAnalyzer::Analyze(u32 address, CodeBlock* block, CodeBuffer* buffer, u32
num_inst++; num_inst++;
memset(&code[i], 0, sizeof(CodeOp)); memset(&code[i], 0, sizeof(CodeOp));
GekkoOPInfo* opinfo = GetOpInfo(inst); GekkoOPInfo* opinfo = PPCTables::GetOpInfo(inst);
code[i].opinfo = opinfo; code[i].opinfo = opinfo;
code[i].address = address; code[i].address = address;

View File

@ -41,6 +41,8 @@ const std::array<u64, 16> m_crTable = {{
}}; }};
} // namespace PowerPC } // namespace PowerPC
namespace PPCTables
{
GekkoOPInfo* GetOpInfo(UGeckoInstruction _inst) GekkoOPInfo* GetOpInfo(UGeckoInstruction _inst)
{ {
GekkoOPInfo* info = m_infoTable[_inst.OPCD]; GekkoOPInfo* info = m_infoTable[_inst.OPCD];
@ -106,8 +108,7 @@ Interpreter::Instruction GetInterpreterOp(UGeckoInstruction _inst)
return Interpreter::m_op_table[_inst.OPCD]; return Interpreter::m_op_table[_inst.OPCD];
} }
} }
namespace PPCTables
{
bool UsesFPU(UGeckoInstruction inst) bool UsesFPU(UGeckoInstruction inst)
{ {
GekkoOPInfo* const info = GetOpInfo(inst); GekkoOPInfo* const info = GetOpInfo(inst);

View File

@ -105,11 +105,11 @@ extern std::array<GekkoOPInfo*, 1024> m_infoTable63;
extern std::array<GekkoOPInfo*, 512> m_allInstructions; extern std::array<GekkoOPInfo*, 512> m_allInstructions;
extern size_t m_numInstructions; extern size_t m_numInstructions;
namespace PPCTables
{
GekkoOPInfo* GetOpInfo(UGeckoInstruction _inst); GekkoOPInfo* GetOpInfo(UGeckoInstruction _inst);
Interpreter::Instruction GetInterpreterOp(UGeckoInstruction _inst); Interpreter::Instruction GetInterpreterOp(UGeckoInstruction _inst);
namespace PPCTables
{
bool IsValidInstruction(UGeckoInstruction _instCode); bool IsValidInstruction(UGeckoInstruction _instCode);
bool UsesFPU(UGeckoInstruction _inst); bool UsesFPU(UGeckoInstruction _inst);