From d45fbf8d2e1adcb35043dfc9e06eae3ccfdf596e Mon Sep 17 00:00:00 2001 From: Peter Fors Date: Mon, 7 Apr 2025 19:47:27 +0200 Subject: cleanup and optimization tests, unfortunately nothing great. --- cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cpu.c') diff --git a/cpu.c b/cpu.c index 34d5bed..ec7b5ec 100644 --- a/cpu.c +++ b/cpu.c @@ -5,12 +5,12 @@ // REMOVE FOR NES!!!!! // #define ENABLE_DECIMAL_MODE -__attribute__((always_inline)) +__attribute__((hot, always_inline)) static inline uint8_t pack_flags(struct cpu_state *cpu) { return (cpu->n << 7) | (cpu->v << 6) | (1 << 5) | (cpu->d << 3) | (cpu->i << 2) | (cpu->z << 1) | cpu->c; } -__attribute__((always_inline)) +__attribute__((hot, always_inline)) static inline void unpack_flags(struct cpu_state *cpu, uint8_t value) { cpu->n = (value >> 7) & 1; cpu->v = (value >> 6) & 1; @@ -20,6 +20,7 @@ static inline void unpack_flags(struct cpu_state *cpu, uint8_t value) { cpu->c = value & 1; } +__attribute__((hot)) static inline void update_zn(struct cpu_state *cpu, uint8_t result) { cpu->z = (result == 0); cpu->n = (result & 0x80) != 0; -- cgit v1.2.3