This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Gfortran and using C99 cbrt for X ** (1./3.)


Richard Guenther wrote:

It's a matter of making the cbrt builtin available - I have a patch for this, but wondered if the fortran frontend can rely on the cbrt library call being available? Or available in a fast variant, not a fallback implementation in libgfortran which does pow (x, 1./3.) which will then of course pessimize
pow (x, 2./3.) -> tmp = cbrt(x); tmp * tmp expansion.

Couldn't libgfortran just simply borrow, errr, include the glibc version ? That one seems simple and fast enough.


OTOH, I somehow assumed this expansion was protected by -funsafe-math-optimizations, but further testing showed me that it is not.

This wouldn't scare me one bit (I'm used to the phrase "a processor dependent approximation to the value of", which is used *a lot* in the Fortran Standard), but some people might think this to be too valiant.

--
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
A maintainer of GNU Fortran: http://gcc.gnu.org/fortran/
Who's working on GNU Fortran: http://gcc.gnu.org/ml/gcc/2006-01/msg00000.html



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]