summaryrefslogtreecommitdiff
path: root/includes/compiler/RegisterInfo.h
blob: d8a263acbcfa60c6281417ec5db7a1b4d1b4a5d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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(RegClass rclass, short reg);
extern void retain_register(Object *obj, RegClass rclass, short reg);
extern void retain_GPR_pair(Object *obj, short reg, short regHi);
extern int is_register_object(Object *obj);
extern int GetABIFirstNonVolatile(RegClass rclass);
extern char GetRegisterClassName(RegClass 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(RegClass rclass);
extern void reset_nonvolatile_registers(RegClass rclass);
extern int is_nonvolatile_register(RegClass 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