From daa72aba103dafb493dc7416b694b536b86f5026 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 19 Aug 2020 23:38:05 +1000 Subject: [PATCH] CPU: Skip executing nop instructions Makes PGXP CPU mode quicker, as well as a performance improvement to the regular interpreter. --- src/core/cpu_core.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/cpu_core.cpp b/src/core/cpu_core.cpp index 6e2b8cb34..87057b51d 100644 --- a/src/core/cpu_core.cpp +++ b/src/core/cpu_core.cpp @@ -477,6 +477,10 @@ ALWAYS_INLINE_RELEASE static void ExecuteInstruction() LogInstruction(inst.bits, g_state.current_instruction_pc, &g_state.regs); #endif + // Skip nops. Makes PGXP-CPU quicker, but also the regular interpreter. + if (inst.bits == 0) + return; + switch (inst.op) { case InstructionOp::funct: