SPU: return some give-up behaviour for PUTLLC (TSX)

Despite using concept of "shared" lock, allow only first to proceed.
This is similar how conditional stores for PPU are implemented.
This commit is contained in:
Nekotekina 2020-10-15 23:27:26 +03:00
parent 492ed27495
commit 583ed61712
2 changed files with 6 additions and 6 deletions

View File

@ -1318,9 +1318,8 @@ const auto ppu_stcx_accurate_tx = build_function_asm<u32(*)(u32 raddr, u64 rtime
Label tx0 = build_transaction_enter(c, fall, x86::r12, 4); Label tx0 = build_transaction_enter(c, fall, x86::r12, 4);
c.xbegin(tx0); c.xbegin(tx0);
c.mov(x86::rax, x86::qword_ptr(x86::rbx)); c.mov(x86::rax, x86::qword_ptr(x86::rbx));
c.test(x86::eax, vm::rsrv_unique_lock); c.test(x86::eax, 127);
c.jnz(skip); c.jnz(skip);
c.and_(x86::rax, -128);
c.cmp(x86::rax, x86::r13); c.cmp(x86::rax, x86::r13);
c.jne(fail); c.jne(fail);
@ -1395,7 +1394,8 @@ const auto ppu_stcx_accurate_tx = build_function_asm<u32(*)(u32 raddr, u64 rtime
c.lock().xadd(x86::qword_ptr(x86::rbx), x86::rax); c.lock().xadd(x86::qword_ptr(x86::rbx), x86::rax);
c.test(x86::eax, vm::rsrv_unique_lock); c.test(x86::eax, vm::rsrv_unique_lock);
c.jnz(fail3); c.jnz(fail3);
c.and_(x86::rax, -128);
// Allow only first shared lock to proceed
c.cmp(x86::rax, x86::r13); c.cmp(x86::rax, x86::r13);
c.jne(fail2); c.jne(fail2);

View File

@ -396,9 +396,8 @@ const auto spu_putllc_tx = build_function_asm<u32(*)(u32 raddr, u64 rtime, const
Label tx0 = build_transaction_enter(c, fall, x86::r12, 4); Label tx0 = build_transaction_enter(c, fall, x86::r12, 4);
c.xbegin(tx0); c.xbegin(tx0);
c.mov(x86::rax, x86::qword_ptr(x86::rbx)); c.mov(x86::rax, x86::qword_ptr(x86::rbx));
c.test(x86::eax, vm::rsrv_unique_lock); c.test(x86::eax, 127);
c.jnz(skip); c.jnz(skip);
c.and_(x86::rax, -128);
c.cmp(x86::rax, x86::r13); c.cmp(x86::rax, x86::r13);
c.jne(fail); c.jne(fail);
@ -488,7 +487,8 @@ const auto spu_putllc_tx = build_function_asm<u32(*)(u32 raddr, u64 rtime, const
c.lock().xadd(x86::qword_ptr(x86::rbx), x86::rax); c.lock().xadd(x86::qword_ptr(x86::rbx), x86::rax);
c.test(x86::eax, vm::rsrv_unique_lock); c.test(x86::eax, vm::rsrv_unique_lock);
c.jnz(fail3); c.jnz(fail3);
c.and_(x86::rax, -128);
// Allow only first shared lock to proceed
c.cmp(x86::rax, x86::r13); c.cmp(x86::rax, x86::r13);
c.jne(fail2); c.jne(fail2);