diff options
author | Ash Wolf <ninji@wuffs.org> | 2022-11-20 00:07:22 -0500 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2022-11-20 00:07:22 -0500 |
commit | 9d2728a5605f651934fe67a6fe6986b3e4a2c011 (patch) | |
tree | e81e0a3588a0c8d1855bf28316efe27d86b04d66 /includes/compiler/RegisterInfo.h | |
parent | 9a46dd0e2e80790d9848c0bbd718932a27c23269 (diff) | |
download | MWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.tar.gz MWCC-9d2728a5605f651934fe67a6fe6986b3e4a2c011.zip |
add a bunch of code and a ton of stub files for later
Diffstat (limited to '')
-rw-r--r-- | includes/compiler/RegisterInfo.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/includes/compiler/RegisterInfo.h b/includes/compiler/RegisterInfo.h new file mode 100644 index 0000000..2ef2a82 --- /dev/null +++ b/includes/compiler/RegisterInfo.h @@ -0,0 +1,42 @@ +#ifndef COMPILER_REGISTERINFO_H +#define COMPILER_REGISTERINFO_H + +#include "compiler/common.h" +#include "compiler/Registers.h" + +extern short last_exception_register[RegClassMax]; +extern short first_fe_temporary_register[RegClassMax]; +extern short last_argument_register[RegClassMax]; +extern short _FP_; +extern short _CALLER_SP_; +extern char *special_register_names[RegClassMax][RegisterMax]; +extern short spr_to_sysreg[4]; + +extern void asm_used_register(char rclass, short reg); +extern void retain_register(Object *obj, char rclass, short reg); +extern void retain_GPR_pair(Object *obj, short reg, short regHi); +extern int is_register_object(Object *obj); +extern int GetABIFirstNonVolatile(char rclass); +extern char GetRegisterClassName(char rclass); +extern void setup_diagnostic_reg_strings(void); +extern void init_target_registers(void); +extern void assign_register_by_type(Object *obj); +extern void assign_GPR_pair(Object *obj); +extern void open_fe_temp_registers(void); +extern void set_last_exception_registers(void); +extern VarInfo *Registers_GetVarInfo(Object *obj); +extern int used_vrstate_VRs(void); +extern UInt32 colored_vrs_as_vrsave(PCodeBlock *block); +extern void save_before_coloring_nonvolatile_registers(char rclass); +extern void reset_nonvolatile_registers(char rclass); +extern int is_nonvolatile_register(char rclass, int reg); +extern void init_endian(void); +extern void update_asm_nonvolatile_registers(void); + +#define OBJECT_REG(obj) ( Registers_GetVarInfo((obj)) ? (Registers_GetVarInfo((obj))->reg) : 0 ) +#define OBJECT_REG_HI(obj) ( Registers_GetVarInfo((obj)) ? (Registers_GetVarInfo((obj))->regHi) : 0 ) +#define ALLOC_GPR() (used_virtual_registers[RegClass_GPR]++) +#define ALLOC_FPR() (used_virtual_registers[RegClass_FPR]++) +#define ALLOC_VR() (used_virtual_registers[RegClass_VR]++) + +#endif |