On Wed, Sep 21, 2011 at 05:01:31PM -0400, David Miller wrote: > From: Michael Meissner <meiss...@linux.vnet.ibm.com> > Date: Thu, 15 Sep 2011 14:16:45 -0400 > > > On the powerpc, we have an issue with Spec 2006 and calculix when FMAs are > > generated and -ffast-math is used, where line 307 of rubber.f is: > > > > tt=datan2(dsqrt(1.d0-cn*cn),cn)/3.d0 > > > > The FNMSUB instruction generates a -0.0 while doing the multiply and > > subtract > > generates +0.0. Dsqrt returns a -0.0 when given a -0.0, and datan2 (-0.0, > > 1.0) > > returns -0.0. Note, calculix is nothing but nested FMAs, and if you disable > > FMAs you get about a 10% drop in performance. I suspect that the issue may > > be > > a powerpc backend issue where the wrong comparison is generated, but I > > haven't > > tracked it down. > > Have you learned anything more about this? Just curious.
No, I haven't had time to go back to this. At the moment, I am compiling stuff with -Wl,--wrap,atan2 and using an atan2 wrapper that adds 0.0 to the value so -0.0 is not returned. -- Michael Meissner, IBM 5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA meiss...@linux.vnet.ibm.com fax +1 (978) 399-6899