Author: zoltan
Date: 2007-06-01 16:17:40 -0400 (Fri, 01 Jun 2007)
New Revision: 78454

Modified:
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/cpu-amd64.md
   trunk/mono/mono/mini/mini-amd64.c
Log:
2007-06-01  Zoltan Varga  <[EMAIL PROTECTED]>

        * mini-amd64.c cpu-amd64.md: Correct length of r4const instruction and 
take into
        account if it contains a rex prefix.
        (peephole_pass): Handle OP_FMOVE as well.


Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2007-06-01 20:11:49 UTC (rev 78453)
+++ trunk/mono/mono/mini/ChangeLog      2007-06-01 20:17:40 UTC (rev 78454)
@@ -1,5 +1,11 @@
 2007-06-01  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * mini-amd64.c cpu-amd64.md: Correct length of r4const instruction and 
take into
+       account if it contains a rex prefix.
+       (peephole_pass): Handle OP_FMOVE as well.
+
+2007-06-01  Zoltan Varga  <[EMAIL PROTECTED]>
+
        * mini-x86.c (mono_arch_get_delegate_invoke_impl): Disable the static 
case for now
        as it causes regressions.
 

Modified: trunk/mono/mono/mini/cpu-amd64.md
===================================================================
--- trunk/mono/mono/mini/cpu-amd64.md   2007-06-01 20:11:49 UTC (rev 78453)
+++ trunk/mono/mono/mini/cpu-amd64.md   2007-06-01 20:17:40 UTC (rev 78454)
@@ -154,7 +154,7 @@
 call_membase: dest:a src1:b len:64 clob:c
 iconst: dest:i len:10
 i8const: dest:i len:18
-r4const: dest:f len:13
+r4const: dest:f len:14
 r8const: dest:f len:9
 store_membase_imm: dest:b len:15
 store_membase_reg: dest:b src1:i len:9

Modified: trunk/mono/mono/mini/mini-amd64.c
===================================================================
--- trunk/mono/mono/mini/mini-amd64.c   2007-06-01 20:11:49 UTC (rev 78453)
+++ trunk/mono/mono/mini/mini-amd64.c   2007-06-01 20:17:40 UTC (rev 78454)
@@ -44,6 +44,8 @@
 
 #define IS_IMM32(val) ((((guint64)val) >> 32) == 0)
 
+#define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
+
 #ifdef PLATFORM_WIN32
 /* Under windows, the default pinvoke calling convention is stdcall */
 #define CALLCONV_IS_STDCALL(call_conv) (((call_conv) == MONO_CALL_STDCALL) || 
((call_conv) == MONO_CALL_DEFAULT))
@@ -1749,6 +1751,7 @@
                case CEE_CONV_I4:
                case CEE_CONV_U4:
                case OP_MOVE:
+               case OP_FMOVE:
                        /*
                         * Removes:
                         *
@@ -1995,6 +1998,7 @@
                case CEE_CONV_I4:
                case CEE_CONV_U4:
                case OP_MOVE:
+               case OP_FMOVE:
                        /*
                         * Removes:
                         *
@@ -4821,10 +4825,15 @@
 
                        pos = cfg->native_code + patch_info->ip.i;
 
-                       if (use_sse2)
-                               *(guint32*)(pos + 4) = (guint8*)code - pos - 8;
-                       else
+
+                       if (use_sse2) {
+                               if (IS_REX (pos [1]))
+                                       *(guint32*)(pos + 5) = (guint8*)code - 
pos - 9;
+                               else
+                                       *(guint32*)(pos + 4) = (guint8*)code - 
pos - 8;
+                       } else {
                                *(guint32*)(pos + 3) = (guint8*)code - pos - 7;
+                       }
 
                        if (patch_info->type == MONO_PATCH_INFO_R8) {
                                *(double*)code = 
*(double*)patch_info->data.target;
@@ -5032,8 +5041,6 @@
        return amd64_is_imm32 (imm);
 }
 
-#define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
-
 /*
  * Determine whenever the trap whose info is in SIGINFO is caused by
  * integer overflow.

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to