diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index b84a070e2..e0e499b9e 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -2768,6 +2768,10 @@ void OpDispatchBuilder::BTOp(OpcodeArgs) { Value = _Lshr(IR::SizeToOpSize(LshrSize), Value, BitSelect); } + // OF/SF/ZF/AF/PF undefined. + // Set CF before the action to save a move. + SetRFLAG(Value, ConstantShift, true); + switch (Action) { case BTAction::BTNone: { /* Nothing to do */ @@ -2869,10 +2873,10 @@ void OpDispatchBuilder::BTOp(OpcodeArgs) { // Now shift in to the correct bit location Value = _Lshr(IR::SizeToOpSize(std::max(4u, GetOpSize(Value))), Value, BitSelect); - } - // OF/SF/ZF/AF/PF undefined. - SetRFLAG(Value, ConstantShift, true); + // OF/SF/ZF/AF/PF undefined. + SetRFLAG(Value, ConstantShift, true); + } } void OpDispatchBuilder::IMUL1SrcOp(OpcodeArgs) {