mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 21:41:26 +12:00
RawSpu: Optimize START register/commands
START MFC proxy commands can be common even after their need, optimize their usage.
This commit is contained in:
parent
c70c08bb07
commit
af052b0627
1 changed files with 19 additions and 9 deletions
|
@ -7,20 +7,30 @@
|
||||||
|
|
||||||
inline void try_start(spu_thread& spu)
|
inline void try_start(spu_thread& spu)
|
||||||
{
|
{
|
||||||
reader_lock lock(spu.run_ctrl_mtx);
|
bool notify = false;
|
||||||
|
|
||||||
if (spu.status_npc.fetch_op([](spu_thread::status_npc_sync_var& value)
|
if (~spu.status_npc.load().status & SPU_STATUS_RUNNING)
|
||||||
{
|
{
|
||||||
if (value.status & SPU_STATUS_RUNNING)
|
reader_lock lock(spu.run_ctrl_mtx);
|
||||||
|
|
||||||
|
if (spu.status_npc.fetch_op([](spu_thread::status_npc_sync_var& value)
|
||||||
{
|
{
|
||||||
return false;
|
if (value.status & SPU_STATUS_RUNNING)
|
||||||
}
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
value.status = SPU_STATUS_RUNNING | (value.status & SPU_STATUS_IS_ISOLATED);
|
value.status = SPU_STATUS_RUNNING | (value.status & SPU_STATUS_IS_ISOLATED);
|
||||||
return true;
|
return true;
|
||||||
}).second)
|
}).second)
|
||||||
|
{
|
||||||
|
spu.state -= cpu_flag::stop;
|
||||||
|
notify = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (notify)
|
||||||
{
|
{
|
||||||
spu.state -= cpu_flag::stop;
|
|
||||||
spu.state.notify_one();
|
spu.state.notify_one();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue