mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
SPU LLVM: don't force-enter process_mfc_cmd() because it's slower
This commit is contained in:
parent
b01220d2c5
commit
2a00a88e2a
1 changed files with 11 additions and 5 deletions
|
@ -6629,17 +6629,19 @@ public:
|
||||||
|
|
||||||
if (auto ci = llvm::dyn_cast<llvm::ConstantInt>(trunc<u8>(val).eval(m_ir)))
|
if (auto ci = llvm::dyn_cast<llvm::ConstantInt>(trunc<u8>(val).eval(m_ir)))
|
||||||
{
|
{
|
||||||
if (g_cfg.core.spu_accurate_dma)
|
if (g_cfg.core.mfc_debug)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool must_use_cpp_functions = !!g_cfg.core.spu_accurate_dma;
|
||||||
|
|
||||||
if (u64 cmdh = ci->getZExtValue() & ~(MFC_BARRIER_MASK | MFC_FENCE_MASK | MFC_RESULT_MASK); g_cfg.core.rsx_fifo_accuracy || g_cfg.video.strict_rendering_mode || !g_use_rtm)
|
if (u64 cmdh = ci->getZExtValue() & ~(MFC_BARRIER_MASK | MFC_FENCE_MASK | MFC_RESULT_MASK); g_cfg.core.rsx_fifo_accuracy || g_cfg.video.strict_rendering_mode || !g_use_rtm)
|
||||||
{
|
{
|
||||||
// TODO: don't require TSX (current implementation is TSX-only)
|
// TODO: don't require TSX (current implementation is TSX-only)
|
||||||
if (cmdh == MFC_PUT_CMD || cmdh == MFC_SNDSIG_CMD)
|
if (cmdh == MFC_PUT_CMD || cmdh == MFC_SNDSIG_CMD)
|
||||||
{
|
{
|
||||||
break;
|
must_use_cpp_functions = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6739,12 +6741,16 @@ public:
|
||||||
m_ir->CreateCondBr(cond, exec, fail, m_md_likely);
|
m_ir->CreateCondBr(cond, exec, fail, m_md_likely);
|
||||||
m_ir->SetInsertPoint(exec);
|
m_ir->SetInsertPoint(exec);
|
||||||
|
|
||||||
const auto mmio = llvm::BasicBlock::Create(m_context, "", m_function);
|
|
||||||
const auto copy = llvm::BasicBlock::Create(m_context, "", m_function);
|
const auto copy = llvm::BasicBlock::Create(m_context, "", m_function);
|
||||||
|
|
||||||
// Always use interpreter function for MFC debug option
|
// Always use interpreter function for MFC debug option
|
||||||
m_ir->CreateCondBr(m_ir->CreateICmpUGE(eal.value, m_ir->getInt32(g_cfg.core.mfc_debug ? 0 : 0xe0000000)), mmio, copy, m_md_unlikely);
|
if (!must_use_cpp_functions)
|
||||||
m_ir->SetInsertPoint(mmio);
|
{
|
||||||
|
const auto mmio = llvm::BasicBlock::Create(m_context, "", m_function);
|
||||||
|
m_ir->CreateCondBr(m_ir->CreateICmpUGE(eal.value, m_ir->getInt32(0xe0000000)), mmio, copy, m_md_unlikely);
|
||||||
|
m_ir->SetInsertPoint(mmio);
|
||||||
|
}
|
||||||
|
|
||||||
m_ir->CreateStore(ci, spu_ptr<u8>(&spu_thread::ch_mfc_cmd, &spu_mfc_cmd::cmd));
|
m_ir->CreateStore(ci, spu_ptr<u8>(&spu_thread::ch_mfc_cmd, &spu_mfc_cmd::cmd));
|
||||||
call("spu_exec_mfc_cmd", &exec_mfc_cmd, m_thread);
|
call("spu_exec_mfc_cmd", &exec_mfc_cmd, m_thread);
|
||||||
m_ir->CreateBr(next);
|
m_ir->CreateBr(next);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue