mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-22 10:19:26 +00:00
PPU: Detect lwmutex reservation pattern and optimize it
This commit is contained in:
parent
82b1a2bd7a
commit
86702186f2
1 changed files with 9 additions and 1 deletions
|
@ -2639,8 +2639,16 @@ static bool ppu_store_reservation(ppu_thread& ppu, u32 addr, u64 reg_value)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}())
|
}())
|
||||||
|
{
|
||||||
|
// Test a common pattern in lwmutex
|
||||||
|
constexpr u64 mutex_free = u64{static_cast<u32>(0 - 1)} << 32;
|
||||||
|
const bool may_be_lwmutex_related = sizeof(T) == 8 ?
|
||||||
|
(new_data == mutex_free && old_data == u64{ppu.id} << 32) : (old_data == mutex_free && new_data == u64{ppu.id} << 32);
|
||||||
|
|
||||||
|
if (!may_be_lwmutex_related)
|
||||||
{
|
{
|
||||||
res.notify_all(-128);
|
res.notify_all(-128);
|
||||||
|
}
|
||||||
|
|
||||||
if (addr == ppu.last_faddr)
|
if (addr == ppu.last_faddr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue