From b8a425b89d58c35b5186edb0dd78d6ef2649d2ce Mon Sep 17 00:00:00 2001 From: Ben Maurer Date: Thu, 26 Aug 2004 17:41:57 +0000 Subject: [PATCH] 2004-08-26 Ben Maurer * basic-long.cs, basic-calls.cs: new tests for optimization. svn path=/trunk/mono/; revision=32894 --- mono/mini/ChangeLog | 4 +++ mono/mini/basic-calls.cs | 40 ++++++++++++++++++++++++++++- mono/mini/basic-long.cs | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 1 deletion(-) diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index 86e5ff5103d..3a8fef939c1 100644 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,3 +1,7 @@ +2004-08-26 Ben Maurer + + * basic-long.cs, basic-calls.cs: new tests for optimization. + 2004-08-26 Zoltan Varga * mini-amd64.c (read_tls_offset_from_method): Fix typo in previous diff --git a/mono/mini/basic-calls.cs b/mono/mini/basic-calls.cs index 2b11f48b2b0..879d4851223 100644 --- a/mono/mini/basic-calls.cs +++ b/mono/mini/basic-calls.cs @@ -247,6 +247,44 @@ class Tests { } return 0; } - + + static uint dum_de_dum = 1; + static int test_0_long_arg_opt () + { + return Foo (0x1234567887654321, dum_de_dum); + } + + static int Foo (ulong x, ulong y) + { + if (x != 0x1234567887654321) + return 1; + + if (y != 1) + return 2; + + return 0; + } + + static int test_0_long_ret_opt () + { + ulong x = X (); + if (x != 0x1234567887654321) + return 1; + ulong y = Y (); + if (y != 1) + return 2; + + return 0; + } + + static ulong X () + { + return 0x1234567887654321; + } + + static ulong Y () + { + return dum_de_dum; + } } diff --git a/mono/mini/basic-long.cs b/mono/mini/basic-long.cs index 774dd63cca9..243021aa83e 100644 --- a/mono/mini/basic-long.cs +++ b/mono/mini/basic-long.cs @@ -748,6 +748,72 @@ class Tests { u --; return (u == 4257145736) ? 0 : 1; } + + static long x; + static int test_0_addsub_mem () + { + x = 0; + x += 5; + + if (x != 5) + return 1; + + x -= 10; + + if (x != -5) + return 2; + + return 0; + } + + static ulong y; + static int test_0_sh32_mem () + { + y = 0x0102130405060708; + y >>= 32; + + if (y != 0x01021304) + return 1; + + y = 0x0102130405060708; + y <<= 32; + + if (y != 0x0506070800000000) + return 2; + + x = 0x0102130405060708; + x <<= 32; + + if (x != 0x0506070800000000) + return 2; + + return 0; + } + + static int test_0_assemble_long () + { + uint a = 5; + ulong x = 0x12345678; + ulong y = 1; + + + ulong z = ((x - y) << 32) | a; + + if (z != 0x1234567700000005) + return 1; + + return 0; + } + + static int test_0_hash () + { + ulong x = 0x1234567887654321; + int h = (int)(x & 0xffffffff) ^ (int)(x >> 32); + if (h != unchecked ((int)(0x87654321 ^ 0x12345678))) + return h; + return 0; + + } static int test_0_shift_regress () { long a = 0; -- 2.11.4.GIT