Bug 2749 - powerpc32 does not build --without-fp
Summary: powerpc32 does not build --without-fp
Status: CLOSED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: ports (show other bugs)
Version: 2.4
: P2 normal
Target Milestone: ---
Assignee: Roland McGrath
URL:
Keywords:
: 2444 (view as bug list)
Depends on:
Blocks: 3268
  Show dependency treegraph
 
Reported: 2006-06-09 22:35 IST by Steven Munroe
Modified: 2016-01-21 16:15 IST (History)
5 users (show)

See Also:
Host: powepc32-unknown-linux-gnu
Target: powepc32-unknown-linux-gnu
Build: powepc32-unknown-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments
Patch to ports to enable soft-fp to build for powerpc32 (2.07 KB, patch)
2006-06-09 22:37 IST, Steven Munroe
Details | Diff
Patch the libc required to allow soft-fp builds for powerpc32 (1.18 KB, patch)
2006-06-09 22:43 IST, Steven Munroe
Details | Diff
gcc patch to enable -msoft-float AND -mlong-double-128 to compile and provides the quad arith functions (2.95 KB, patch)
2006-06-09 22:48 IST, Steven Munroe
Details | Diff
Log of make check failures from powerpc32 --without-fp (13.98 KB, text/plain)
2006-06-13 21:44 IST, Steven Munroe
Details
Improved gcc patch for soft-long-double (2.99 KB, patch)
2006-08-04 21:48 IST, Steven Munroe
Details | Diff
Patch for gcc-4.1.1. Makes -mlong-double-128 the default and adds c++ support (18.73 KB, patch)
2006-08-04 21:52 IST, Steven Munroe
Details | Diff
Updated soft-fp long double patch (2.59 KB, patch)
2006-08-04 21:54 IST, Steven Munroe
Details | Diff
Updated libc patch to support -without-fp builds with the ports add-on (2.47 KB, patch)
2006-08-04 21:59 IST, Steven Munroe
Details | Diff
Move the PPC soft ieee-quad implementation to ports (4.30 KB, patch)
2006-08-04 22:01 IST, Steven Munroe
Details | Diff
Move the PPC ieee-quad soft-fp implementation to ports (4.25 KB, patch)
2006-08-04 22:05 IST, Steven Munroe
Details | Diff
Updated ports patch for ppc32 soft-fp (2.92 KB, patch)
2006-08-07 19:17 IST, Steven Munroe
Details | Diff
Acknowledge Joe Kerian's contribution (2.49 KB, patch)
2006-08-07 19:19 IST, Steven Munroe
Details | Diff
another update per comments from Joseph (2.49 KB, patch)
2006-08-07 20:58 IST, Steven Munroe
Details | Diff
Updated gcc-4.2 patch with fmsub soft-fp implement (4.63 KB, patch)
2006-09-15 15:11 IST, Steven Munroe
Details | Diff
gcc-4.1.1 version of darwin-ldouble with fmsub patch (13.75 KB, patch)
2006-09-15 15:14 IST, Steven Munroe
Details | Diff
Updated soft-fp and related mainline patches (2.71 KB, patch)
2006-09-15 23:06 IST, Steven Munroe
Details | Diff
Updated ports patch for powerpc32 soft-fp (7.17 KB, patch)
2006-09-15 23:07 IST, Steven Munroe
Details | Diff
updated patch the does not double round the result (4.66 KB, patch)
2006-09-21 22:25 IST, Steven Munroe
Details | Diff
Updated to apply cleanly to current cvs (2.61 KB, patch)
2006-09-21 22:44 IST, Steven Munroe
Details | Diff
delta to ports patch that resolves remaining test-ldouble faulures. (571 bytes, patch)
2006-09-26 21:02 IST, Steven Munroe
Details | Diff
patch to add more ULPs I needed in testing (434 bytes, patch)
2006-11-14 17:00 IST, Joseph Myers
Details | Diff
Updated soft-fp patches, test with glibc trunk from Jan 3rd (1.58 KB, patch)
2007-01-12 19:11 IST, Steven Munroe
Details | Diff
Clean up the generic IBM long double source issues int glibc trunk (1.32 KB, patch)
2007-01-12 19:16 IST, Steven Munroe
Details | Diff
Addtional soft-fp patch to add fenv-libc.h to ports (832 bytes, patch)
2007-01-15 21:55 IST, Steven Munroe
Details | Diff
Updated soft-fp patch after Jakubs feedback (1.73 KB, patch)
2007-01-15 21:56 IST, Steven Munroe
Details | Diff
Long double soft-fp patch for glibc-2.5 (3.05 KB, patch)
2007-02-26 22:04 IST, Steven Munroe
Details | Diff
long double soft-fp patch for glibc-2.5-ports (7.92 KB, patch)
2007-02-26 22:06 IST, Steven Munroe
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Munroe 2006-06-09 22:35:02 IST
This is know problem that was complicated by the introduction of -mlong-double-128

The goal is first to get glibc for powerpc32 --without-fp to build and run make
check. And second to resolve any test-float, etc errors reported. Hopefully if I
can do the first part, interrested parties can help with the second part.
Comment 1 Steven Munroe 2006-06-09 22:37:53 IST
Created attachment 1074 [details]
Patch to ports to enable soft-fp to build for powerpc32

This needs to apply to ports. Then this patched version of ports is an add-on
to libc.
Comment 2 Steven Munroe 2006-06-09 22:43:46 IST
Created attachment 1075 [details]
Patch the libc required to allow soft-fp builds for powerpc32

We need this patch because soft-fp does not have <fenv_libc.h>. So we need to
eliminate the need for the feget/set functions or change to use <fenv.n>.

This also server to ellimiate a concerned with using fesetround() withing libm
functions.
Comment 3 Steven Munroe 2006-06-09 22:48:03 IST
Created attachment 1076 [details]
gcc patch to enable -msoft-float AND -mlong-double-128 to compile and provides the quad arith functions

This is an as yet experimental patch provided by David Edelson. It applies
against gcc-4.1 and gcc-4.2 and allows glibc to build glibc soft-fp for
powerpc32.
Comment 4 Steven Munroe 2006-06-09 22:49:58 IST
I'll clean up and post the patches to libc-alpha when I get time.
Comment 5 Steven Munroe 2006-06-13 21:44:56 IST
Created attachment 1084 [details]
Log of make check failures from powerpc32 --without-fp

This is the (edited) make check log of the failures, including the *.out.

There are still some failures in float and double that need to be looked at:

bug-nextafter, bug-nexttoward, test-float, and test-double

Plus a signicant number of new (for soft-fp) failures in test-ldouble.
Comment 6 Steven Munroe 2006-06-13 21:53:20 IST
It seems that at we are inadvertently using the gcc soft-fp run-time and not the
glibc soft-fp we just build. The problem is that gcc's soft-fp does not
implement the IEEE exceptions. This is responcible for the bug-nextafter failure
and I expect some of the test-float/test-double failures as well.
Comment 7 Steven Munroe 2006-06-13 22:52:57 IST
I think Joseph Myers is interested in this. Looks like Joseph is changing gcc to
use the glibc soft-fp implementation in gcc-4.2
<http://gcc.gnu.org/ml/gcc-patches/2006-03/msg00689.html> 

We have been building with gcc-4.1 where we are picking up the fp-bit32.c
version (which explicitly does not support exceptions)

Looks like we need to coordinate with Joseph

Comment 8 Joseph Myers 2006-06-13 23:31:53 IST
On the list of possible future projects for soft-fp in GCC
http://gcc.gnu.org/wiki/Software%20floating%20point
the problems with having soft-fp in both GCC and glibc are
discussed.  My suggested solution involves a GCC configure
option --with-libc-soft-fp=glibc2.4 which causes the given
set of soft-fp functions to be omitted from libgcc.  The
version number is needed since 2.4 has more such functions
than 2.3, and something may also need to be done to get the functions
exported from glibc (as of an older glibc version, various
soft-fp functions ended up hidden, apparently because of
libgcc-compat.S, rather than exported from the shared libc).
Comment 9 Lior Balkohen 2006-06-15 09:40:15 IST
*** Bug 2444 has been marked as a duplicate of this bug. ***
Comment 10 Steven Munroe 2006-08-04 21:48:43 IST
Created attachment 1198 [details]
Improved gcc patch for soft-long-double

This gcc patch adds some IBM extended functions we missed in the previous
round.
Comment 11 Steven Munroe 2006-08-04 21:52:38 IST
Created attachment 1199 [details]
Patch for gcc-4.1.1. Makes -mlong-double-128 the default and adds c++ support

If you are using gcc-4.1.1 (not gcc-4.2) then you will need this additional
patch
Comment 12 Steven Munroe 2006-08-04 21:54:49 IST
Created attachment 1200 [details]
Updated soft-fp long double patch

This patch replaces the previous soft-fp/long double patch for ports
Comment 13 Steven Munroe 2006-08-04 21:59:41 IST
Created attachment 1201 [details]
Updated libc patch to support -without-fp builds with the ports add-on

This replaces to previous patch to libc, fixing soft-fp fp-exection handling
and additional generic math functions.
Comment 14 Steven Munroe 2006-08-04 22:01:58 IST
Created attachment 1202 [details]
Move the PPC soft ieee-quad implementation to ports

This patch removes the PPC soft-fp ieee-quad implementation from libc trunk
beause it is not used in the primary linux implementation.
Comment 15 Steven Munroe 2006-08-04 22:05:54 IST
Created attachment 1203 [details]
Move the PPC ieee-quad soft-fp implementation to ports

The primary Linux PPC ABI used IBM extented for long double, so be move the
ieee-quad implementatin from libc trunk to ports/powerpc/soft-fp/quad. 

Any platform that uses the ieee/quad soft-fp can enable it with the approoriate
Implies files.
Comment 16 Steven Munroe 2006-08-04 22:12:31 IST
Refreshed the patch set.

With this patch set powerpc32 -with-fp builds clean and passes all the float and
double tests.

The long double tests still fail. The consensus is that IBM Extended requires a
fussed multiple add for correct results and this not currently available to
soft-fp. 

Unless someelse voluteers for this exciting opportunity I will take a crack at a
writing fmadd/fmsub soft-fp routines and work with David Edelsohn to get the
requires gcc updates.
Comment 17 Joseph Myers 2006-08-04 22:36:25 IST
In addition to this patch set:

ports/sysdeps/powerpc/nofpu/Makefile should have $(gcc-quad-routines) removed.
ports/sysdeps/powerpc/nofpu/Versions should have __fixtfdi __fixtfsi
__trunctfsf2 __floatunditf __floatunsitf __unordtf2 removed.
Comment 18 Steven Munroe 2006-08-07 19:17:22 IST
Created attachment 1208 [details]
Updated ports patch for ppc32 soft-fp

Updated per Joseph Myers comments
Comment 19 Steven Munroe 2006-08-07 19:19:24 IST
Created attachment 1209 [details]
Acknowledge Joe Kerian's contribution
Comment 20 Joseph Myers 2006-08-07 19:24:05 IST
Though the ChangeLog entry now mentions removal of __fixtfdi and __fixtfsi the
patch itself still needs updating to remove those two functions from the
Versions file.
Comment 21 Steven Munroe 2006-08-07 20:58:58 IST
Created attachment 1210 [details]
another update per comments from Joseph
Comment 22 Steven Munroe 2006-09-15 14:08:39 IST
Update: David Edelsohn provided version of darwin-ldouble with a fmsub
implementation based on the soft-fp quad support macros. This was required to
produce the 106 intermediate result from the multiple to the final subtract.

Unfortunately the expansion of FP_SUB_Q produced incorrect results. Final
tracted this down to the __FP_FRAC_SUB_4 macro from op-4.h. The current version
does not propagate the borrows correctly for the 3rd anf 4th words. Corrected
this and we are see a big improvement in the results. Because IBM extented is
only gives 106 vs 113 for for IEEE we are seeing ULPS failures up to 8 bits, but
this expected for IBM extented and equivalent to hardware IBM extented results.
This is fixed in the no-fpu/libm-test-ulps.

Net test-float and test-double are clean and test-ldouble is down to 18 failures
(mostly incorrect sign of 0.0 or inf). Debugging continues but good progress.
Comment 23 Steven Munroe 2006-09-15 15:11:09 IST
Created attachment 1298 [details]
Updated gcc-4.2 patch with fmsub soft-fp implement

This patch implements updated darwin-ldouble.c to add a soft-fp implementation
of fmsub plus fixes to the FP_SUB_Q support.
Comment 24 Steven Munroe 2006-09-15 15:14:52 IST
Created attachment 1299 [details]
gcc-4.1.1 version of darwin-ldouble with fmsub patch

This version takes the darwin-ldouble.c(fmsub) code expands it with cpp, runs
it through indent to create a version compatible with gcc4.1.1 (which does not
have the same soft-fp code as gcc4.2).
Comment 25 joseph@codesourcery.com 2006-09-15 16:25:51 IST
Subject: Re:  powerpc32 does not build --without-fp

On Fri, 15 Sep 2006, sjmunroe at us dot ibm dot com wrote:

> ------- Additional Comments From sjmunroe at us dot ibm dot com  2006-09-15 15:11 -------
> Created an attachment (id=1298)
>  --> (http://sourceware.org/bugzilla/attachment.cgi?id=1298&action=view)
> Updated gcc-4.2 patch with fmsub soft-fp implement
> 
> This patch implements updated darwin-ldouble.c to add a soft-fp implementation
> of fmsub plus fixes to the FP_SUB_Q support.

Note that the soft-fp fix must be accepted for glibc mainline before it 
can go in libgcc's copy, as per FSF policies.  It looks OK to me but I 
have no approval rights for glibc's master copy, only for the GCC copy 
(which effectively means for the build infrastructure integration, i.e. 
the one file t-softfp).

For the fmsub implementation, you do FP_PACK_SEMIRAW_Q between the 
subtraction and the truncation.  This is not correct since it can lead to 
double rounding (first the value is rounded to a quad value exactly half 
way between two double values, then it gets rounded to a double value that 
wasn't the closest to the infinite-precision result).  The truncation 
needs to be done on the output of the subtraction with sticky bits still 
in place, not on the rounded result.

I think the bulk of the fmsub implementation should go in a macro in 
op-common.h, that could be used to implement the standard fma and fmaf 
library functions.  It would need to take fs and wc for both the type in 
question and the double width type, and arguments for the three inputs and 
the result, and for whether it's to calculate a*b+c or a*b-c.  Maybe also 
for the type of the long double temporaries you use, but I hope that you 
can avoid the explicit packing and unpacking into quad representation.

Comment 26 Steven Munroe 2006-09-15 19:46:02 IST
>Note that the soft-fp fix must be accepted for glibc mainline before it 
>can go in libgcc's copy, as per FSF policies.
Yes thats next.

>For the fmsub implementation, you do FP_PACK_SEMIRAW_Q between the 
>subtraction and the truncation.  This is not correct since it can lead to 
>double rounding (first the value is rounded to a quad value exactly half 
>way between two double values, then it gets rounded to a double value that 
>wasn't the closest to the infinite-precision result).  The truncation 
>needs to be done on the output of the subtraction with sticky bits still 
>in place, not on the rounded result.

We tried this orginally but we found that FP_SUB_Q/FP_MUL_Q can leave extranious
bits in high order bits of the expanded mantisa (word[3]). This can cause errors
down stream, so we added to full pack/unpack between stages. 

To remove the:

+    FP_PACK_SEMIRAW_Q(v,V);
+    FP_UNPACK_SEMIRAW_Q(V,v);

sequence we will need explicitely clear the high order 16 bits of V_f[3]. But
this is not a glibc issue and should not delay the acceptance of soft-fp fixes.

>I think the bulk of the fmsub implementation should go in a macro in 
>op-common.h, that could be used to implement the standard fma and fmaf 
>library functions.

First, lets keep it simple and get long double working. Then since this is you
proposal, are you voluteering to implement it ;-)
Comment 27 joseph@codesourcery.com 2006-09-15 20:07:15 IST
Subject: Re:  powerpc32 does not build --without-fp

On Fri, 15 Sep 2006, sjmunroe at us dot ibm dot com wrote:

> sequence we will need explicitely clear the high order 16 bits of V_f[3]. But
> this is not a glibc issue and should not delay the acceptance of soft-fp fixes.

It is a glibc issue since the correct place for the fused multiply add 
implementation is in soft-fp (it is not PowerPC-specific, but is 
generically relevant to any user of soft-fp) and the master copy of 
soft-fp is in glibc.  In any case, the double rounding is incorrect.

> >I think the bulk of the fmsub implementation should go in a macro in 
> >op-common.h, that could be used to implement the standard fma and fmaf 
> >library functions.
> 
> First, lets keep it simple and get long double working. Then since this is you
> proposal, are you voluteering to implement it ;-)

Not at present.  My suggestion is that the code (more or less as you have 
it) should go in a macro in op-common.h rather than in a PowerPC-specific 
file.  That's essentially a matter of moving the code.  And bugs should be 
kept open for the known problems, such as double rounding and the generic 
brokenness of fma/fmaf/fmal in glibc (instantiated for the various 
implementations present).  (The generic brokenness is Debian bug 372544, I 
don't think there's a glibc Bugzilla entry.  It so happens that on soft-fp 
PowerPC, there would be an easy fix for fmaf and fma with the macro added 
to op-common.h: use the soft-fp fma support.)

Comment 28 Steven Munroe 2006-09-15 20:42:03 IST
>And bugs should be 
>kept open for the known problems, such as double rounding and the generic 
>brokenness of fma/fmaf/fmal in glibc (instantiated for the various 
>implementations present).  (The generic brokenness is Debian bug 372544, I 
>don't think there's a glibc Bugzilla entry.

I found not evidence of fma code in the soft-fp code. So are you proposing a new
feature?

Again the first thing is to get powerpc32 -soft-fp building an working as
before. fixing any general soft-fp fma problem is extra credit (and an new bug
not related to this one).
Comment 29 joseph@codesourcery.com 2006-09-15 20:51:15 IST
Subject: Re:  powerpc32 does not build --without-fp

On Fri, 15 Sep 2006, sjmunroe at us dot ibm dot com wrote:

> ------- Additional Comments From sjmunroe at us dot ibm dot com  2006-09-15 20:42 -------
> >And bugs should be 
> >kept open for the known problems, such as double rounding and the generic 
> >brokenness of fma/fmaf/fmal in glibc (instantiated for the various 
> >implementations present).  (The generic brokenness is Debian bug 372544, I 
> >don't think there's a glibc Bugzilla entry.
> 
> I found not evidence of fma code in the soft-fp code. So are you proposing a new
> feature?

I am proposing that the code you have written to implement fma should go 
in the best place for it (target-independent, soft-fp) rather than an 
inferior place (a PowerPC-specific file).  This is the proper approach for 
fixing things on the mainlines of the respective repositories; a backport 
to 4.1 might take a more local fix.

Comment 30 Jakub Jelinek 2006-09-15 21:07:36 IST
glibc on many arches doesn't have a standard conforming fma(3) - for float
just using double multiplication and addition should be good enough, but
especially for long double the current implementation is wrong.  So, if there was
a soft-fp FMA that could be used on all the targets that can't do this in
hardware, it would be great.
Comment 31 joseph@codesourcery.com 2006-09-15 21:28:21 IST
Subject: Re:  powerpc32 does not build --without-fp

On Fri, 15 Sep 2006, jakub at redhat dot com wrote:

> glibc on many arches doesn't have a standard conforming fma(3) - for float

Yes - that's what the Debian bug report I mentioned is about.  A new bug 
report should probably be opened in glibc Bugzilla for this issue.

> just using double multiplication and addition should be good enough, but

The standard says the result is rounded once, so double rounding isn't 
correct, but still a lot better than what we have right now.

> especially for long double the current implementation is wrong.  So, if there was
> a soft-fp FMA that could be used on all the targets that can't do this in
> hardware, it would be great.

To do it for long double you'd need to add more operations to op-8.h (and 
invent an oct-float type), since you need an intermediate type with twice 
the precision.  Also you'd need to add appropriate packing/unpacking for 
IBM long double (which soft-fp doesn't natively support).

We do have various sfp-machine.h files for targets not currently using 
soft-fp sitting around and ready to use as part of using soft-fp for 
generic fma (on all targets without fma instructions).

Now, we have the immediate problem that soft-fp patches are very hard to 
get into glibc (I have one unreviewed from June, bug 2831) and the same 
applies to other generic fixes to mathematical functions (bug 2592, 
likewise fix waiting since June) - and the glibc patches attached to this 
bug report have also mostly been ready for some time to go in as a clear 
improvement on the present state of affairs (with any subsequent fixes 
likely to be comparatively small and confined to either soft-fp or ports).  
So while I've considered generically fixing fma in glibc and adding 
appropriate testcases, I wouldn't be confident of such fixes actually 
getting anywhere.

Comment 32 Steven Munroe 2006-09-15 21:34:34 IST
>glibc on many arches doesn't have a standard conforming fma(3) - for float
>just using double multiplication and addition should be good enough, but
>especially for long double the current implementation is wrong.  So, if there was
>a soft-fp FMA that could be used on all the targets that can't do this in
>hardware, it would be great.

I would just like to separate the the problem of powerpc long double soft-fp
which does not even build in the upstream (this bug) from the pan-galatic
problem of soft-fp fma. 

This fix has taken too long already and I don't want to delay this fix while
solving a different problem. 

I am not saying we should not solve the genrral fma problem. Just separately and
without delaying this fix.

As I understand it we need the soft-fp fix for FP_SUB_Q in the glibc upstream
before we can propagate the fix to gcc-4.2, before David can submit the rest of
the gcc soft-fp fixes for gcc-4.2. We are running out of time for gcc-4.2.

Once that is done we can look at general fma.
Comment 33 joseph@codesourcery.com 2006-09-15 21:39:35 IST
Subject: Re:  powerpc32 does not build --without-fp

On Fri, 15 Sep 2006, sjmunroe at us dot ibm dot com wrote:

> As I understand it we need the soft-fp fix for FP_SUB_Q in the glibc upstream
> before we can propagate the fix to gcc-4.2, before David can submit the rest of
> the gcc soft-fp fixes for gcc-4.2. We are running out of time for gcc-4.2.

Given how late the long double changes went into GCC 4.1, and given that 
there is a clear regression, I'd say that the patches could go in on the 
branch after 4.2 branches, at least up to the 4.2.0 release.  But given 
how long it takes to get soft-fp patches into glibc, perhaps that isn't 
very long.

Comment 34 Steven Munroe 2006-09-15 23:06:26 IST
Created attachment 1300 [details]
Updated soft-fp and related mainline patches
Comment 35 Steven Munroe 2006-09-15 23:07:33 IST
Created attachment 1301 [details]
Updated ports patch for powerpc32 soft-fp
Comment 36 Steven Munroe 2006-09-21 22:25:34 IST
Created attachment 1313 [details]
updated patch the does not double round the result

This patch eliminates the full PACK/UNPACK between the FP_SUB_Q and the
FD_TRUNC so that the result is only rounded once.
Comment 37 Steven Munroe 2006-09-21 22:44:15 IST
Created attachment 1314 [details]
Updated to apply cleanly to current cvs

This patch is updated to cvs trunk as of 09/20/2006. This works with recent
changes to manline lrintl/llrint etc and is a simpler patch.
Comment 38 Steven Munroe 2006-09-26 21:02:53 IST
Created attachment 1325 [details]
delta to ports patch that resolves remaining test-ldouble faulures.

This patch is a delta to port patch the resolves remaining test-ldouble
failures.

Net gcc generates bad code for builtin fabsl that does not handle -0.0
correctly. This was the route cause for 17 or the remaining 18 failures. Used
Makefile CFLAGS to force -fno-builtin-fabsl. This forces those libm functions
to call libc's fabsl function which is correct.
Comment 39 Peter Bergner 2006-09-28 16:05:13 IST
The GCC fabsl problem is being tracked here:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29253
Comment 40 Joseph Myers 2006-11-14 17:00:20 IST
Created attachment 1418 [details]
patch to add more ULPs I needed in testing

In PowerPC soft-float testing I found some more ULPs were needed.  (It's
possible that these depend on fine details of the compiler and libc versions
being tested; after all, no FSF GCC version has support for soft-float long
double - effectively a regression - because the soft-fp patches needed for GCC
and attached to this bug have still not been reviewed.	The results of
hard-float long double computations can definitely depend on what compiler
optimizations happen in libgcc and libm.)

I'm not sure how the original ULP list was generated; it contains such oddities
as

ildouble: 1
ldouble: 1
ildouble: 2
ldouble: 2

which suggest it was not generated by concatenating the old file with the new
or increased ULPs and running through gen-libm-test.pl as described in
README.libm-test (doing this yields other changes to the file as well, but it
should be idempotent).	It may be as well to resort the file by passing it
through that process.
Comment 41 Steven Munroe 2006-11-14 17:33:31 IST
Yes the ulps will vary with the optimization, for example -O2 vs -Os will give
different results. And there are additional difference between gcc-4.1.1 and
gcc-4.2. Which where you testing?

And yes ldouble tests will all fail without fmsub implementation for
darwin-ldouble.c

I was not sure if I should regenerate sysdeps/powerpc/nofpu/libm-test-ulps until
we are closer to the final configuration.
Comment 42 joseph@codesourcery.com 2006-11-14 17:42:42 IST
Subject: Re:  powerpc32 does not build --without-fp

On Tue, 14 Nov 2006, sjmunroe at us dot ibm dot com wrote:

> Yes the ulps will vary with the optimization, for example -O2 vs -Os will give
> different results. And there are additional difference between gcc-4.1.1 and
> gcc-4.2. Which where you testing?

4.1 (branches/csl/sourcerygxx-4_1, which has a soft-fp backport, so using 
the non-macro-expanded version of fmsub from the 4.2 patch).  I will be 
working on getting E500 working with long double as well (unfortunately 
E500 support has got somewhat bitrotten in GCC, so sharing fixes between 
4.1/4.2/4.3 there will be more difficult).

Comment 43 cvs-commit@gcc.gnu.org 2006-11-22 15:13:24 IST
Subject: Bug 2749

CVSROOT:	/cvs/glibc
Module name:	ports
Changes by:	drow@sourceware.org	2006-11-22 15:13:11

Modified files:
	.              : ChangeLog.powerpc 
	sysdeps/powerpc/nofpu: Makefile Versions libm-test-ulps 
Added files:
	sysdeps/powerpc/soft-fp: sfp-machine.h 
	sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu: Implies 
	                                                 getcontext.S 
	                                                 setcontext.S 
	                                                 swapcontext.S 

Log message:
	2006-10-05  Steven Munroe  <sjmunroe@us.ibm.com>
	
	[BZ #2749]
	* sysdeps/powerpc/nofpu/Makefile
	[subdirs-soft-fp] (sysdep_routines): Remove gcc-quad-routines.
	[subdirs-math] (CPPFLAGS): Add -I../soft-fp.
	[subdirs-math] (CFLAGS-e_powl.c): Add -fno-builtin-fabsl.
	[subdirs-math] (CFLAGS-s_ccoshl.c): Likewise.
	[subdirs-math] (CFLAGS-s_csinhl.c): Likewise.
	[subdirs-math] (CFLAGS-s_clogl.c): Likewise.
	[subdirs-math] (CFLAGS-s_clog10l.c): Likewise.
	[subdirs-math] (CFLAGS-s_csinl.c): Likewise.
	[subdirs-math] (CFLAGS-s_csqrtl.c): Likewise.
	* sysdeps/powerpc/nofpu/Versions (GLIBC_2.3.2): Remove __fixtfdi,
	__fixtfsi, and __trunctfsf2.
	(GLIBC_2.4): Remove  __floatunditf, __floatunsitf, and __unordtf2.
	Add __nedf2, __nesf2, __gtdf2, __gtsf2, __ltdf2, __ltsf2.
	* sysdeps/powerpc/nofpu/libm-test-ulps: Update for soft-fp.
	* sysdeps/powerpc/soft-fp/sfp-machine.h: New file.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies: New file.
	
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S:
	New file.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S:
	New file.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S:
	New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/ChangeLog.powerpc.diff?cvsroot=glibc&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/powerpc/nofpu/Makefile.diff?cvsroot=glibc&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/powerpc/nofpu/Versions.diff?cvsroot=glibc&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/powerpc/nofpu/libm-test-ulps.diff?cvsroot=glibc&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/powerpc/soft-fp/sfp-machine.h.diff?cvsroot=glibc&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/Implies.diff?cvsroot=glibc&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S.diff?cvsroot=glibc&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S.diff?cvsroot=glibc&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S.diff?cvsroot=glibc&r1=NONE&r2=1.1

Comment 44 Steven Munroe 2007-01-12 19:11:09 IST
Created attachment 1492 [details]
Updated soft-fp patches, test with glibc trunk from Jan 3rd
Comment 45 Steven Munroe 2007-01-12 19:16:18 IST
Created attachment 1493 [details]
Clean up the generic IBM long double source issues int glibc trunk
Comment 46 Steven Munroe 2007-01-15 21:55:10 IST
Created attachment 1499 [details]
Addtional soft-fp patch to add fenv-libc.h to ports
Comment 47 Steven Munroe 2007-01-15 21:56:38 IST
Created attachment 1500 [details]
Updated soft-fp patch after Jakubs feedback
Comment 48 cvs-commit@gcc.gnu.org 2007-01-15 23:43:15 IST
Subject: Bug 2749

CVSROOT:	/cvs/glibc
Module name:	libc
Changes by:	jakub@sourceware.org	2007-01-15 23:43:04

Modified files:
	.              : ChangeLog 
	math           : basic-test.c test-misc.c 
	soft-fp        : op-4.h op-common.h 

Log message:
	* soft-fp/op-common.h (FP_TRUNC): When truncating a NaN, clear
	workbits in semi-raw fraction.
	
	* math/test-misc.c: Add new tests.
	
	* math/basic-test.c: Include test-skeleton.c.
	(TEST_TRUNC): Define.
	(truncdfsf_test, trunctfsf_test, trunctfdf_test): New.
	(main): Rename to ...
	(do_test): ...this.  Run new tests.
	(TEST_FUNCTION): Define.
	
	[BZ #2749]
	* soft-fp/op-4.h (__FP_FRAC_SUB_3, __FP_FRAC_SUB_4): Correct borrow
	handling for high words.
	* soft-fp/op-common.h (_FP_OVERFLOW_SEMIRAW): Always set inexact
	and overflow for infinity.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&r1=1.10473&r2=1.10474
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/math/basic-test.c.diff?cvsroot=glibc&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/math/test-misc.c.diff?cvsroot=glibc&r1=1.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/soft-fp/op-4.h.diff?cvsroot=glibc&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/soft-fp/op-common.h.diff?cvsroot=glibc&r1=1.9&r2=1.10

Comment 49 cvs-commit@gcc.gnu.org 2007-01-17 13:00:36 IST
Subject: Bug 2749

CVSROOT:	/cvs/glibc
Module name:	libc
Changes by:	jakub@sourceware.org	2007-01-17 13:00:11

Modified files:
	.              : ChangeLog 
	sysdeps/ieee754/ldbl-128ibm: s_fabsl.c s_roundl.c s_truncl.c 
	                             s_copysignl.c s_ceill.c s_floorl.c 

Log message:
	[BZ #2749]
	* sysdeps/ieee754/ldbl-128ibm/s_copysignl.c: Include
	<math_ldbl_opt.h>.  Remove weak_alias.  Use long_double_symbol macro.
	(__copysignl): Use signbit() for comparison.
	* sysdeps/ieee754/ldbl-128ibm/s_fabsl.c (__fabsl): Correct parms for
	SET_LDOUBLE_WORDS64.
	
	[BZ #2423, #2749]
	* sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Don't include <fenv_libc.h>.
	(__ceill): Remove calls to fegetround(), fesetround().
	* sysdeps/ieee754/ldbl-128ibm/s_floorl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_roundl.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_truncl.c: Likewise.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&r1=1.10480&r2=1.10481
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c.diff?cvsroot=glibc&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/ieee754/ldbl-128ibm/s_roundl.c.diff?cvsroot=glibc&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/ieee754/ldbl-128ibm/s_truncl.c.diff?cvsroot=glibc&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/ieee754/ldbl-128ibm/s_copysignl.c.diff?cvsroot=glibc&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/ieee754/ldbl-128ibm/s_ceill.c.diff?cvsroot=glibc&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/ieee754/ldbl-128ibm/s_floorl.c.diff?cvsroot=glibc&r1=1.3&r2=1.4

Comment 50 Steven Munroe 2007-01-17 21:47:14 IST
Excellent! with the code above, libc trunk requires no patches and ports
requires only one small (fenv-libc.h) patch to build powerpc32 soft-fp and "make
check" clean.

With the soft-fp fixes in glibc David Edelsohn and Joseph Myers committed the
corresponding gcc changes:
<http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01334.html,
http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01279.html>

When the fenv-libc.h patch is committed to ports we can close this bug.

Roland should I change status to FIXED?
Comment 51 cvs-commit@gcc.gnu.org 2007-01-23 14:47:13 IST
Subject: Bug 2749

CVSROOT:	/cvs/glibc
Module name:	ports
Changes by:	drow@sourceware.org	2007-01-23 14:47:02

Modified files:
	.              : ChangeLog.powerpc 
Added files:
	sysdeps/powerpc/nofpu: fenv_libc.h 

Log message:
	[BZ #2749]
	* sysdeps/powerpc/nofpu/fenv_libc.h: New file.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/ChangeLog.powerpc.diff?cvsroot=glibc&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/ports/sysdeps/powerpc/nofpu/fenv_libc.h.diff?cvsroot=glibc&r1=NONE&r2=1.1

Comment 52 Steven Munroe 2007-02-26 22:04:31 IST
Created attachment 1581 [details]
Long double soft-fp patch for glibc-2.5

This is a back port of of the final long double soft-fp patch back to glibc-2.5
Comment 53 Steven Munroe 2007-02-26 22:06:10 IST
Created attachment 1582 [details]
long double soft-fp patch for glibc-2.5-ports

This is a backport of the final soft-fp patch for ports powerpc32 to
glibc-2.5-ports
Comment 54 Steven Munroe 2007-02-26 22:07:55 IST
All the fixes for this bug committed to cvs and verified.
Comment 55 Steven Munroe 2007-02-27 14:24:51 IST
verfied with the libc and ports from CVS
Comment 56 Steven Munroe 2007-02-27 14:28:23 IST
How do we close this? Do I have to reopen, take owership then close?
Comment 57 cvs-commit@gcc.gnu.org 2007-07-12 14:42:31 IST
Subject: Bug 2749

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_5-branch
Changes by:	jakub@sourceware.org	2007-07-12 14:42:19

Modified files:
	.              : ChangeLog 
	math           : basic-test.c test-misc.c 
	soft-fp        : op-4.h op-common.h 

Log message:
	2007-01-15  Jakub Jelinek  <jakub@redhat.com>
	
	* soft-fp/op-common.h (FP_TRUNC): When truncating a NaN, clear
	workbits in semi-raw fraction.
	
	* math/test-misc.c: Add new tests.
	
	2007-01-14  Steven Munroe  <sjmunroe@us.ibm.com>
	
	* math/basic-test.c: Include test-skeleton.c.
	(TEST_TRUNC): Define.
	(truncdfsf_test, trunctfsf_test, trunctfdf_test): New.
	(main): Rename to ...
	(do_test): ...this.  Run new tests.
	(TEST_FUNCTION): Define.
	
	2006-10-05  Steven Munroe  <sjmunroe@us.ibm.com>
	Joe Kerian  <jkerian@us.us.ibm.com>
	
	[BZ #2749]
	* soft-fp/op-4.h (__FP_FRAC_SUB_3, __FP_FRAC_SUB_4): Correct borrow
	handling for high words.
	* soft-fp/op-common.h (_FP_OVERFLOW_SEMIRAW): Always set inexact
	and overflow for infinity.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.10362.2.35&r2=1.10362.2.36
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/math/basic-test.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.3&r2=1.3.10.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/math/test-misc.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.20&r2=1.20.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/soft-fp/op-4.h.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.8&r2=1.8.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/soft-fp/op-common.h.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.9&r2=1.9.2.1

Comment 58 Tulio Magno Quites Machado Filho 2016-01-21 16:15:20 IST
This bug has been fixed a long time ago.