GP32 Floats Using Gcc


pea

developer
Joined
Oct 3, 2004
Messages
1,089
Age
45
Location
New Zealand
Website
www.projectitis.com
Hi all,

If I use a float anywhere in my code, do I need to use the -msoft-float flag? I read in an older post that you can safely leave this off, and GCC will determine for itself that it needs software floating point operations.
 
IIRC ...

The -msoft-float flag is used on a system with an FPU co-processor to force the non-FPU way of doing things.
The Arm doesn't have one so it has to do it the long way anyway.

There may be issues with how GCC flags each section and may not link them without warnings, etc.
 
Here's a link into the GCC manuals ..
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gc...t_002dfloat-676

I'd read somewhere that GCC leaves info in the .o files about how it was compiled, but it may just be a reference to the required library :unsure:


Aha! I searched -- I found :)

The search ;)
http://www.gp32x.de/board/index.php?act=S...Bmsoft+%2Bfloat

The post :D
http://www.gp32x.de/board/index.php?showt...hl=msoft++float

The quote ^_^
DJWillis said:
-msoft-float is hugely misunderstood and should NEVER be used unless you have a hardware floating point co-processor and wish to use the inbuilt ARM soft routines rather then the FPU. By default GCC is smart enough to work out that it’s on ARM and set the correct soft floating point routines. –msoft-float just causes code to get incorrectly marked even though the resulting object code is identical as the same routines are used.


Hope these help!
 
Last edited by a moderator:
Just to bring this back up -

In my latest project I use a lot of floats (doubles, actually) and when I attempt to compile the project i get SCREEDS of errors saying that My project is using software floating point, but that all the units in Mr.Mirkos SDK were compiled using hardware floats.

Is it ok to add -msoft-float in to the compiler flags for Mr.Mirkos SDK and recompile??

EDIT: And this only happens if I use the atan2(y,x) function :blink: - wierd huh?

EDIT: I tried compiling the SDK with the -msoft-float flag, but I still get exactly the same error.
 
Back
Top