mirror of
https://github.com/stenzek/duckstation.git
synced 2026-11-17 11:34:22 +01:00
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:
1 file changed
+5
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user