mpc8xx fpu emu

Wolfgang Denk wd at denx.de
Thu Sep 12 07:54:41 EST 2002


Dear Alban,

in message <Pine.LNX.4.44.0209111451510.1731-100000 at manoir.bloodwolf.org> you wrote:
>
> Basically, I have an RPX Lite-M board. The mpc850 does not have an fpu,
> but I have a need for non-intensive fpu operations. I don't want to
> compile applications and librairies with -msoft-float - for my needs the
> fpu emulator is really the way to go.

Believe me: it is _not_.

> I also compiled a very simple application that does a floating point
> division and prints it. I explicitly specified -msoft-hard. (same with the
> kernel btw), checked out the resulting assembly and did in fact find an
> fdiv instruction.

You can do this, and you may even get simple  programs  working.  But
other  simple program may crash, or produce bad results, or both. Not
to speak about complicated programs.

The FPU emulation code is *far* from being production quality.

Do NOT use it. You have been warned.


And BTW: why should you want to use it? If you just have to deal with
"non-intensive fpu operations" then software FP is just  fine  -  you
probably won;t even notice the slightly larger memory footprint - but
you definitely will notice the much, much higher speed of soft-float.

> I didn't compile my own toolchain. I switch between the binary
> distributions I got from www.qslinux.org and timesys. I'm not sure this is
> a good idea.

Be aware that you cannot mix harware FP and software FP in one binary
and the libraries you link against.

> Any ideas as to what could be wrong? Could it be that the libs in the root
> filesystem I'm using for the board were compiled with -msoft-float,  and
> that as a result printf cannot properly output a float? (even though it's
> been properly handled by the fpu emulator?)

This is very likely the cause.

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
"Here's a fish hangs in the net like a poor man's right in  the  law.
'Twill hardly come out."     - Shakespeare, Pericles, Act II, Scene 1

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list