last merge 100420:100549
authorJb Evain <jbevain@gmail.com>
Sun, 13 Apr 2008 11:44:22 +0000 (11:44 -0000)
committerJb Evain <jbevain@gmail.com>
Sun, 13 Apr 2008 11:44:22 +0000 (11:44 -0000)
svn path=/branches/jb/ml2/mono/; revision=100550

13 files changed:
mono/arch/amd64/amd64-codegen.h
mono/io-layer/ChangeLog
mono/io-layer/processes.c
mono/metadata/ChangeLog
mono/metadata/assembly.c
mono/metadata/icall.c
mono/metadata/image.c
mono/mini/ChangeLog
mono/mini/basic-math.cs
mono/mini/cpu-amd64.md
mono/mini/mini-amd64.c
mono/tests/ChangeLog
mono/tests/Makefile.am

index fcfea74d0c147f7f78370e214486a1e106b4b3a4..2bc268e505ea3d46fe8f7183ca587e3481e8a87d 100644 (file)
@@ -517,6 +517,8 @@ typedef union {
 
 #define amd64_sse_xorpd_reg_membase(inst,dreg,basereg,disp) emit_sse_reg_membase ((inst),(dreg),(basereg), (disp), 0x66, 0x0f, 0x57)
 
+#define amd64_sse_andpd_reg_membase(inst,dreg,basereg,disp) emit_sse_reg_membase ((inst),(dreg),(basereg), (disp), 0x66, 0x0f, 0x54)
+
 #define amd64_sse_movsd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst), (dreg), (reg), 0xf2, 0x0f, 0x10)
 
 #define amd64_sse_movsd_reg_membase(inst,dreg,basereg,disp) emit_sse_reg_membase ((inst), (dreg), (basereg), (disp), 0xf2, 0x0f, 0x10)
index 9cb15c50f4a6f227e5fb6b8a2721689d572f10d8..98b49c7b71652d1563aee613c2cf61740076b759 100644 (file)
@@ -1,3 +1,8 @@
+2008-04-11  Geoff Norton  <gnorton@novell.com>
+
+       * processes.c: The global extern environ doesn't exist on Mac.  We
+       need to call NSGetEnviron instead.
+
 2008-04-08  Dick Porter  <dick@ximian.com>
 
        * processes.c (CreateProcess): Improve the managed binary support,
index 75c673d4f2f8dba75836602bc552094acff64763..e040303113dd0209f668e6869f8c96e949194d89 100644 (file)
 #include <mono/io-layer/timefuncs-private.h>
 
 /* The process' environment strings */
+#ifdef __APPLE__
+/* Apple defines this in crt_externs.h but doesn't provide that header for 
+ * arm-apple-darwin9.  We'll manually define the symbol on Apple as it does
+ * in fact exist on all implementations (so far) 
+ */
+gchar ***_NSGetEnviron();
+#define environ *_NSGetEnviron()
+#else
 extern char **environ;
+#endif
 
 #undef DEBUG
 
@@ -601,13 +610,13 @@ gboolean CreateProcessWithLogonW (const gunichar2 *username,
                                  const gunichar2 *appname,
                                  const gunichar2 *cmdline,
                                  guint32 create_flags,
-                                 gpointer environ,
+                                 gpointer env,
                                  const gunichar2 *cwd,
                                  WapiStartupInfo *startup,
                                  WapiProcessInformation *process_info)
 {
        /* FIXME: use user information */
-       return CreateProcess (appname, cmdline, NULL, NULL, FALSE, create_flags, environ, cwd, startup, process_info);
+       return CreateProcess (appname, cmdline, NULL, NULL, FALSE, create_flags, env, cwd, startup, process_info);
 }
 
 static gboolean
index c650932d890bb39b7ff60c19d9897962b024cf0f..7c6e3cd322521b5a405cede9eb8efbe851d4bdc7 100644 (file)
@@ -1,3 +1,16 @@
+2008-04-12  Zoltan Varga  <vargaz@gmail.com>
+
+       * assembly.c (mono_assembly_load_from_full): Do the check for loading other
+       mscorlibs for the non-refonly case as well.
+
+       * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
+       in mono_assembly_load_from_full (). Fixes #378924.
+
+2008-04-11  Geoff Norton  <gnorton@novell.com>
+
+       * icall.c: The global extern environ doesn't exist on Mac.  We
+       need to call NSGetEnviron instead.
+
 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
 
        verify.c: Add generic method constraint verification.
index a361c31714f5f71017fb57f08f3df2e510edec0c..0314d2e585d0c7e443df5c6d57bd1388de16f02b 100644 (file)
@@ -1440,11 +1440,11 @@ mono_assembly_load_from_full (MonoImage *image, const char*fname,
 
        mono_assembly_fill_assembly_name (image, &ass->aname);
 
-       if (refonly && strcmp (ass->aname.name, "mscorlib") == 0) {
+       if (mono_defaults.corlib && strcmp (ass->aname.name, "mscorlib") == 0) {
                // MS.NET doesn't support loading other mscorlibs
                g_free (ass);
                g_free (base_dir);
-               mono_image_close (image);
+               mono_image_addref (mono_defaults.corlib);
                *status = MONO_IMAGE_OK;
                return mono_defaults.corlib->assembly;
        }
index e3899014b3d3d7ef637f5454a28ee39804b21103..69109336c9136276f8cd58f28bbb642c0a8e98a3 100644 (file)
@@ -6020,10 +6020,19 @@ ves_icall_System_Environment_GetEnvironmentVariable (MonoString *name)
  */
 #ifndef _MSC_VER
 #ifndef __MINGW32_VERSION
+#ifdef __APPLE__
+/* Apple defines this in crt_externs.h but doesn't provide that header for 
+ * arm-apple-darwin9.  We'll manually define the symbol on Apple as it does
+ * in fact exist on all implementations (so far) 
+ */
+gchar ***_NSGetEnviron();
+#define environ *_NSGetEnviron()
+#else
 extern
 char **environ;
 #endif
 #endif
+#endif
 
 static MonoArray *
 ves_icall_System_Environment_GetEnvironmentVariableNames (void)
index b5ca1e9e665b34ed4cd6f136b8ce630b2da70845..adba56959e9ee21656e7345ee94d895ac2181023 100644 (file)
@@ -843,14 +843,6 @@ do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status,
                image->assembly_name = mono_metadata_string_heap (image, 
                        mono_metadata_decode_row_col (&image->tables [MONO_TABLE_ASSEMBLY],
                                        0, MONO_ASSEMBLY_NAME));
-               /* we don't allow loading different mscorlibs */
-               if (strcmp (image->assembly_name, "mscorlib") == 0 && mono_defaults.corlib) {
-                       if (status)
-                               *status = MONO_IMAGE_OK;
-                       mono_image_close (image);
-                       mono_image_addref (mono_defaults.corlib);
-                       return mono_defaults.corlib;
-               }
        }
 
        image->module_name = mono_metadata_string_heap (image, 
index 6149c38f660c6e278475620353cfbd4f999aa933..e65df6b669fb290966ce9cf86ccc58998e390dda 100644 (file)
@@ -1,3 +1,10 @@
+2008-04-11  Zoltan Varga  <vargaz@gmail.com>
+
+       * mini-amd64.c (mono_arch_output_basic_block): Implement OP_ABS directly using
+       SSE2 instructions.
+
+       * basic-math.cs: Fix warnings. Add a test for Math.Abs ().
+       
 2008-04-11  Zoltan Varga  <vargaz@gmail.com>
 
        * mini.c (handle_stack_args): Make this return void since its return value was
index c70a6b4ec58b9a46fa87eec26b2ae999fb2e6317..c470c8f13333b82a2ffa89db2d6091a03a133e76 100644 (file)
@@ -6,7 +6,7 @@ using System.Reflection;
  *
  * Each test needs to be of the form:
  *
- * static int test_<result>_<name> ();
+ * public static int test_<result>_<name> ();
  *
  * where <result> is an integer (the value that needs to be returned by
  * the method to make it pass.
@@ -25,44 +25,44 @@ using System.Reflection;
 
 class Tests {
 
-       static int Main () {
+       public static int Main () {
                return TestDriver.RunTests (typeof (Tests));
        }
        
-       static int test_0_sin_precision () {
+       public static int test_0_sin_precision () {
                double d1 = Math.Sin (1);
                 double d2 = Math.Sin (1) - d1;
                return (d2 == 0) ? 0 : 1;
        }
 
-       static int test_0_cos_precision () {
+       public static int test_0_cos_precision () {
                double d1 = Math.Cos (1);
                 double d2 = Math.Cos (1) - d1;
                return (d2 == 0) ? 0 : 1;
        }
 
-       static int test_0_tan_precision () {
+       public static int test_0_tan_precision () {
                double d1 = Math.Tan (1);
                 double d2 = Math.Tan (1) - d1;
                return (d2 == 0) ? 0 : 1;
        }
 
-       static int test_0_atan_precision () {
+       public static int test_0_atan_precision () {
                double d1 = Math.Atan (double.NegativeInfinity);
                 double d2 = Math.Atan (double.NegativeInfinity) - d1;
                return (d2 == 0) ? 0 : 1;
        }
 
-       static int test_0_sqrt_precision () {
+       public static int test_0_sqrt_precision () {
                double d1 = Math.Sqrt (2);
                 double d2 = Math.Sqrt (2) - d1;
                return (d2 == 0) ? 0 : 1;
        }
 
-       static int test_2_sqrt () {
+       public static int test_2_sqrt () {
                return (int) Math.Sqrt (4);
        }
-       static int test_0_sqrt_precision_and_not_spill () {
+       public static int test_0_sqrt_precision_and_not_spill () {
                double expected = 0;
                double[] operands = new double[3];
                double[] temporaries = new double[3];
@@ -87,7 +87,7 @@ class Tests {
                return (result == expected) ? 0 : 1;
        }
        
-       static int test_0_sqrt_precision_and_spill () {
+       public static int test_0_sqrt_precision_and_spill () {
                double expected = 0;
                double[] operands = new double[9];
                double[] temporaries = new double[9];
@@ -112,7 +112,7 @@ class Tests {
                return (result == expected) ? 0 : 1;
        }
        
-       static int test_0_div_precision_and_spill () {
+       public static int test_0_div_precision_and_spill () {
                double expected = 0;
                double[] operands = new double[9];
                double[] temporaries = new double[9];
@@ -136,27 +136,27 @@ class Tests {
                return (result == expected) ? 0 : 1;
        }
        
-       static int test_0_sqrt_nan () {
+       public static int test_0_sqrt_nan () {
                return Double.IsNaN (Math.Sqrt (Double.NaN)) ? 0 : 1;
        }
        
-       static int test_0_sin_nan () {
+       public static int test_0_sin_nan () {
                return Double.IsNaN (Math.Sin (Double.NaN)) ? 0 : 1;
        }
        
-       static int test_0_cos_nan () {
+       public static int test_0_cos_nan () {
                return Double.IsNaN (Math.Cos (Double.NaN)) ? 0 : 1;
        }
        
-       static int test_0_tan_nan () {
+       public static int test_0_tan_nan () {
                return Double.IsNaN (Math.Tan (Double.NaN)) ? 0 : 1;
        }
        
-       static int test_0_atan_nan () {
+       public static int test_0_atan_nan () {
                return Double.IsNaN (Math.Atan (Double.NaN)) ? 0 : 1;
        }
 
-       static int test_0_min () {
+       public static int test_0_min () {
                if (Math.Min (5, 6) != 5)
                        return 1;
                if (Math.Min (6, 5) != 5)
@@ -172,7 +172,7 @@ class Tests {
                return 0;
        }
 
-       static int test_0_max () {
+       public static int test_0_max () {
                if (Math.Max (5, 6) != 6)
                        return 1;
                if (Math.Max (6, 5) != 6)
@@ -187,5 +187,12 @@ class Tests {
                        return 6;
                return 0;
        }
-               
+
+       public static int test_0_abs () {
+               double d = -5.0;
+
+               if (Math.Abs (d) != 5.0)
+                       return 1;
+               return 0;
+       }
 }
index e1c578ae88ef173d3ec19f2a6f693b4b8e41e10d..6ea8864491e79499e0d463fa890a2d0c68844d2b 100644 (file)
@@ -307,7 +307,7 @@ sbb_imm: dest:i src1:i len:8 clob:1
 br_reg: src1:i len:3
 sin: dest:f src1:f len:32
 cos: dest:f src1:f len:32
-abs: dest:f src1:f len:32
+abs: dest:f src1:f clob:1 len:32
 tan: dest:f src1:f len:59
 atan: dest:f src1:f len:9
 sqrt: dest:f src1:f len:32
index 3a8cfed458f35f35d8bbb1aa4eb36305741b16fa..c78c8a4a7cd668a2189dbe6d084de48751965207 100644 (file)
@@ -3367,9 +3367,15 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
                case OP_COS:
                        EMIT_SSE2_FPFUNC (code, fcos, ins->dreg, ins->sreg1);
                        break;          
-               case OP_ABS:
-                       EMIT_SSE2_FPFUNC (code, fabs, ins->dreg, ins->sreg1);
+               case OP_ABS: {
+                       static guint64 d = 0x7fffffffffffffffUL;
+
+                       g_assert (ins->sreg1 == ins->dreg);
+                                       
+                       mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_R8, &d);
+                       amd64_sse_andpd_reg_membase (code, ins->dreg, AMD64_RIP, 0);
                        break;          
+               }
                case OP_SQRT:
                        EMIT_SSE2_FPFUNC (code, fsqrt, ins->dreg, ins->sreg1);
                        break;
index 704a7f80c032e76267c0c173292b427514f083e0..88f13394152694833a3a766a330e276515f28334 100644 (file)
@@ -1,3 +1,7 @@
+2008-04-11  Mark Probst  <mark.probst@gmail.com>
+
+       * Makefile.am: Added missing files to EXTRA_DIST.
+
 2008-04-10  Atsushi Enomoto  <atsushi@ximian.com>
 
        * Makefile: fix extra dist file name.
index 11de1eaf20bec6f88f92f7b09bf3a68cd17ffb68..9c438ab34912c63805cda40cf210df5110f7cba1 100644 (file)
@@ -648,15 +648,19 @@ test-coreclr-security : coreclr-security.exe
        $(RUNTIME21) --security=core-clr-test coreclr-security.exe
 endif
 
+EXTRA_DIST += generic-unboxing.2.il
 generic-unboxing.2.dll : generic-unboxing.2.il
        $(ILASM) /dll /output:generic-unboxing.2.dll $(srcdir)/generic-unboxing.2.il
 
+EXTRA_DIST += generic-boxing.2.il
 generic-boxing.2.dll : generic-boxing.2.il generic-unboxing.2.dll
        $(ILASM) /dll /output:generic-boxing.2.dll $(srcdir)/generic-boxing.2.il
 
+EXTRA_DIST += generic-unbox.2.cs
 generic-unbox.2.exe : generic-unbox.2.cs generic-unboxing.2.dll
        $(MCS) -r:generic-unboxing.2.dll $(srcdir)/generic-unbox.2.cs
 
+EXTRA_DIST += generic-box.2.cs
 generic-box.2.exe : generic-box.2.cs generic-unboxing.2.dll generic-boxing.2.dll
        $(MCS) -r:generic-unboxing.2.dll,generic-boxing.2.dll $(srcdir)/generic-box.2.cs