X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flightrec%2Flightrec-private.h;h=e67d406f2402c52ba528bd750468b9abb846c38a;hb=c94fde37a8664462e9f551662ad589f24cd06462;hp=56032f50001d12112b7814aeaf6ef8b66b5f948a;hpb=c0c1a5b0163ec977f5cc597a8732e0fce93203f7;p=pcsx_rearmed.git diff --git a/deps/lightrec/lightrec-private.h b/deps/lightrec/lightrec-private.h index 56032f50..e67d406f 100644 --- a/deps/lightrec/lightrec-private.h +++ b/deps/lightrec/lightrec-private.h @@ -81,6 +81,7 @@ #define REG_LO 32 #define REG_HI 33 +#define REG_CP2_TEMP (offsetof(struct lightrec_state, cp2_temp_reg) / sizeof(u32)) /* Definition of jit_state_t (avoids inclusion of ) */ struct jit_node; @@ -152,8 +153,9 @@ struct lightrec_cstate { struct lightrec_state { struct lightrec_registers regs; - uintptr_t wrapper_regs[NUM_TEMPS]; + u32 cp2_temp_reg; u32 next_pc; + uintptr_t wrapper_regs[NUM_TEMPS]; u32 current_cycle; u32 target_cycle; u32 exit_flags; @@ -188,9 +190,6 @@ void lightrec_free_block(struct lightrec_state *state, struct block *block); void remove_from_code_lut(struct blockcache *cache, struct block *block); -enum psx_map -lightrec_get_map_idx(struct lightrec_state *state, u32 kaddr); - const struct lightrec_mem_map * lightrec_get_map(struct lightrec_state *state, void **host, u32 kaddr); @@ -272,7 +271,7 @@ static inline u32 get_branch_pc(const struct block *block, u16 offset, s16 imm) return block->pc + (offset + imm << 2); } -void lightrec_mtc(struct lightrec_state *state, union code op, u32 data); +void lightrec_mtc(struct lightrec_state *state, union code op, u8 reg, u32 data); u32 lightrec_mfc(struct lightrec_state *state, union code op); void lightrec_rfe(struct lightrec_state *state); void lightrec_cp(struct lightrec_state *state, union code op); @@ -340,4 +339,14 @@ static inline u8 block_clear_flags(struct block *block, u8 mask) #endif } +static inline _Bool can_sign_extend(s32 value, u8 order) +{ + return (u32)(value >> order - 1) + 1 < 2; +} + +static inline _Bool can_zero_extend(u32 value, u8 order) +{ + return (value >> order) == 0; +} + #endif /* __LIGHTREC_PRIVATE_H__ */