1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 03:02:53 +01:00

PPU: Use optimized reservation waiting for reservation load (non-TSX)

This commit is contained in:
Eladash 2020-05-13 15:13:45 +03:00 committed by Ivan
parent 118bfbbe98
commit 5c4c8f4539

View File

@ -1063,20 +1063,6 @@ static T ppu_load_acquire_reservation(ppu_thread& ppu, u32 addr)
}
}
ppu.rtime = vm::reservation_acquire(addr, sizeof(T));
if ((ppu.rtime & 127) == 0) [[likely]]
{
ppu.rdata = data;
if (vm::reservation_acquire(addr, sizeof(T)) == ppu.rtime) [[likely]]
{
return static_cast<T>(ppu.rdata << data_off >> size_off);
}
}
vm::passive_unlock(ppu);
for (u64 i = 0;; i++)
{
ppu.rtime = vm::reservation_acquire(addr, sizeof(T));
@ -1091,7 +1077,11 @@ static T ppu_load_acquire_reservation(ppu_thread& ppu, u32 addr)
}
}
if (i < 20)
if (ppu.state)
{
ppu.check_state();
}
else if (i < 20)
{
busy_wait(300);
}
@ -1101,7 +1091,6 @@ static T ppu_load_acquire_reservation(ppu_thread& ppu, u32 addr)
}
}
vm::passive_lock(ppu);
return static_cast<T>(ppu.rdata << data_off >> size_off);
}