From f30b81f8b0b3f4fb257adac25a35f54d87650268 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 17 Nov 2019 22:07:08 +0300 Subject: [PATCH] SPU LLVM: change patchpoint name generation Allow 2 or more patchpoint from a single address. --- rpcs3/Emu/Cell/SPURecompiler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 9e83fa0e5a..f430058b07 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -3230,6 +3230,9 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator // Module name std::string m_hash; + // Patchpoint unique id + u32 m_pp_id = 0; + // Current function (chunk) llvm::Function* m_function; @@ -3403,7 +3406,7 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator verify(HERE), m_finfo, !m_finfo->fn || m_function == m_finfo->chunk; // Register under a unique linkable name - const std::string ppname = fmt::format("%s-pp-0x%05x", m_hash, m_pos); + const std::string ppname = fmt::format("%s-pp-%u", m_hash, m_pp_id++); m_engine->addGlobalMapping(ppname, (u64)m_spurt->make_branch_patchpoint()); // Create function with not exactly correct type @@ -4219,6 +4222,8 @@ public: const u32 start = m_pos; const u32 end = start + m_size; + m_pp_id = 0; + if (g_cfg.core.spu_debug && !add_loc->logged.exchange(1)) { this->dump(func, log);