ins->inst_imm = power2;
break;
}
+ if (cfg->backend->disable_div_with_mul)
+ break;
allocated_vregs = TRUE;
/*
* Replacement of unsigned division with multiplication,
break;
}
+ if (cfg->backend->disable_div_with_mul)
+ break;
/*
* Replacement of signed division with multiplication,
* shifts and additions Hacker's Delight, chapter 10-6.
#define MONO_ARCH_EMULATE_FREM 1
#endif
+/*
+ * mips backend misses some instructions that enable emitting of optimal
+ * code on other targets and, additionally, the register allocator gets
+ * confused by this optimization, failing to allocate all hw regs.
+ */
+#if SIZEOF_REGISTER == 4
+#define MONO_ARCH_NO_DIV_WITH_MUL
+#endif
+
#if SIZEOF_REGISTER == 8
#define MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS
#endif
#ifdef MONO_ARCH_DYN_CALL_PARAM_AREA
backend->dyn_call_param_area = MONO_ARCH_DYN_CALL_PARAM_AREA;
#endif
+#ifdef MONO_ARCH_NO_DIV_WITH_MUL
+ backend->disable_div_with_mul = 1;
+#endif
}
/*
guint need_got_var : 1;
guint need_div_check : 1;
guint no_unaligned_access : 1;
+ guint disable_div_with_mul : 1;
int monitor_enter_adjustment;
int dyn_call_param_area;
} MonoBackend;