[Mono-dev] Arm9 NS9215 floating point troubles

Geoff Norton gnorton at novell.com
Thu Jun 17 14:02:49 EDT 2010


Trevor,

 I tested your testcase on a:

Processor	: ARMv7 Processor rev 0 (v7l)
Features	: swp half thumb fastmult vfp edsp thumbee vfpv3 vfpv3d16 

I tested:

Mono JIT compiler version 2.4.2.3 (Debian 2.4.2.3+dfsg-2)
	Architecture:  armel,soft-float

Mono JIT compiler version 2.7 (/trunk/mono r158961 Tue Jun 15 17:26:35 EDT 2010)
	Architecture:  armel,vfp

Mono JIT compiler version 2.7 (/trunk/mono r158961 Thu Jun 17 13:58:00 EDT 2010)
	Architecture:  armel,soft-float

and all 3 produce the correct results.  I dont have a 2.6.4 build handy, but nothing really significant in this regard has changed.  Could you try trunk?  It might be something else with your board as well.

-g


On 2010-06-17, at 12:07 PM, Trevor Ackerman wrote:

> I have been able to cross-compile Mono 2.6.4 for the NS9215 (no fpu afaik) and I'm having trouble with floats when executing code.
> 
> I thought I had correctly specified soft-float and indeed mono tells me so
> 
> ~ # /usr/local/bin/mono -V
> Mono JIT compiler version 2.6.4 (tarball Wed Jun 16 14:55:33 MDT 2010)
> Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
>         TLS:           normal
>         GC:            Included Boehm (with typed GC and Parallel Mark)
>         SIGSEGV:       normal
>         Notifications: epoll
>         Architecture:  arm,soft-float
>         Disabled:      none
> ~ # 
> 
> However the following code produces grossly wrong results
> 
> using System;
> 
> public class FloatTest
> {
>         static public void Main()
>         {
>                 Console.WriteLine("0.0f literal is " + 0.0f);
>                 Console.WriteLine("1.0f literal is " + 1.0f);
>                 Console.WriteLine("12.3f literal is " + 12.3f);
>                 Console.WriteLine("32f literal is " + 32f);
>                 Console.WriteLine("1024f literal is " + 1024f);
>                 Console.WriteLine("32768f literal is " + 32768f);
>         }
> }
> 
> Here are the results
> 
> ~ # /usr/local/bin/mono FloatTest.exe
> 0.0f literal is 0
> 1.0f literal is 5.299809E-315
> 12.3f literal is -1.491669E-154
> 32f literal is 5.325712E-315
> 1024f literal is 5.351615E-315
> 32768f literal is 5.377519E-315
> 
> my configure command is
> ./configure --host=arm-linux --with-tls=pthread --with-moonlight=no --with-mcs-docs=no
> 
> summary from running config is
> 
>         mcs source:    $(top_srcdir)/mcs
>         olive source:  
> 
>         GC:            included
>         GLIB:          system
>         TLS:           pthread
>         SIGALTSTACK:   yes
>         Engine:        Building and using the JIT
>         2.0 Profile:   yes
>         Moon Profile:  no
>         4.0 Alpha:     no
>         MonoTouch:     no
>         JNI support:   IKVM Native
>         libgdiplus:    assumed to be installed
>         zlib:          system zlib
>         oprofile:      no
>         BigArrays:     no
>         DTrace:        no
>         Parallel Mark: yes
>         LLVM Back End: no
> 
> My CFLAGS and CPPFLAGS environment variables are both
> -DARM_FPU_NONE=1 -DMONO_ARCH_SOFT_FLOAT=1
> 
> Any insight would be greatly appreciated, I've looked at some of the code in the mono/mini directory but cannot make sense of how float values are getting generated.
> 
> TIA
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100617/e7f41ac8/attachment-0001.html 


More information about the Mono-devel-list mailing list