mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
Lightweight putllc() for non-TSX if no data changed
This replaces the totally messed up PR #6728 Some games make heavy use of getllar() & putllc() without even changing data. In this case avoid unneccesary heavy locking of the PPU threads on non-TSX hosts.
This commit is contained in:
parent
223d1473b0
commit
cd6b6c8a4f
1 changed files with 26 additions and 18 deletions
|
@ -1942,7 +1942,14 @@ bool spu_thread::process_mfc_cmd()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (auto& data = vm::_ref<decltype(rdata)>(addr); rtime == (vm::reservation_acquire(raddr, 128) & -128) && cmp_rdata(rdata, data))
|
||||
else if (auto& data = vm::_ref<decltype(rdata)>(addr); rtime == (vm::reservation_acquire(raddr, 128) & -128))
|
||||
{
|
||||
if (cmp_rdata(rdata, to_write))
|
||||
{
|
||||
// Writeback of unchanged data. Only check memory change
|
||||
result = cmp_rdata(rdata, data) && vm::reservation_acquire(raddr, 128).compare_and_swap_test(rtime, rtime + 128);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto& res = vm::reservation_lock(raddr, 128);
|
||||
const u64 old_time = res.load() & -128;
|
||||
|
@ -1972,6 +1979,7 @@ bool spu_thread::process_mfc_cmd()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue