ieeelib problems on gcc 3.4.6 with libm (newlib)
Christian Walter
wolti@sil.at
Tue Apr 18 19:41:00 GMT 2006
Hello,
Recently I looked at the floating point performance of one of our
applications and decided to give the ieeelib software floating point
implementation from torbjorn a try. I integrated ieeelib [1] together
with the patches [2] and [3] found on the list into an gcc-3.4.6
toolchain for an m68k cpu32 target. The performance increased for
floating point in about 25% percent and basic functionality looks okay
(for example multiply and add tested in a debugger).
In the next step I tried to use the newlib library which includes a
small libc and libm implementation and tried to use some math functions
like pow, powf, ... All of them give wrong results. If I change back to
the fp-bit implementation things work okay. I already posted this issue
on the newlib list with the message attached to this mail.
[1] ieeelib: http://gcc.gnu.org/ml/gcc/1999-07n/msg00553.html
[2] fix float comparison problem:
http://gcc.gnu.org/ml/gcc/2003-06/msg02495.html
[3] updates for new gcc:
http://gcc.gnu.org/ml/gcc/2005-11/msg01373.html
Are there any known issues with ieeelib and recent gcc compilers? Is
anyone using this combination and if yes on what target platforms? What
is the recommend way to debug this problem?
I also found on the list that Joseph S. Myers is working on
optimizations for software floating point but recent developments don't
show support for 68k targets (see
http://gcc.gnu.org/ml/gcc-patches/2006-03/msg00689.html). Is anyone
working on this patches for 68k platforms?
Regards,
Christian Walter
-------- Original Message --------
Subject: Re: [newlib] libm with ieeelib.c from torbjorn
Date: Tue, 18 Apr 2006 13:53:19 -0400
From: Jeff Johnston <jjohnstn@redhat.com>
To: Christian Walter <wolti@sil.at>
CC: newlib@sourceware.org
References: <4442BDAD.4010102@sil.at>
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.
--
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\ \\ \
Christian Walter Bakk. techn.\ Friends don't let friends drink and su(1)
email: wolti@sil.at \ -- Kevin Harris
More information about the Gcc
mailing list