X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fregalloc.h;h=e5d6ae6bdb82618cfa703fd77e2811170f68788e;hb=580ccb1ffb8e5c2e3fa0555e342d916764f42930;hp=abb062484264d35f9d446cceb19928d211247a57;hpb=987f8c63e214937c50dcb308149f7558a2cbba41;p=mono.git diff --git a/mono/mini/regalloc.h b/mono/mini/regalloc.h index abb06248426..e5d6ae6bdb8 100644 --- a/mono/mini/regalloc.h +++ b/mono/mini/regalloc.h @@ -1,61 +1,56 @@ +/** + * \file + */ +#if defined(__native_client__) && defined(__x86_64__) +typedef guint64 regmask_t; +#else typedef size_t regmask_t; - -enum { - MONO_REG_FREE, - MONO_REG_FREEABLE, - MONO_REG_MOVEABLE, - MONO_REG_BUSY, - MONO_REG_RESERVED -}; +#endif 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 }; + +#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; regmask_t ifree_mask; - regmask_t ffree_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. */ - int *iassign; - int *fassign; + 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 max_ireg; - int ispills; - - int iassign_size, fassign_size; + 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) MONO_INTERNAL; - -void mono_regstate_free (MonoRegState *rs) MONO_INTERNAL; -void mono_regstate_reset (MonoRegState *rs) MONO_INTERNAL; -void mono_regstate_assign (MonoRegState *rs) MONO_INTERNAL; -int mono_regstate_alloc_int (MonoRegState *rs, regmask_t allow) MONO_INTERNAL; -void mono_regstate_free_int (MonoRegState *rs, int reg) MONO_INTERNAL; -int mono_regstate_alloc_float (MonoRegState *rs, regmask_t allow) MONO_INTERNAL; -void mono_regstate_free_float (MonoRegState *rs, int reg) MONO_INTERNAL; -inline int mono_regstate_next_long (MonoRegState *rs) MONO_INTERNAL; +MonoRegState* mono_regstate_new (void); +void mono_regstate_free (MonoRegState *rs);