[Pkg-mono-svn-commits] [mono] 03/03: [mips] Disable div with mul on 32bit mips

Jo Shields directhex at moszumanska.debian.org
Mon Nov 7 10:56:13 UTC 2016


This is an automated email from the git hooks/post-receive script.

directhex pushed a commit to branch master-patches/fix-mipsel
in repository mono.

commit d85c2948b20abaff2c0601fc253faa22505e36db
Author: Vlad Brezae <brezaevlad at gmail.com>
Date:   Mon Oct 10 23:40:59 2016 +0300

    [mips] Disable div with mul on 32bit mips
    
    (cherry picked from commit 95fd91097289c65456c21ff2731d6ec914305c89)
---
 mono/mini/mini-mips.h | 9 +++++++++
 mono/mini/mini.c      | 3 +++
 mono/mini/mini.h      | 1 +
 3 files changed, 13 insertions(+)

diff --git a/mono/mini/mini-mips.h b/mono/mini/mini-mips.h
index 73d0ad3..78d87e0 100644
--- a/mono/mini/mini-mips.h
+++ b/mono/mini/mini-mips.h
@@ -233,6 +233,15 @@ typedef struct MonoCompileArch {
 #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
diff --git a/mono/mini/mini.c b/mono/mini/mini.c
index a76acc1..0065f24 100644
--- a/mono/mini/mini.c
+++ b/mono/mini/mini.c
@@ -3133,6 +3133,9 @@ init_backend (MonoBackend *backend)
 #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
 }
 
 /*
diff --git a/mono/mini/mini.h b/mono/mini/mini.h
index d1f83c4..9b99f2b 100644
--- a/mono/mini/mini.h
+++ b/mono/mini/mini.h
@@ -1477,6 +1477,7 @@ typedef struct {
 	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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mono/packages/mono.git



More information about the Pkg-mono-svn-commits mailing list