In corlib/System.Runtime.InteropServices:
[mono.git] / mono / mini / regalloc.h
1
2 typedef size_t regmask_t;
3
4 enum {
5         MONO_REG_FREE,
6         MONO_REG_FREEABLE,
7         MONO_REG_MOVEABLE,
8         MONO_REG_BUSY,
9         MONO_REG_RESERVED
10 };
11
12 enum {
13         MONO_REG_INT,
14         MONO_REG_DOUBLE
15 };
16
17 typedef struct {
18         /* symbolic registers */
19         int next_vreg;
20
21         /* hard registers */
22         int num_iregs;
23         int num_fregs;
24
25         regmask_t ifree_mask;
26         regmask_t ffree_mask;
27
28         /* symbolic -> hard register assignment */
29         /* 
30          * If the register is spilled, then this contains -spill - 1, where 'spill'
31          * is the index of the spill variable.
32          */
33         int *vassign;
34
35         /* hard -> symbolic */
36         int isymbolic [MONO_MAX_IREGS];
37         int fsymbolic [MONO_MAX_FREGS];
38
39         int ispills;
40
41         int vassign_size;
42 } MonoRegState;
43
44 #define mono_regstate_next_int(rs)   ((rs)->next_vreg++)
45 #define mono_regstate_next_float(rs) ((rs)->next_vreg++)
46
47
48 MonoRegState* mono_regstate_new (void) MONO_INTERNAL;
49
50 void          mono_regstate_free      (MonoRegState *rs) MONO_INTERNAL;
51 void          mono_regstate_reset     (MonoRegState *rs) MONO_INTERNAL;
52 inline int    mono_regstate_next_long (MonoRegState *rs) MONO_INTERNAL;
53