File: regalloc.h

package info (click to toggle)
mono 4.6.2.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 778,148 kB
  • ctags: 914,052
  • sloc: cs: 5,779,509; xml: 2,773,713; ansic: 432,645; sh: 14,749; makefile: 12,361; perl: 2,488; python: 1,434; cpp: 849; asm: 531; sql: 95; sed: 16; php: 1
file content (52 lines) | stat: -rw-r--r-- 1,108 bytes parent folder | download
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
43
44
45
46
47
48
49
50
51
52
#if defined(__native_client__) && defined(__x86_64__)
typedef guint64 regmask_t;
#else
typedef size_t regmask_t;
#endif

enum {
	MONO_REG_INT,
	MONO_REG_DOUBLE,
	/* This is used only for allocating spill slots with GC tracking */
	MONO_REG_INT_REF,
	/* Ditto for managed pointers */
	MONO_REG_INT_MP,
	MONO_REG_SIMD
};

 
#ifdef MONO_ARCH_NEED_SIMD_BANK
#define MONO_NUM_REGBANKS 5
#else
#define MONO_NUM_REGBANKS 4
#endif

typedef struct {
	/* symbolic registers */
	int next_vreg;

	regmask_t ifree_mask;
	regmask_t free_mask [MONO_NUM_REGBANKS];

	/* symbolic -> hard register assignment */
	/* 
	 * If the register is spilled, then this contains -spill - 1, where 'spill'
	 * is the index of the spill variable.
	 */
	gint32 *vassign;

	/* hard -> symbolic */
	int isymbolic [MONO_MAX_IREGS];
	int fsymbolic [MONO_MAX_FREGS];
#ifdef MONO_ARCH_NEED_SIMD_BANK
	int xsymbolic [MONO_MAX_XREGS];
#endif
	/* Points to the arrays above */
	int *symbolic [MONO_NUM_REGBANKS];

	int vassign_size;
} MonoRegState;

MonoRegState* mono_regstate_new (void);

void          mono_regstate_free      (MonoRegState *rs);