From 388d49db80c5e3e7a6c90b5b07dcf53b3d848a9a Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Wed, 13 Mar 2019 20:52:34 +0300 Subject: [PATCH] SPU LLVM: fix SPU MMIO in TSX mode --- rpcs3/Emu/Cell/SPURecompiler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 91a04f21e9..ba2373efcc 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -3710,6 +3710,15 @@ public: m_ir->CreateCondBr(cond, exec, fail); m_ir->SetInsertPoint(exec); + const auto mmio = llvm::BasicBlock::Create(m_context, "", m_function); + const auto copy = llvm::BasicBlock::Create(m_context, "", m_function); + m_ir->CreateCondBr(m_ir->CreateICmpUGE(eal.value, m_ir->getInt32(0xe0000000)), mmio, copy); + m_ir->SetInsertPoint(mmio); + m_ir->CreateStore(ci, spu_ptr(&spu_thread::ch_mfc_cmd, &spu_mfc_cmd::cmd)); + call(&exec_mfc_cmd, m_thread); + m_ir->CreateBr(next); + m_ir->SetInsertPoint(copy); + llvm::Type* vtype = get_type(); switch (csize)