[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] News and updates



Thanx John for the response.
One more thing, can i replace the library where it is picking it for
software double precision from uClibc?  I can change that with float
from  double for hw acceleration as i really dont need that much
precision.
Reason behind that is to retain the original open source code as it is
and just change the library. If so, then can u please let me know
which file in the uClibc i need to change it.

Thanx
- Prasad


On 5/21/06, John Williams <jwilliams@xxxxxxxxxxxxxx> wrote:
Hi Prasad,

DeviPrasad Natesan wrote:

> "The HW acceleration is for single precision only - using doubles
> (including literal constants like 2.0), will force calls to the software
> libraries.  Since uClibc's math library does everything with doubles,
> you won't see a lot of speedup on things like trig functions. However
> you will see instant 20-100X speedup on raw floating point arithmetic in
> your apps."
>
>
> Does that mean all the double precision floating point will be
> converted to single precision by the library to calculate the result.?

No - in fact the opposite.  the uClibc math libraries are all double, so
unfortunately gain no benefit from the HW FPU.

> I am running ntpd which has lots of double. So putting a FPU in the
> microblaze, does it increase the speed.?

No.  To gain the benefit from the single precision FPU, you need to
audit your application code to change doubles into floats.  You also
need to change constants into explicit floats, like this:

float myval=1.00;

myval*=(float)2.5;

Note the explicit cast of the constant 2.5 to a float - otherwise the
compiler will promote myval to a double, do a (software) double
precision multiply, then truncate the result back to a float - not what
you want!

John


___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/



___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/