From 6d83c9cc0ea54d5e907f13bc8b9fa9d31b03271a Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 9 Oct 2020 17:39:27 +0300 Subject: [PATCH] PPU: remove ppu_stcx_tx Very small transaction, benefit questionable. --- rpcs3/Emu/CPU/CPUThread.h | 1 - rpcs3/Emu/Cell/PPUThread.cpp | 64 ------------------------------------ 2 files changed, 65 deletions(-) diff --git a/rpcs3/Emu/CPU/CPUThread.h b/rpcs3/Emu/CPU/CPUThread.h index 0aebb8c345..853d967eec 100644 --- a/rpcs3/Emu/CPU/CPUThread.h +++ b/rpcs3/Emu/CPU/CPUThread.h @@ -12,7 +12,6 @@ enum class cpu_flag : u32 exit, // Irreversible exit wait, // Indicates waiting state, set by the thread itself pause, // Thread suspended by suspend_all technique - pause2, // Used by suspend_all internally suspend, // Thread suspended ret, // Callback return requested signal, // Thread received a signal (HLE) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 66a49f1340..ace1a88ce3 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -1211,56 +1211,6 @@ extern u64 ppu_ldarx(ppu_thread& ppu, u32 addr) return ppu_load_acquire_reservation(ppu, addr); } -const auto ppu_stcx_tx = build_function_asm([](asmjit::X86Assembler& c, auto& args) -{ - using namespace asmjit; - - Label fall = c.newLabel(); - Label fail = c.newLabel(); - Label fail2 = c.newLabel(); - - // Prepare registers - c.mov(x86::r10, imm_ptr(+vm::g_reservations)); - c.mov(x86::rax, imm_ptr(&vm::g_base_addr)); - c.mov(x86::r11, x86::qword_ptr(x86::rax)); - c.lea(x86::r11, x86::qword_ptr(x86::r11, args[0])); - c.and_(args[0].r32(), 0xff80); - c.shr(args[0].r32(), 1); - c.lea(x86::r10, x86::qword_ptr(x86::r10, args[0])); - c.xor_(args[0].r32(), args[0].r32()); - c.bswap(args[2]); - c.bswap(args[3]); - - // Begin transaction - build_transaction_enter(c, fall, args[0], 16); - c.mov(x86::rax, x86::qword_ptr(x86::r10)); - c.test(x86::eax, vm::rsrv_unique_lock); - c.jnz(fail2); - c.and_(x86::rax, -128); - c.cmp(x86::rax, args[1]); - c.jne(fail); - c.cmp(x86::qword_ptr(x86::r11), args[2]); - c.jne(fail); - c.mov(x86::qword_ptr(x86::r11), args[3]); - c.sub(x86::qword_ptr(x86::r10), -128); - c.xend(); - c.mov(x86::eax, 1); - c.ret(); - - // Return 2 after transaction failure - c.bind(fall); - c.sar(x86::eax, 24); - c.js(fail); - c.bind(fail2); - c.mov(x86::eax, 2); - c.ret(); - - c.bind(fail); - build_transaction_abort(c, 0xff); - c.xor_(x86::eax, x86::eax); - c.ret(); -}); - const auto ppu_stcx_accurate_tx = build_function_asm([](asmjit::X86Assembler& c, auto& args) { using namespace asmjit; @@ -1679,20 +1629,6 @@ static bool ppu_store_reservation(ppu_thread& ppu, u32 addr, u64 reg_value) if (g_use_rtm) [[likely]] { - switch (ppu_stcx_tx(addr, rtime, old_data, reg_value)) - { - case 0: - { - // Reservation lost - return false; - } - case 1: - { - return true; - } - default: break; - } - if (res.fetch_add(1) & vm::rsrv_unique_lock) { res -= 1;