[Mono-bugs] [Bug 81052][Nor] New - [PATCH] wrong code generation because of endian problems on mipsel

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Mar 6 12:37:45 EST 2007


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by thommy at tabao.de.

http://bugzilla.ximian.com/show_bug.cgi?id=81052

--- shadow/81052	2007-03-06 12:37:45.000000000 -0500
+++ shadow/81052.tmp.23397	2007-03-06 12:37:45.000000000 -0500
@@ -0,0 +1,52 @@
+Bug#: 81052
+Product: Mono: Runtime
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: JIT
+AssignedTo: lupus at ximian.com                            
+ReportedBy: thommy at tabao.de               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] wrong code generation because of endian problems on mipsel
+
+mini-mips.c has a bug in function patch_lui_addiu:
+
+This patch works for me:
+
+--- mono-1.2.20070131/mono/mini/mini-mips.c     2007-01-31
+07:00:22.000000000 +0100
++++ mono-1.2.20070131.mod/mono/mini/mini-mips.c 2007-02-17
+21:22:34.000000000 +0100
+@@ -238,6 +238,11 @@
+ patch_lui_addiu(guint32 *ip, guint32 val)
+ {
+        guint16 *__lui_addiu = (guint16*)(void *)(ip);
++#if G_BYTE_ORDER == G_BIG_ENDIAN
++       int index=1;
++#else
++       int index=0;
++#endif
+
+ #if 0
+        printf ("patch_lui_addiu ip=0x%08x (0x%08x, 0x%08x) to point to
+0x%08x\n",
+@@ -245,10 +250,10 @@
+        fflush (stdout);
+ #endif
+        if (((guint32)(val)) & (1 << 15))
+-               __lui_addiu [1] = ((((guint32)(val)) >> 16) & 0xffff) + 1;
++               __lui_addiu [index] = ((((guint32)(val)) >> 16) & 0xffff) + 1;
+        else
+-               __lui_addiu [1] = (((guint32)(val)) >> 16) & 0xffff;
+-       __lui_addiu [3] = ((guint32)(val)) & 0xffff;
++               __lui_addiu [index] = (((guint32)(val)) >> 16) & 0xffff;
++       __lui_addiu [index+2] = ((guint32)(val)) & 0xffff;
+        mono_arch_flush_icache ((guint8 *)ip, 8);
+ }


More information about the mono-bugs mailing list