mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-16 16:21:02 +00:00
SPU LLVM: Postpone runtime worker threads init
They may not be active at all unless a ps3 application is booted.
This commit is contained in:
parent
e38b005a8b
commit
7c8be662c6
@ -4495,11 +4495,10 @@ struct spu_llvm_worker
|
|||||||
void operator()()
|
void operator()()
|
||||||
{
|
{
|
||||||
// SPU LLVM Recompiler instance
|
// SPU LLVM Recompiler instance
|
||||||
const auto compiler = spu_recompiler_base::make_llvm_recompiler();
|
std::unique_ptr<spu_recompiler_base> compiler;
|
||||||
compiler->init();
|
|
||||||
|
|
||||||
// Fake LS
|
// Fake LS
|
||||||
std::vector<be_t<u32>> ls(0x10000);
|
std::vector<be_t<u32>> ls;
|
||||||
|
|
||||||
bool set_relax_flag = false;
|
bool set_relax_flag = false;
|
||||||
|
|
||||||
@ -4542,6 +4541,15 @@ struct spu_llvm_worker
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!compiler)
|
||||||
|
{
|
||||||
|
// Postponed initialization
|
||||||
|
compiler = spu_recompiler_base::make_llvm_recompiler();
|
||||||
|
compiler->init();
|
||||||
|
|
||||||
|
ls.resize(SPU_LS_SIZE / sizeof(be_t<u32>));
|
||||||
|
}
|
||||||
|
|
||||||
if (!set_relax_flag)
|
if (!set_relax_flag)
|
||||||
{
|
{
|
||||||
spu_thread::g_spu_work_count++;
|
spu_thread::g_spu_work_count++;
|
||||||
@ -4624,6 +4632,17 @@ struct spu_llvm
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (!registered && thread_ctrl::state() != thread_state::aborting)
|
||||||
|
{
|
||||||
|
// Wait for the first SPU block before launching any thread
|
||||||
|
thread_ctrl::wait_on(utils::bless<atomic_t<u32>>(®istered)[1], 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thread_ctrl::state() == thread_state::aborting)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// To compile (hash -> item)
|
// To compile (hash -> item)
|
||||||
std::unordered_multimap<u64, spu_item*, value_hash<u64>> enqueued;
|
std::unordered_multimap<u64, spu_item*, value_hash<u64>> enqueued;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user