Hi Greg,
We are using an older version of GCC to work with our COFF
tools in a
68040. It turns out that sprintf wouldn't work at all for
floats. It
simply wasn't implemented. I think they returned the
parameter passed
in, but it seemed weird and slow. We just stopped using it
(for floats)
as it was only debug info out the debug serial port anyway.
Some floating point calculations weren't supported in the
hardware FP
unit, either. So we wrote our own. The alternative was a
huge FP library
from Motorola, in assembly, very confusing. It was an
exception
processor - the unsupported operation thew an exception and
then went
and did the operations in software. It was so much simpler
to just write
the operations we needed as C functions. SIN, COS, ACOS, and
maybe one
other. This way we could tell what was really going on.
In our case, floating point functions of any sort need to be
checked
thoroughly to see if the hardware and/or software really
does support
them. Sometimes the answer is no.
This probably isn't a good answer to your question, but I
felt a bit
like rambling.
Charlie K.
-----Original Message-----
From: ColdFire lists.wildrice.com [mailto:ColdFire lists.wildrice.com]
On Behalf Of Granville Gregg
Sent: Tuesday, April 25, 2006 10:35 AM
To: Kupelian Charlie
Subject: [ColdFire] Atof/sscanf and sprintf are very slow -
CodeWarrior
for ColdFire
Atof/sscanf and sprintf are very slow - CodeWarrior for
ColdFire
We are using the standard C library functions (atof,
sprintf, sscanf) to
convert between character strings and doubles. When we do,
we experience
long delays of up to 30 milliseconds to do the conversion.
When we use
these functions to convert to integers we do not experience
any
significant delay. Do you know if these functions support
floating point
operations in the hardware? Are we using the correct
library? We are
trying to avoid having to write our own conversion
functions, but it is
hard to imagine that they would be any slower.
We are linking to the following libraries:
C++_4i_CF_FPU_MSl.a
C_4i_CF_CFPU_MSL.a
Cpp_4i_CF_FPU_Runtime.a
Any body have any thoughts
Gregg GRANVILLE
Hardware Engineering Manager
-------------------------------------
Tel 1 603.622.0212 / Fax 1 603.623.5623
ggranville metronics.com / www.metronics.com
--------------------------------------------------------
METRONICS /// 30 Harvey Road // Bedford, NH 03110-6818 / US
------------------------------------------------------------
--------
To Subscribe send a message to: ColdFire-On Lists.Wildrice.com
To Unsubscribe send a message to: ColdFire-Off Lists.Wildrice.com
For further information, visit: <http://www.Wild
Rice.com/ColdFire/>
------------------------------------------------------------
--------
To Subscribe send a message to: ColdFire-On Lists.Wildrice.com
To Unsubscribe send a message to: ColdFire-Off Lists.Wildrice.com
For further information, visit: <http://www.Wild
Rice.com/ColdFire/>
|