Q: mathfp goals.

Ranjith Kumaran ranjith@cygnus.com
Thu Mar 16 08:34:00 GMT 2000


> If the goal is speed, then in some places 'mathfp' seems strange. Consider,
> for example, code for 'fabs'
> I believe that on many processors the 'math' version is (much) faster due to
> abscence of branches.

Yes, you're right, the math version may indeed run faster in a lot of 
cases.  A patch to revert the code to the previous state can be proposed 
if this seems like the right idea.  Feel free to comment on it if there 
are any further thoughts.

> Did somebody *actually* compare speeds of both math versions? Are the results
> available?

The mathfp package was put together after a few requests for a floating 
point math library.  This was about a year and a half ago.  At the time 
some informal tests were run and the results were promising; however, 
work on mathfp was suspended until the release of newlib 1.8.2 when it 
was decided that it would be open-sourced as-is as an option to newlib 
while still leaving the old math library intact.

So, yes, speeds were compared to make sure that the overall performance 
was reasonable but not scrutinized too much.  The process of creating a 
formal testsuite never got under way as work on mathfp was stopped.

Since its inclusion in the newlib package mathfp has enjoyed the benefit 
of actually being exercised by the public as can be seen by the various 
fixes that have been submitted.

-----
Ranjith Kumaran (ranjith@cygnus.com)
Cygnus Solutions, a Red Hat Company
416-482-2661 Ext. 303


More information about the Newlib mailing list