SPU: optimize conflicting PUTLLUC (No-TSX)

Enable previously TSX-only optimization.
This commit is contained in:
Nekotekina 2022-05-05 12:55:17 +03:00 committed by Ivan
parent 2706486559
commit 10b33d0f79

View File

@ -2795,7 +2795,6 @@ void do_cell_atomic_128_store(u32 addr, const void* to_write)
shared_mem = addr;
}
if (g_use_rtm) [[likely]]
{
auto& sdata = *vm::get_super_ptr<spu_rdata_t>(addr);
auto& res = *utils::bless<atomic_t<u128>>(vm::g_reservations + (addr & 0xff80) / 2);
@ -2861,12 +2860,22 @@ void do_cell_atomic_128_store(u32 addr, const void* to_write)
}
}
u64 result = 0;
u64 result = 1;
if (cpu->state & cpu_flag::pause)
{
result = 0;
}
else if (!g_use_rtm)
{
// Provoke page fault
vm::_ref<atomic_t<u32>>(addr) += 0;
// Hard lock
vm::writer_lock lock(addr);
mov_rdata(sdata, *static_cast<const spu_rdata_t*>(to_write));
vm::reservation_acquire(addr) += 32;
}
else if (cpu->id_type() != 2)
{
u64 stx, ftx;
@ -2896,22 +2905,6 @@ void do_cell_atomic_128_store(u32 addr, const void* to_write)
static_cast<void>(cpu->test_stopped());
}
else
{
auto& data = vm::_ref<spu_rdata_t>(addr);
auto [res, time0] = vm::reservation_lock(addr);
*reinterpret_cast<atomic_t<u32>*>(&data) += 0;
auto& super_data = *vm::get_super_ptr<spu_rdata_t>(addr);
{
// Full lock (heavyweight)
// TODO: vm::check_addr
vm::writer_lock lock(addr);
mov_rdata(super_data, *static_cast<const spu_rdata_t*>(to_write));
res += 64;
}
}
}
void spu_thread::do_putlluc(const spu_mfc_cmd& args)