Message ID | alpine.LFD.2.02.1102160204130.2792@ybpnyubfg6.ybpnyqbznva6 |
---|---|
State | New |
Headers | show |
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 <gerald@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. >
On 28.06.15 17:50, Gerald Pfeifer wrote: > 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? Aehm, sorry for the delay. It is hot here .... Fine with me as far as I can decide/approve. At least for trunk. For 5.2, I guess you must hurry since Richi wants to spin a candidate tomorrow. On 4.9, I can't decide since I have no idea about the release planning. Have to inform myself. Thanks, Andreas > 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 <gerald@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. >> > >
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.