printf always prints "nan" for double variables on MIPS

Erik Andersen andersen at codepoet.org
Sat Feb 24 01:15:10 UTC 2007


On Fri Feb 23, 2007 at 06:28:33PM -0600, Kevin Nicoll wrote:
> Hello all,
> 
> I am using an embedded MIPS processor that is equipped with an MMU,
> but no FPU.  However, it does have an FPU emulator built into its
> linux kernel (2.6.18).  My MIPS toolchain uses gcc 3.4.5, binutils
[---------------snip-------------]
> Is this a bug in uClibc?  Or is it more likely to be a problem with my
> configuration?  Using software floating point by default sort of makes
> sense because of the lack of an FPU, but then why would printf output
> "nan" when the value of the actual double is correct?  The FPU
> emulator ought to take care of hardware floating point operations,
> anyway.  Do you guys smell something fishy here, too?

In my experience, the linux kernel FPU emulator is crap.
And very slow.  Any particular reason not to build a
soft-float toolchain and avoid the entire issue?

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list