From 77bb01d3843e02b614b486ddef7e0849703b325a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 22 May 2025 13:53:31 -0400 Subject: [PATCH] OpcodeDispatcher: don't generate pointless Xor for AF Signed-off-by: Alyssa Rosenzweig --- FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp index b66827331..2351455df 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Flags.cpp @@ -247,7 +247,7 @@ void OpDispatchBuilder::CalculateAF(Ref Src1, Ref Src2) { // We store the XOR of the arguments. At read time, we XOR with the // appropriate bit of the result (available as the PF flag) and extract the // appropriate bit. Again 64-bit to avoid masking. - Ref XorRes = _Xor(OpSize::i64Bit, Src1, Src2); + Ref XorRes = Src1 == Src2 ? _Constant(0) : _Xor(OpSize::i64Bit, Src1, Src2); SetRFLAG(XorRes); }