X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fregalloc.h;h=f043ddd6d55402ab6a17fb6d5d48293693da53af;hb=cb4dfb5d9803365b73db03e34dc9900301b19a80;hp=55cacbf81356d13b3d938195aefa7281829b13a6;hpb=3e72c88756028649ee13ffb426a52886982f23c1;p=mono.git diff --git a/mono/mini/regalloc.h b/mono/mini/regalloc.h index 55cacbf8135..f043ddd6d55 100644 --- a/mono/mini/regalloc.h +++ b/mono/mini/regalloc.h @@ -1,54 +1,49 @@ -enum { - MONO_REG_FREE, - MONO_REG_FREEABLE, - MONO_REG_MOVEABLE, - MONO_REG_BUSY, - MONO_REG_RESERVED -}; +typedef size_t regmask_t; enum { MONO_REG_INT, - MONO_REG_DOUBLE + 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 }; -/* make this arch-dependent */ -#define MONO_MAX_IREGS 8 -#define MONO_MAX_FREGS 7 + +#ifdef MONO_ARCH_NEED_SIMD_BANK +#define MONO_NUM_REGBANKS 5 +#else +#define MONO_NUM_REGBANKS 4 +#endif typedef struct { /* symbolic registers */ - int next_vireg; - int next_vfreg; - - /* hard registers */ - int num_iregs; - int num_fregs; + int next_vreg; - guint32 ifree_mask; - guint32 ffree_mask; + regmask_t ifree_mask; + regmask_t free_mask [MONO_NUM_REGBANKS]; /* symbolic -> hard register assignment */ - char *iassign; - char *fassign; + /* + * 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 ispills; + int vassign_size; } MonoRegState; -#define mono_regstate_next_int(rs) ((rs)->next_vireg++) -#define mono_regstate_next_float(rs) ((rs)->next_vfreg++) - - -MonoRegState* mono_regstate_new (void); - -void mono_regstate_free (MonoRegState *rs); -void mono_regstate_reset (MonoRegState *rs); -void mono_regstate_assign (MonoRegState *rs); -int mono_regstate_alloc_int (MonoRegState *rs, guint32 allow); -void mono_regstate_free_int (MonoRegState *rs, int reg); -inline int mono_regstate_next_long (MonoRegState *rs); +MonoRegState* mono_regstate_new (void) MONO_INTERNAL; +void mono_regstate_free (MonoRegState *rs) MONO_INTERNAL;