mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-03 07:52:31 +00:00
Set CF correctly on BLSMSK patch
This commit is contained in:
parent
afcdd26948
commit
b7fea22c7d
@ -323,9 +323,26 @@ static void GenerateBLSMSK(const ZydisDecodedOperand* operands, Xbyak::CodeGener
|
|||||||
|
|
||||||
SaveRegisters(c, {scratch});
|
SaveRegisters(c, {scratch});
|
||||||
|
|
||||||
|
Xbyak::Label set_carry, clear_carry, end;
|
||||||
|
|
||||||
|
// BLSMSK sets CF to zero if source is NOT zero, otherwise it sets CF to one.
|
||||||
c.mov(scratch, *src);
|
c.mov(scratch, *src);
|
||||||
|
c.test(scratch, scratch);
|
||||||
|
c.jz(set_carry);
|
||||||
|
c.jmp(clear_carry);
|
||||||
|
|
||||||
|
c.L(set_carry);
|
||||||
c.dec(scratch);
|
c.dec(scratch);
|
||||||
c.xor_(scratch, *src);
|
c.xor_(scratch, *src);
|
||||||
|
c.stc();
|
||||||
|
c.jmp(end);
|
||||||
|
|
||||||
|
c.L(clear_carry);
|
||||||
|
c.dec(scratch);
|
||||||
|
c.xor_(scratch, *src);
|
||||||
|
// We don't need to clear carry here since XOR does that for us
|
||||||
|
|
||||||
|
c.L(end);
|
||||||
c.mov(dst, scratch);
|
c.mov(dst, scratch);
|
||||||
|
|
||||||
RestoreRegisters(c, {scratch});
|
RestoreRegisters(c, {scratch});
|
||||||
|
Loading…
Reference in New Issue
Block a user