05/15/2008 5:05 PM
Re: What library for soft floating point operators
> I understand its non trivial. What I don't understand is why this is a QNX
> issue and not a gcc issue.
Fundamentally it's a Freescale issue :). They were the ones who decided to go with an incompatible ABI.
Some ppc toolchains are configured to support both the hard-float and soft-float ABI and some toochains are configured
to use either one or the other. Since we only intend to support the hard-float ABI and the soft-float emulation routines
were not included in libgcc. gcc can still generate code for other ABI configurations (e.g eABi) but it doesn't have
all the necessary support routines for the code to execute correctly.
> The gcc compiler supports the use of soft-float. When I use the sinf function
> , all compiles links and runs fine.
The PPC ABI dictates that the float/double argument to sinf must be passed through fr1. libm follows this ABI and
expects fr1 to contain sinf's parameter; when you compile with -msoft-float it passes the argument in r3... It's not
> Isn't this just a porting issue. I know the board manufacturer, who uses
> linux, is also using gcc and not having a problem.
Not every operating system that runs on the same hardware follows the same ABI. The Linux setup you are referring to
could be following either the e500 ABI or the soft-float ABI. But I suspect they're not mixing. The e500 ABI is
incompatible with both the soft-float and hard-float ABIs.
If this is critical to your success, I could provide you with instructions on how to modify and rebuild gcc (or I could
provide you with a prebuilt toolchain with the understanding it was unsupported) that generates e500 floating point
instructions, and then you could rebuild your source, and using the source available from the Foundry rebuild a subset
of Neutrino to follow the e500 ABI. If you only have one program that is floating point intensive, you could rebuild the
applications dependencies (libc, libm, etc), and link everything statically and localize the need to follow the e500
Unfortunately rebuilding any parts of Neutrino with an unsupported toolchain would mean an unsupported configuration but
that might be a trade off you are willing to make.