On Wed, Aug 26, 2015 at 09:05:30PM +0100, Jo Shields wrote:
> 
> 
> On 26/08/15 20:12, Lennart Sorensen wrote:
> >On Wed, Aug 26, 2015 at 07:01:31PM +0100, Jo Shields wrote:
> >>
> >>On 26/08/15 18:47, Lennart Sorensen wrote:
> >>>Opcode 'move_f_to_i4' missing from machine description file.
> >>>
> >>I agree with its assessment, there's no OP_MOVE_F_TO_I4 in
> >>mono/mini/mini-ppc.c and no move_f_to_i4 in mono/mini/cpu-ppc.md (maybe
> >>there should be? other arches have it)
> >Well ppc, ppc64, ia64 and sparc are the ones that don't have it.
> >
> 
> ia64 and sparc are bitrotted and no longer supported (we just haven't gotten
> around to deleting from git)

OK with the attached patch I now get:

PATH="/tmp/mono-new/mono-1/runtime/_tmpinst/bin:/tmp/mono-new/mono-1/runtime/_tmpinst/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
 MONO_REGISTRY_PATH="/home/lennartsorensen/.mono/registry" 
MONO_TESTS_IN_PROGRESS="yes" 
MONO_PATH="./../../class/lib/net_4_5:/tmp/mono-new/mono-1/mcs/class/corlib/../lib/net_4_5:$MONO_PATH"
 /tmp/mono-new/mono-1/runtime/mono-wrapper --debug  
./../../class/lib/net_4_5/nunit-console.exe  corlib_test_net_4_5.dll -noshadow  
 -exclude=NotWorking,ValueAdd,CAS,InetAccess -output=TestResult-net_4_5.log 
-xml=TestResult-net_4_5.xml  || ok=false; \
(echo ''; cat TestResult-net_4_5.log) | sed '1,/^Tests run: /d'; xsltproc 
./../../build/nunit-summary.xsl TestResult-net_4_5.xml >> 
TestResult-net_4_5.log ; $ok
NUnit version 2.4.8
Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment - 
   OS Version: Unix 3.2.0.4
  CLR Version: 4.0.30319.17020 ( 4.0.2 (ppc32/ff41f08 Wed Aug 26 21:04:15 UTC 
2015) )

Excluded categories: NotWorking,ValueAdd,CAS,InetAccess
.........N.N..............................N.N..........N.N..............................N.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................N.N..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................N...................................................................................................................................................................................................................................................................................................................................F.F..................................................................................................................N.................................................................................................................N..........N............N..................................................................................................N.N.N.N.N...............................N.N.N.........................................................................................................................................................................................................F...............................................................................................................................................................................................................................................................................................................................................................................N........N.............................................................N............................................................................................................................................................................................N.N..........................N...N.......N..N......N...................................................................................................................................................................................................................................................................................N.........................N.N.N.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................N...........................................................................................................................................................................................................................................................................................................................................................................................................................................................N..N................................................F.........................................................................................................................................................................................................................................................................N.N....N.N.............................................................................................................................................................................N..............................................................................................N.....................................................................................................N..........N................................................................................................................................................................................................................................................N................N.N.N.N..N.N.N.N...........................N.N....................................................................................................................................................................................................................................................................................................................N...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................N.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................N......................................................................................................................................................................N.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................N.N.N.N.N.N.N.N.N.N.N.N.N.N.N.N...........................................................................................................................................................................................................................................................................................................................N...............................................................................................................................................................................N............N.....N.N...............................................................................................................................................................................................................................................................................................................................................N...........................................................................................................................................................................................................................................................................................................................................N......................................................................................................................................................................N.N....................................................N......................................................................................................................................................................................................................N..N.N............................................................................................................................................................................................
Tests run: 10222, Failures: 4, Not run: 91, Time: 180.079 seconds

Test Case Failures:
1) MonoTests.System.DateTimeTest.AddHoursOutOfRangeException1 : 
System.ArgumentOutOfRangeException was expected

2) MonoTests.System.DateTimeTest.AddHoursOutOfRangeException2 : 
System.ArgumentOutOfRangeException was expected

3) MonoTests.System.Globalization.CultureInfoTest.DefaultThreadCurrentCulture : 
#1    <---- note this is my forced failure to stop this test from hanging 
forever
at MonoTests.System.Globalization.CultureInfoTest.DefaultThreadCurrentCulture 
() [0x00006] in 
/tmp/mono-new/mono-1/mcs/class/corlib/Test/System.Globalization/CultureInfoTest.cs:674
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke 
(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags 
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, 
System.Globalization.CultureInfo culture) [0x00054] in 
/tmp/mono-new/mono-1/mcs/class/corlib/System.Reflection/MonoMethod.cs:230

4) MonoTests.System.Reflection.Emit.MethodBuilderTest.CanCallVarargMethods : 
System.Reflection.TargetInvocationException : Exception has been thrown by the 
target of an invocation.
  ----> System.NullReferenceException : Object reference not set to an instance 
of an object
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags 
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, 
System.Globalization.CultureInfo culture) [0x00069] in 
/tmp/mono-new/mono-1/mcs/class/corlib/System.Reflection/MonoMethod.cs:238
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] 
parameters) [0x00000] in 
/tmp/mono-new/mono-1/mcs/class/corlib/System.Reflection/MethodBase.cs:114
at MonoTests.System.Reflection.Emit.MethodBuilderTest.CanCallVarargMethods () 
[0x00160] in 
/tmp/mono-new/mono-1/mcs/class/corlib/Test/System.Reflection.Emit/MethodBuilderTest.cs:1050
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke 
(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags 
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, 
System.Globalization.CultureInfo culture) [0x00054] in 
/tmp/mono-new/mono-1/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
--NullReferenceException
at System.IO.TextWriter.Write (System.Object value) [0x00006] in 
/tmp/mono-new/mono-1/external/referencesource/mscorlib/system/io/textwriter.cs:314
at System.Console.Write (System.Object value) [0x00000] in 
/tmp/mono-new/mono-1/mcs/class/corlib/System/Console.cs:328
at MonoTests.System.Reflection.Emit.MethodBuilderTest.VarargMethod 
(System.String headline) [0x00014] in 
/tmp/mono-new/mono-1/mcs/class/corlib/Test/System.Reflection.Emit/MethodBuilderTest.cs:1022
at foo.CallVarargMethod () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke 
(System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags 
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, 
System.Globalization.CultureInfo culture) [0x00054] in 
/tmp/mono-new/mono-1/mcs/class/corlib/System.Reflection/MonoMethod.cs:230

So no more exploding code at least.

Patch I did, which worked this well on the first try, but I won't say
it is perfect for sure (and I suspect if it makes sense, then ppc64
could add the instructions to their .md file too).

diff --git a/mono/mini/cpu-ppc.md b/mono/mini/cpu-ppc.md
index e6baf91..8109c23 100644
--- a/mono/mini/cpu-ppc.md
+++ b/mono/mini/cpu-ppc.md
@@ -128,6 +128,8 @@ storer8_memindex: dest:b src1:i src2:i len:4
 loadu4_mem: dest:i len:8
 move: dest:i src1:i len:4
 fmove: dest:f src1:f len:4
+move_f_to_i4: dest:i src1:f len:8
+move_i4_to_f: dest:f src1:i len:8
 add_imm: dest:i src1:i len:4
 sub_imm: dest:i src1:i len:4
 mul_imm: dest:i src1:i len:4
diff --git a/mono/mini/mini-ppc.c b/mono/mini/mini-ppc.c
index 8748c93..4d8fc14 100644
--- a/mono/mini/mini-ppc.c
+++ b/mono/mini/mini-ppc.c
@@ -3745,6 +3745,14 @@ mono_arch_output_basic_block (MonoCompile *cfg, 
MonoBasicBlock *bb)
                        if (ins->dreg != ins->sreg1)
                                ppc_fmr (code, ins->dreg, ins->sreg1);
                        break;
+               case OP_MOVE_F_TO_I4:
+                       ppc_stfs (code, ins->sreg1, -4, ppc_r1);
+                       ppc_ldptr (code, ins->dreg, -4, ppc_r1);
+                       break;
+               case OP_MOVE_I4_TO_F:
+                       ppc_stw (code, ins->sreg1, -4, ppc_r1);
+                       ppc_lfs (code, ins->dreg, -4, ppc_r1);
+                       break;
                case OP_FCONV_TO_R4:
                        ppc_frsp (code, ins->dreg, ins->sreg1);
                        break;

-- 
Len Sorensen

Reply via email to