mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-03 03:03:50 +01:00
Minor IR interpreter optimization
This commit is contained in:
1 parent
9bef910953
commit
91d9ef9b81
3 files changed
+9
-6
No files matched your search
@@ -1138,13 +1138,14 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst, int count) {
|
||||
// Unimplemented IR op. Bad.
|
||||
Crash();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (mips->r[0] != 0)
|
||||
Crash();
|
||||
#endif
|
||||
inst++;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (mips->r[0] != 0)
|
||||
Crash();
|
||||
#endif
|
||||
|
||||
// We hit count. If this is a full block, it was badly constructed.
|
||||
return 0;
|
||||
}
|
||||
@@ -250,8 +250,7 @@ void IRJit::RunLoopUntil(u64 globalticks) {
|
||||
u32 inst = Memory::ReadUnchecked_U32(mips_->pc);
|
||||
u32 opcode = inst & 0xFF000000;
|
||||
if (opcode == MIPS_EMUHACK_OPCODE) {
|
||||
u32 data = inst & 0xFFFFFF;
|
||||
IRBlock *block = blocks_.GetBlock(data);
|
||||
IRBlock *block = blocks_.GetBlockUnchecked(inst & 0xFFFFFF);
|
||||
u32 startPC = mips_->pc;
|
||||
mips_->pc = IRInterpret(mips_, block->GetInstructions(), block->GetNumInstructions());
|
||||
// Note: this will "jump to zero" on a badly constructed block missing exits.
|
||||
|
||||
@@ -127,6 +127,9 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
IRBlock *GetBlockUnchecked(int i) {
|
||||
return &blocks_[i];
|
||||
}
|
||||
const IRBlock *GetBlock(int i) const {
|
||||
if (i >= 0 && i < (int)blocks_.size()) {
|
||||
return &blocks_[i];
|
||||
|
||||
Reference in new issue
Block a user