Skip to content

Commit 3fd86a6

Browse files
committed
CPU/PGXP: Use component enum
1 parent e4bedbb commit 3fd86a6

File tree

2 files changed

+128
-108
lines changed

2 files changed

+128
-108
lines changed

src/core/cpu_core.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,13 @@ struct PGXP_value
5858
u32 value;
5959
u32 flags;
6060

61-
ALWAYS_INLINE void SetValidComp(u32 comp, bool valid)
61+
ALWAYS_INLINE void SetValid(u32 comp, bool valid = true)
6262
{
63-
flags = (flags & ~(1u << comp)) | (static_cast<u32>(valid) << comp);
63+
const u32 mask = (1u << comp);
64+
flags = valid ? (flags | mask) : (flags & ~mask);
6465
}
6566

66-
ALWAYS_INLINE bool GetValidComp(u32 comp) const { return ConvertToBoolUnchecked((flags >> comp) & 1); }
67+
ALWAYS_INLINE bool HasValid(u32 comp) const { return ConvertToBoolUnchecked((flags >> comp) & 1); }
6768
};
6869

6970
struct State

0 commit comments

Comments
 (0)