mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-06 23:15:18 +00:00
CPU: improve cpu_thread::suspend_all for cache efficiency (TSX)
Add prefetch hint list parameter. Workloads may be executed by another thread on another CPU core. It means they may benefit from directly prefetching the data as hinted. Also implement mov_rdata_nt, for "streaming" data from such workloads.
This commit is contained in:
parent
e794109a67
commit
0da24f21d6
6 changed files with 132 additions and 32 deletions
|
|
@ -543,16 +543,18 @@ namespace vm
|
|||
|
||||
void reservation_op_internal(u32 addr, std::function<bool()> func)
|
||||
{
|
||||
cpu_thread::suspend_all(get_current_cpu_thread(), [&]
|
||||
auto& res = vm::reservation_acquire(addr, 128);
|
||||
|
||||
cpu_thread::suspend_all(get_current_cpu_thread(), {&res}, [&]
|
||||
{
|
||||
if (func())
|
||||
{
|
||||
// Success, release all locks if necessary
|
||||
vm::reservation_acquire(addr, 128) += 127;
|
||||
res += 127;
|
||||
}
|
||||
else
|
||||
{
|
||||
vm::reservation_acquire(addr, 128) -= 1;
|
||||
res -= 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue