Now that Andreas is on board, time to dust off some older issues of mine. :-)
I verified that current GCC HEAD generates fsincos on FreeBSD/i386 with -ffastmath (and no options otherwise), and generates a call to a sin() function otherwise. So, okay to apply this patch? And if so, okay to push back to GCC 5 and 4.9 as well? Gerald On Wed, 16 Feb 2011, Gerald Pfeifer wrote: > The documentation indicates that -mno-fancy-math-387 is the default > on FreeBSD, yet I do not see any code actually implementing that, and > I verified that the following > > #include <math.h> > > double f(double d) { > return __builtin_sin(d); > } > > did generate fsin with -ffast-math as the only option. > > Richard, http://gcc.gnu.org/ml/gcc-patches/2002-03/msg02001.html was > the last time someone really made changes in this area, though the > reference to FreeBSD predates your patch where you added OpenBSD and > NetBSD for both of which I _do_ see code in config/i386 to that extent, > unlike FreeBSD. > > Am I missing something obvious, or is the patch below okay? > > Gerald > > > 2011-02-16 Gerald Pfeifer <ger...@pfeifer.com> > > PR target/37072 > * doc/invoke.texi (i386 and x86-64 Options): -mno-fancy-math-387 > is not actually the default on FreeBSD. > Uppercase CPU. > > Index: doc/invoke.texi > =================================================================== > --- doc/invoke.texi (revision 170120) > +++ doc/invoke.texi (working copy) > @@ -12273,9 +12273,9 @@ > @opindex mno-fancy-math-387 > Some 387 emulators do not support the @code{sin}, @code{cos} and > @code{sqrt} instructions for the 387. Specify this option to avoid > -generating those instructions. This option is the default on FreeBSD, > +generating those instructions. This option is the default on > OpenBSD and NetBSD@. This option is overridden when @option{-march} > -indicates that the target cpu will always have an FPU and so the > +indicates that the target CPU will always have an FPU and so the > instruction will not need emulation. As of revision 2.6.1, these > instructions are not generated unless you also use the > @option{-funsafe-math-optimizations} switch. >