RE: [uCsimm] Floating point on uClinux?

From: Sergei Sharonov (SSharono@danielind.com)
Date: Mon Jan 03 2000 - 15:09:58 EST


If you look at the libc sources you'll see that printf() is broken and left
in some intermediate state. The LIBC:PRINTF is a debugging statement left by
somebody. Printf() calls vfprintf() as may be expected and vfprintf() calls
gcvt() to do floating conversions. I believe it is gcvt() that is actually
broken. A few weeks ago I replaced vfprintf() in libc by a standalone
function that I found somewhere in the newsgroups. The poster said that it
was snipped from VBCC (?) compiler so I am not sure about copyright. If you
have any interest - let me know and I'll send you sources. A couple remarks:
1. You have to compile libc with -DFLOATS to get float support included
(thanks, Vladimir)
2. The size of the program changes from about 4 kB to about 13 kB if you do
-DFLOATS because it pulls in all soft float math (no FPU in DragonBall ;-(
)
With 32 kB program size limit that is a substantial drain. Is there any
chance to do dynamic linking in uClinux? Or is anybody trying to port this
load time patching stuff that they did for ColdFire?
3. The speed is not great either:
12-16 mS to fprintf() a float (1.6 mS for int)
~40 mS to printf() a float.

Sergei A. Sharonov, project manager
Daniel Measurement & Control
9753 Pine Lake Drive
Houston, TX 77055
(713)827-4346
ssharono@danielind.com

> -----Original Message-----
> From: malcolm@interval.com [mailto:malcolm@interval.com]
> Sent: Wednesday, December 22, 1999 11:54 PM
> To: ucsimm@uClinux.com
> Subject: [uCsimm] Floating point on uClinux?
>
>
> OK, I give up. I'm sorry to bother the list with a trivial question.
>
> How do I use floating point on the uCsimm/uClinux port? I
> know I've seen
> it discussed on the mailing list. But I can't find it at the archives
> at http://www.progressive-comp.com/Lists/?l=uclinux&r=1&w=2, nor can I
> find this in the documentation I have, or what I can find on
> the uclinux
> web site.
>
> For example
> #include <math.h>
>
> main(){
> printf("a is %g.\n", sin(23));
> }
> when compiled with
> m68k-pic-coff-gcc -lm
> fails with the message
> a isLIBC:PRINTF#
>
> Thanks.
>
> -- Malcolm
> P.S. I'm trying to port Larry Doolittle's ntp client code... but it
> uses floating point.
>
>
>
> This message resent by the ucsimm@uclinux.com list server
http://www.uClinux.com/
This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:33 EST