Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix preformance regression on TSX path #8114

Merged
merged 1 commit into from
Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 2 additions & 13 deletions rpcs3/Emu/Cell/PPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,21 +1045,10 @@ static T ppu_load_acquire_reservation(ppu_thread& ppu, u32 addr)
}
}())
{
ppu.rtime = vm::reservation_acquire(addr, sizeof(T));

if (ppu.rtime & 127)
{
if (!(ppu.state & cpu_flag::wait))
{
ppu.state += cpu_flag::wait;
}

continue;
}

ppu.rtime = vm::reservation_acquire(addr, sizeof(T)) & -128;
ppu.rdata = data;

if (vm::reservation_acquire(addr, sizeof(T)) == ppu.rtime) [[likely]]
if ((vm::reservation_acquire(addr, sizeof(T)) & -128) == ppu.rtime) [[likely]]
{
ppu.test_stopped();

Expand Down
6 changes: 3 additions & 3 deletions rpcs3/Emu/Cell/SPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1784,9 +1784,9 @@ bool spu_thread::process_mfc_cmd()

for (u64 i = 0;; [&]()
{
if (ntime & 127 && g_use_rtm && !(state & cpu_flag::wait))
if (is_paused())
{
state += cpu_flag::wait;
check_state();
}

if (++i < 25) [[likely]]
Expand All @@ -1813,7 +1813,7 @@ bool spu_thread::process_mfc_cmd()
ntime != time0)
{
// Reservation data has been modified recently
if (time0 & 127) i += 12, ntime = time0;
if (time0 & 127) i += 12;
continue;
}

Expand Down