Revert "SPU LLVM: Remove dead interpreter ret fallback"

This reverts commit 3058a71d72.
This commit is contained in:
Malcolm 2026-05-28 19:35:47 -04:00 committed by Megamouse
parent 3058a71d72
commit c11979d124

View File

@ -3912,23 +3912,20 @@ public:
} }
else if (!(itype & spu_itype::branch)) 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 #ifdef ARCH_X64
m_ir->CreateCall(InlineAsm::get(get_ftype<void>(), "ret", "", true, false, InlineAsm::AD_Intel)); m_ir->CreateCall(InlineAsm::get(get_ftype<void>(), "ret", "", true, false, InlineAsm::AD_Intel));
#else #else
m_ir->CreateCall(InlineAsm::get(get_ftype<void>(), "ret", "", true, false)); m_ir->CreateCall(InlineAsm::get(get_ftype<void>(), "ret", "", true, false));
#endif #endif
m_ir->CreateUnreachable(); fret = ret_func;
} }
if (!m_ir->GetInsertBlock()->getTerminator()) const auto arg3 = UndefValue::get(get_type<u32>());
{ 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});
const auto arg3 = UndefValue::get(get_type<u32>()); _ret->setCallingConv(CallingConv::GHC);
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->setTailCall();
_ret->setCallingConv(CallingConv::GHC); m_ir->CreateRetVoid();
_ret->setTailCall();
m_ir->CreateRetVoid();
}
} }
if (!m_ir->GetInsertBlock()->getTerminator()) if (!m_ir->GetInsertBlock()->getTerminator())