From fbc9029bc8834e592acc186143c3ed699b752279 Mon Sep 17 00:00:00 2001 From: lizzie Date: Fri, 15 May 2026 21:27:48 +0000 Subject: [PATCH] fs --- src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp b/src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp index a1ff3cd451..b828c96095 100644 --- a/src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp +++ b/src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp @@ -40,10 +40,15 @@ void EmitSpinLockLock(Xbyak::CodeGenerator& code, Xbyak::Address ptr, Xbyak::Reg // XBYAK BUG: code.umonitor(ptr); see issue #255 // replace once xbyak has been fixed - code.db(0xF3); - if (ptr.getIdx() >= 8) code.db(0x41); - code.db(0x0F); code.db(0xAE); - code.db(uint8_t((3 << 6) | ((6 & 7) << 3) | (ptr.getIdx() & 7))); + if (ptr.isREG()) { + code.db(0xF3); + if (ptr.getIdx() >= 8) code.db(0x41); + code.db(0x0F); code.db(0xAE); + code.db(uint8_t((3 << 6) | ((6 & 7) << 3) | (ptr.getIdx() & 7))); + } else { + code.mov(Xbyak::util::rax, ptr); + code.umonitor(Xbyak::util::rax); + } // tmp.bit[0] = 0: C0.1 | Slow Wakup | Better Savings // tmp.bit[0] = 1: C0.2 | Fast Wakup | Lesser Savings