From c11979d1245509478145da11d7fcbe4e8815dd15 Mon Sep 17 00:00:00 2001 From: Malcolm Date: Thu, 28 May 2026 19:35:47 -0400 Subject: [PATCH] Revert "SPU LLVM: Remove dead interpreter ret fallback" This reverts commit 3058a71d72fb9f20254b56420c8831f1818e567a. --- rpcs3/Emu/Cell/SPULLVMRecompiler.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp index ae33279632..5af63c4b90 100644 --- a/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp @@ -3912,23 +3912,20 @@ public: } else if (!(itype & spu_itype::branch)) { - // Inline ret exits the instruction helper directly. + // Hack: inline ret instruction before final jmp; this is not reliable. #ifdef ARCH_X64 m_ir->CreateCall(InlineAsm::get(get_ftype(), "ret", "", true, false, InlineAsm::AD_Intel)); #else m_ir->CreateCall(InlineAsm::get(get_ftype(), "ret", "", true, false)); #endif - m_ir->CreateUnreachable(); + fret = ret_func; } - if (!m_ir->GetInsertBlock()->getTerminator()) - { - const auto arg3 = UndefValue::get(get_type()); - const auto _ret = m_ir->CreateCall(if_type, fret, {m_lsptr, m_thread, m_interp_pc, arg3, m_interp_table, m_interp_7f0, m_interp_regs}); - _ret->setCallingConv(CallingConv::GHC); - _ret->setTailCall(); - m_ir->CreateRetVoid(); - } + const auto arg3 = UndefValue::get(get_type()); + const auto _ret = m_ir->CreateCall(if_type, fret, {m_lsptr, m_thread, m_interp_pc, arg3, m_interp_table, m_interp_7f0, m_interp_regs}); + _ret->setCallingConv(CallingConv::GHC); + _ret->setTailCall(); + m_ir->CreateRetVoid(); } if (!m_ir->GetInsertBlock()->getTerminator())