mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 15:00:53 +02:00
OpcodeDispatcher: use SETF for INC
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
1 parent
72edee7c6f
commit
0ef0bb2c97
1 file changed
+17
-1
@@ -3544,7 +3544,23 @@ void OpDispatchBuilder::INCOp(OpcodeArgs) {
|
||||
}
|
||||
|
||||
CalculateDeferredFlags();
|
||||
Result = CalculateFlags_ADD(OpSizeFromSrc(Op), Dest, OneConst, false);
|
||||
|
||||
if (Size < 32 && CTX->HostFeatures.SupportsFlagM) {
|
||||
// Addition producing upper garbage
|
||||
Result = _Add(OpSize::i32Bit, Dest, OneConst);
|
||||
CalculatePF(Result);
|
||||
CalculateAF(Dest, OneConst);
|
||||
|
||||
// Correctly set NZ flags, preserving C
|
||||
HandleNZCV_RMW();
|
||||
_SetSmallNZV(OpSizeFromSrc(Op), Result);
|
||||
|
||||
// Fix up V flag. INC overflows only when incrementing a positive and
|
||||
// getting a negative. So compare the sign bits to calculate V.
|
||||
_RmifNZCV(_Andn(OpSize::i32Bit, Result, Dest), Size - 1, 1);
|
||||
} else {
|
||||
Result = CalculateFlags_ADD(OpSizeFromSrc(Op), Dest, OneConst, false);
|
||||
}
|
||||
|
||||
if (!IsLocked) {
|
||||
StoreResult(GPRClass, Op, Result, -1);
|
||||
|
||||
Reference in new issue
Block a user