From f1235be4624cdffc1375d289fb06685c2a5d458d Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Mon, 13 May 2024 09:46:41 -0700 Subject: [PATCH] [a64] Fix `ATOMIC_COMPARE_EXCHANGE_I32` comparison type This fixes 32-bit atomic-compare-exchanges. The upper-half of the input register _must_ be clipped off. This fixes a deadlock in some games. --- src/xenia/cpu/backend/a64/a64_seq_memory.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xenia/cpu/backend/a64/a64_seq_memory.cc b/src/xenia/cpu/backend/a64/a64_seq_memory.cc index e9c64f10a..c7ed1a654 100644 --- a/src/xenia/cpu/backend/a64/a64_seq_memory.cc +++ b/src/xenia/cpu/backend/a64/a64_seq_memory.cc @@ -190,7 +190,7 @@ struct ATOMIC_COMPARE_EXCHANGE_I32 // Emulate the 4 KB physical address offset in 0xE0000000+ when can't do // it via memory mapping. e.MOV(W3, 0xE0000000); - e.CMP(i.src1.reg(), X3); + e.CMP(i.src1.reg().toW(), W3); e.CSET(W1, Cond::HS); e.LSL(W1, W1, 12); e.ADD(W1, W1, i.src1.reg().toW());