[newlib] libm with ieeelib.c from torbjorn

Jeff Johnston jjohnstn@redhat.com
Tue Apr 18 18:34:00 GMT 2006


Christian Walter wrote:
> 
> Hello,
> 
> I am currently using newlib 1.14 with gcc-3.4.6 on an m68k-elf target 
> with code compiled for mcpu32. I tried to integrate the ieeelib patches 
> from torbjorn which give me a speedup of about 25% in a simple test 
> using some multiply and divide operations.
> The basic results look okay and the results from the floating point 
> executions are correct when using only operations like *,/,+,-,... If I 
> use the newlib functions from libm targeted for my cpu I get wrong 
> results. For example with pow, powf, ... If I switch back to the 
> floating point implementation fp-bit from gcc the functions work as 
> expected. Are there any more dependencies except beeing IEEE compliant?
> 
> The patch I used is based on the initial message from Torbjorn Granlund 
> (http://gcc.gnu.org/ml/gcc/1999-07n/msg00553.html) with two patches 
> applied from [1] and [2].
> 
> [1] fix float comparision problem: 
> http://gcc.gnu.org/ml/gcc/2003-06/msg02495.html
> [2] updates for new gcc:
> http://gcc.gnu.org/ml/gcc/2005-11/msg01373.html
> 
> I would really be grateful for any hints to point me into the right 
> direction. Or should I better redirect my question on the gcc list?
> 
> Regards,
>     Christian Walter
> 
> -- 

I would suggest the gcc list would be the best place to start this.  It 
appears likely that the patch you have applied has some bugs that are 
exposed by the libm code.  An example of one such bug needs to be traced 
through the pow/powf functions to see where it goes wrong.

-- Jeff J.



More information about the Newlib mailing list