diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp index a1e60da662..319f29c186 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter.cpp @@ -120,12 +120,17 @@ int Interpreter::SingleStepInner() if (HandleFunctionHooking(PowerPC::ppcState.pc)) { UpdatePC(); + // TODO: Does it make sense to use m_prev_inst here? + // It seems like we should use the num_cycles for the instruction at PC instead + // (m_prev_inst has not yet been updated) return PPCTables::GetOpInfo(m_prev_inst)->num_cycles; } PowerPC::ppcState.npc = PowerPC::ppcState.pc + sizeof(UGeckoInstruction); m_prev_inst.hex = PowerPC::Read_Opcode(PowerPC::ppcState.pc); + const GekkoOPInfo* opinfo = PPCTables::GetOpInfo(m_prev_inst); + // Uncomment to trace the interpreter // if ((PowerPC::ppcState.pc & 0x00FFFFFF) >= 0x000AB54C && // (PowerPC::ppcState.pc & 0x00FFFFFF) <= 0x000AB624) @@ -160,7 +165,7 @@ int Interpreter::SingleStepInner() else { // check if we have to generate a FPU unavailable exception or a program exception. - if (PPCTables::UsesFPU(m_prev_inst)) + if ((opinfo->flags & FL_USE_FPU) != 0) { PowerPC::ppcState.Exceptions |= EXCEPTION_FPU_UNAVAILABLE; CheckExceptions(); @@ -183,7 +188,6 @@ int Interpreter::SingleStepInner() UpdatePC(); - const GekkoOPInfo* opinfo = PPCTables::GetOpInfo(m_prev_inst); PowerPC::UpdatePerformanceMonitor(opinfo->num_cycles, (opinfo->flags & FL_LOADSTORE) != 0, (opinfo->flags & FL_USE_FPU) != 0, PowerPC::ppcState); return opinfo->num_cycles; diff --git a/Source/Core/Core/PowerPC/PPCTables.cpp b/Source/Core/Core/PowerPC/PPCTables.cpp index eeb5b80270..dcd4d8417e 100644 --- a/Source/Core/Core/PowerPC/PPCTables.cpp +++ b/Source/Core/Core/PowerPC/PPCTables.cpp @@ -648,13 +648,6 @@ const GekkoOPInfo* GetOpInfo(UGeckoInstruction inst) } } -bool UsesFPU(UGeckoInstruction inst) -{ - const GekkoOPInfo* const info = GetOpInfo(inst); - - return (info->flags & FL_USE_FPU) != 0; -} - // #define OPLOG // #define OP_TO_LOG "mtfsb0x" diff --git a/Source/Core/Core/PowerPC/PPCTables.h b/Source/Core/Core/PowerPC/PPCTables.h index 5b610e5663..8d92f1811e 100644 --- a/Source/Core/Core/PowerPC/PPCTables.h +++ b/Source/Core/Core/PowerPC/PPCTables.h @@ -121,7 +121,6 @@ namespace PPCTables const GekkoOPInfo* GetOpInfo(UGeckoInstruction inst); bool IsValidInstruction(UGeckoInstruction inst); -bool UsesFPU(UGeckoInstruction inst); void CountInstruction(UGeckoInstruction inst); void CountInstructionCompile(const GekkoOPInfo* info, u32 pc);