From c727ac33c7866a0613ce1c3f3da51f3e87bbec2d Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 19 Oct 2023 21:38:56 +1000 Subject: [PATCH] CPU/CodeCache: Include hi/lo in state logging --- src/core/cpu_code_cache.cpp | 30 +++------------------- src/core/cpu_recompiler_code_generator.cpp | 2 +- src/core/cpu_recompiler_thunks.h | 2 -- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/src/core/cpu_code_cache.cpp b/src/core/cpu_code_cache.cpp index 8bf28e196..18b3b20ba 100644 --- a/src/core/cpu_code_cache.cpp +++ b/src/core/cpu_code_cache.cpp @@ -814,14 +814,13 @@ void CPU::CodeCache::LogCurrentState() const auto& regs = g_state.regs; WriteToExecutionLog( - "tick=%u dc=%u/%u pc=%08X at=%08X v0=%08X v1=%08X a0=%08X a1=%08X a2=%08X a3=%08X t0=%08X " - "t1=%08X t2=%08X t3=%08X t4=%08X t5=%08X t6=%08X t7=%08X s0=%08X s1=%08X s2=%08X s3=%08X s4=%08X " - "s5=%08X s6=%08X s7=%08X t8=%08X t9=%08X k0=%08X k1=%08X gp=%08X sp=%08X fp=%08X ra=%08X ldr=%s " - "ldv=%08X cause=%08X sr=%08X gte=%08X\n", + "tick=%u dc=%u/%u pc=%08X at=%08X v0=%08X v1=%08X a0=%08X a1=%08X a2=%08X a3=%08X t0=%08X t1=%08X t2=%08X t3=%08X " + "t4=%08X t5=%08X t6=%08X t7=%08X s0=%08X s1=%08X s2=%08X s3=%08X s4=%08X s5=%08X s6=%08X s7=%08X t8=%08X t9=%08X " + "k0=%08X k1=%08X gp=%08X sp=%08X fp=%08X ra=%08X hi=%08X lo=%08X ldr=%s ldv=%08X cause=%08X sr=%08X gte=%08X\n", TimingEvents::GetGlobalTickCounter() + GetPendingTicks(), g_state.pending_ticks, g_state.downcount, g_state.pc, regs.at, regs.v0, regs.v1, regs.a0, regs.a1, regs.a2, regs.a3, regs.t0, regs.t1, regs.t2, regs.t3, regs.t4, regs.t5, regs.t6, regs.t7, regs.s0, regs.s1, regs.s2, regs.s3, regs.s4, regs.s5, regs.s6, regs.s7, regs.t8, regs.t9, regs.k0, - regs.k1, regs.gp, regs.sp, regs.fp, regs.ra, + regs.k1, regs.gp, regs.sp, regs.fp, regs.ra, regs.hi, regs.lo, (g_state.next_load_delay_reg == Reg::count) ? "NONE" : GetRegName(g_state.next_load_delay_reg), (g_state.next_load_delay_reg == Reg::count) ? 0 : g_state.next_load_delay_value, g_state.cop0_regs.cause.bits, g_state.cop0_regs.sr.bits, static_cast(crc32(0, (const Bytef*)&g_state.gte_regs, sizeof(g_state.gte_regs)))); @@ -1587,25 +1586,4 @@ void CPU::CodeCache::BackpatchLoadStore(void* host_pc, const LoadstoreBackpatchI s_code_buffer.WriteProtect(true); } -#ifdef ENABLE_RECOMPILER - -void CPU::Recompiler::Thunks::LogPC(u32 pc) -{ -#if 0 - const u32 cyc = TimingEvents::GetGlobalTickCounter() + GetPendingTicks(); - s_last_cyc = cyc; - if (s_last_cyc == 3302138733) - __debugbreak(); -#endif -#if 0 - CPU::CodeCache::LogCurrentState(); -#endif -#if 0 - if (TimingEvents::GetGlobalTickCounter() + GetPendingTicks() == 181991709) - __debugbreak(); -#endif -} - -#endif // ENABLE_RECOMPILER - #endif // ENABLE_RECOMPILER_SUPPORT diff --git a/src/core/cpu_recompiler_code_generator.cpp b/src/core/cpu_recompiler_code_generator.cpp index 5c1a47658..880e47318 100644 --- a/src/core/cpu_recompiler_code_generator.cpp +++ b/src/core/cpu_recompiler_code_generator.cpp @@ -993,7 +993,7 @@ void CodeGenerator::BlockPrologue() } #if 0 - EmitFunctionCall(nullptr, &Thunks::LogPC, Value::FromConstantU32(m_pc)); + EmitFunctionCall(nullptr, &CodeCache::LogCurrentState); #endif if (m_block->uncached_fetch_ticks > 0 || m_block->icache_line_count > 0) diff --git a/src/core/cpu_recompiler_thunks.h b/src/core/cpu_recompiler_thunks.h index b29971f0f..e72b2b680 100644 --- a/src/core/cpu_recompiler_thunks.h +++ b/src/core/cpu_recompiler_thunks.h @@ -31,6 +31,4 @@ void UncheckedWriteMemoryByte(u32 address, u32 value); void UncheckedWriteMemoryHalfWord(u32 address, u32 value); void UncheckedWriteMemoryWord(u32 address, u32 value); -void LogPC(u32 pc); - } // namespace CPU::Recompiler::Thunks