GTE: Simplify FLAG error bit update

The error bit is always clear when it is computed, since FLAG is either
reset at the start of the instruction, or masked when the guest writes
it. So it can be ORed in, instead of being cleared and reinserted.
This commit is contained in:
Stenzek committed 2026-10-13 15:21:24 +10:00
1 parent 79161b0976
commit 5b3bcf139d
1 file changed
+5 -2
+5 -2
View File
@@ -44,8 +44,11 @@ union FLAGS
ALWAYS_INLINE void Clear() { bits = 0; }
// Bits 30..23, 18..13 OR'ed
ALWAYS_INLINE void UpdateError() { error = (bits & UINT32_C(0x7F87E000)) != UINT32_C(0); }
// Bits 30..23, 18..13 OR'ed. The error bit must not be set beforehand, i.e. after Clear(), or masking guest writes.
ALWAYS_INLINE void UpdateError()
{
bits |= ((bits & UINT32_C(0x7F87E000)) != UINT32_C(0)) ? UINT32_C(0x80000000) : UINT32_C(0);
}
};
union Regs