[Mono-dev] Arm9 NS9215 floating point troubles
Trevor Ackerman
t_ackerman at yahoo.com
Thu Jun 17 12:07:28 EDT 2010
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100617/9490734c/attachment.html
More information about the Mono-devel-list
mailing list