This commit is contained in:
lizzie 2026-04-27 23:52:48 +00:00
parent 4e87268295
commit ceaa2f8a54

View file

@ -59,9 +59,9 @@ void EmitSpinLockLock(Xbyak::CodeGenerator& code, Xbyak::Address ptr, Xbyak::Reg
code.mov(tmp, 1); code.mov(tmp, 1);
if (ptr.is64bitDisp()) { if (ptr.is64bitDisp()) {
// if tmp is on eax, use ebx, otherwise use eax! // if tmp is on eax, use ebx, otherwise use eax!
auto const other_tmp = tmp == Xbyak::util::eax auto const other_tmp = tmp.cvt32() == Xbyak::util::eax
? Xbyak::util::ebx ? Xbyak::util::rbx
: Xbyak::util::eax; : Xbyak::util::rax;
code.push(other_tmp); code.push(other_tmp);
code.mov(other_tmp, ptr.getDisp()); code.mov(other_tmp, ptr.getDisp());
/*code.lock();*/ code.xchg(other_tmp, tmp); /*code.lock();*/ code.xchg(other_tmp, tmp);
@ -80,9 +80,9 @@ void EmitSpinLockLock(Xbyak::CodeGenerator& code, Xbyak::Address ptr, Xbyak::Reg
code.mov(tmp, 1); code.mov(tmp, 1);
if (ptr.is64bitDisp()) { if (ptr.is64bitDisp()) {
// if tmp is on eax, use ebx, otherwise use eax! // if tmp is on eax, use ebx, otherwise use eax!
auto const other_tmp = tmp == Xbyak::util::eax auto const other_tmp = tmp.cvt32() == Xbyak::util::eax
? Xbyak::util::ebx ? Xbyak::util::rbx
: Xbyak::util::eax; : Xbyak::util::rax;
code.push(other_tmp); code.push(other_tmp);
code.mov(other_tmp, ptr.getDisp()); code.mov(other_tmp, ptr.getDisp());
/*code.lock();*/ code.xchg(other_tmp, tmp); /*code.lock();*/ code.xchg(other_tmp, tmp);