From be5f8413cab0f650358c06933aa8a62a2e1eec8a Mon Sep 17 00:00:00 2001 From: Eladash Date: Thu, 5 May 2022 22:15:08 +0300 Subject: [PATCH] Avoid using PUTLLC in PUTLLUC if we know SPU LR has already been raised (#11940) --- rpcs3/Emu/Cell/SPUThread.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index 86fd827e75..7393c297a3 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -2918,13 +2918,14 @@ void spu_thread::do_putlluc(const spu_mfc_cmd& args) // Try to process PUTLLUC using PUTLLC when a reservation is active: // If it fails the reservation is cleared, LR event is set and we fallback to the main implementation // All of this is done atomically in PUTLLC - if (do_putllc(args)) + if (!(ch_events.load().events & SPU_EVENT_LR) && do_putllc(args)) { // Success, return as our job was done here return; } // Failure, fallback to the main implementation + raddr = 0; } do_cell_atomic_128_store(addr, _ptr(args.lsa & 0x3ff80)); @@ -3219,6 +3220,12 @@ bool spu_thread::process_mfc_cmd() u64 ntime; rsx::reservation_lock rsx_lock(addr, 128); + if (ch_events.load().events & SPU_EVENT_LR) + { + // There is no longer a need to concern about LR event if it has already been raised. + raddr = 0; + } + if (raddr) { // Save rdata from previous reservation