PPU: minor improvement for LWARX/LDARX

Improve chances of loading actual data in memory.
This commit is contained in:
Nekotekina 2020-10-11 17:13:32 +03:00
parent f2d2a6b605
commit 2f329cf7b5

View file

@ -1197,14 +1197,18 @@ static T ppu_load_acquire_reservation(ppu_thread& ppu, u32 addr)
if (!ppu.use_full_rdata)
{
if (ppu.rtime & vm::rsrv_shared_mask)
{
// Let the ongoing operation some tiny time to complete
busy_wait(100);
ppu.rtime &= ~vm::rsrv_shared_mask;
}
if (data.load() != rdata)
{
continue;
}
// Clear some possible lock bits which are permitted
ppu.rtime &= -128;
// Store only 64 bits of reservation data
std::memcpy(&ppu.rdata[addr & 0x78], &rdata, 8);
}