From 37dbbce194943cdcc6d1fc3dd94b1beff2c9adb2 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 27 Oct 2019 00:16:44 +0300 Subject: [PATCH] SPU LLVM: Enable "Giga table" in Mega mode Was previously only enabled in Giga mode. Also fill the table with branch patchpoints. --- rpcs3/Emu/Cell/SPURecompiler.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index f83bcf98bb..9e4b48a739 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -4637,6 +4637,18 @@ public: if (found == m_functions.end()) { + if (g_cfg.core.spu_verification) + { + const std::string ppname = fmt::format("%s-chunkpp-0x%05x", m_hash, i); + m_engine->addGlobalMapping(ppname, (u64)m_spurt->make_branch_patchpoint()); + + const auto ppfunc = llvm::cast(m_module->getOrInsertFunction(ppname, m_finfo->chunk->getFunctionType()).getCallee()); + ppfunc->setCallingConv(m_finfo->chunk->getCallingConv()); + + chunks.push_back(ppfunc); + continue; + } + chunks.push_back(m_dispatch); continue; } @@ -7843,7 +7855,7 @@ public: m_ir->SetInsertPoint(fail); } - if (g_cfg.core.spu_block_size == spu_block_size_type::giga) + if (g_cfg.core.spu_block_size >= spu_block_size_type::mega) { // Try to load chunk address from the function table const auto fail = llvm::BasicBlock::Create(m_context, "", m_function);