#elif defined(__sparc__) || defined(sparc)
const char * const sparc_desc [OP_LAST];
static const char*const * ins_spec = sparc_desc;
+#elif defined(__mips__) || defined(mips)
+const char * const mips_desc [OP_LAST];
+static const char*const * ins_spec = mips_desc;
#elif defined(__i386__)
-extern const char * const pentium_desc [OP_LAST];
-static const char*const * ins_spec = pentium_desc;
+extern const char * const x86_desc [OP_LAST];
+static const char*const * ins_spec = x86_desc;
#elif defined(__ia64__)
const char * const ia64_desc [OP_LAST];
static const char*const * ins_spec = ia64_desc;
#elif defined(__alpha__)
const char * const alpha_desc [OP_LAST];
static const char*const * ins_spec = alpha_desc;
+#elif defined(__ppc__) || defined(__powerpc__)
+extern const char * const ppcg4 [OP_LAST];
+static const char*const * ins_spec = ppcg4;
#else
#error "Not implemented"
#endif
static inline GSList*
g_slist_append_mempool (MonoMemPool *mp, GSList *list, gpointer data)
{
- GSList *new_list;
- GSList *last;
-
- new_list = mono_mempool_alloc (mp, sizeof (GSList));
- new_list->data = data;
- new_list->next = NULL;
-
- if (list) {
- last = list;
- while (last->next)
- last = last->next;
- last->next = new_list;
-
- return list;
- }
- else
- return new_list;
+ GSList *new_list;
+ GSList *last;
+
+ new_list = mono_mempool_alloc (mp, sizeof (GSList));
+ new_list->data = data;
+ new_list->next = NULL;
+
+ if (list) {
+ last = list;
+ while (last->next)
+ last = last->next;
+ last->next = new_list;
+
+ return list;
+ } else
+ return new_list;
}
/**
regpair = (((guint32)hreg) << 24) + vreg;
if (fp) {
+ g_assert (vreg >= MONO_MAX_FREGS);
+ g_assert (hreg < MONO_MAX_FREGS);
call->used_fregs |= 1 << hreg;
call->out_freg_args = g_slist_append_mempool (cfg->mempool, call->out_freg_args, (gpointer)(gssize)(regpair));
} else {
+ g_assert (vreg >= MONO_MAX_IREGS);
+ g_assert (hreg < MONO_MAX_IREGS);
call->used_iregs |= 1 << hreg;
call->out_ireg_args = g_slist_append_mempool (cfg->mempool, call->out_ireg_args, (gpointer)(gssize)(regpair));
}
{
MonoSpillInfo *info;
+#if defined (__mips__)
+ g_assert_not_reached();
+#endif
if (G_UNLIKELY (spillvar >= cfg->spill_info_len)) {
resize_spill_info (cfg, FALSE);
g_assert (spillvar < cfg->spill_info_len);
{
MonoSpillInfo *info;
+#if defined (__mips__)
+ g_assert_not_reached();
+#endif
if (G_UNLIKELY (spillvar >= cfg->spill_info_float_len)) {
resize_spill_info (cfg, TRUE);
g_assert (spillvar < cfg->spill_info_float_len);
#define is_soft_reg(r,fp) (!is_hard_reg((r),(fp)))
#define rassign(cfg,reg,fp) ((fp) ? (cfg)->rs->fassign [(reg)] : (cfg)->rs->iassign [(reg)])
-#define sreg1_is_fp(spec) (spec [MONO_INST_SRC1] == 'f')
-#define sreg2_is_fp(spec) (spec [MONO_INST_SRC2] == 'f')
-
#ifdef MONO_ARCH_INST_IS_FLOAT
#define dreg_is_fp(spec) (MONO_ARCH_INST_IS_FLOAT (spec [MONO_INST_DEST]))
+#define sreg1_is_fp(spec) (MONO_ARCH_INST_IS_FLOAT (spec [MONO_INST_SRC1]))
+#define sreg2_is_fp(spec) (MONO_ARCH_INST_IS_FLOAT (spec [MONO_INST_SRC2]))
#else
+#define sreg1_is_fp(spec) (spec [MONO_INST_SRC1] == 'f')
+#define sreg2_is_fp(spec) (spec [MONO_INST_SRC2] == 'f')
#define dreg_is_fp(spec) (spec [MONO_INST_DEST] == 'f')
#endif
} RegTrack;
#ifndef DISABLE_LOGGING
-static void
-print_ins (int i, MonoInst *ins)
+void
+mono_print_ins (int i, MonoInst *ins)
{
const char *spec = ins_spec [ins->opcode];
printf ("\t%-2d %s", i, mono_inst_name (ins->opcode));
g_error ("Opcode '%s' missing from machine description file.", mono_inst_name (ins->opcode));
}
- DEBUG (print_ins (i, ins));
+ DEBUG (mono_print_ins (i, ins));
/*
* TRACK FP STACK
sreg2_mask = sreg2_is_fp (spec) ? MONO_ARCH_CALLEE_FREGS : MONO_ARCH_CALLEE_REGS;
DEBUG (printf ("processing:"));
- DEBUG (print_ins (i, ins));
+ DEBUG (mono_print_ins (i, ins));
ip = ins->cil_code;
assign_reg (cfg, rs, reg2, val, fp);
dreg_high = val;
- ins->unused = val;
+ ins->backend.reg3 = val;
if (reg_is_freeable (val, fp) && reg2 >= 0 && (reginfo [reg2].born_in >= i)) {
DEBUG (printf ("\tfreeable %s (R%d)\n", mono_arch_regname (val), reg2));
mono_regstate2_free_int (rs, ins->sreg2);
}*/
- DEBUG (print_ins (i, ins));
+ DEBUG (mono_print_ins (i, ins));
/* this may result from a insert_before call */
if (!tmp->next)
bb->code = tmp->data;