This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Gfortran and using C99 cbrt for X ** (1./3.)
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Richard Guenther <rguenther at suse dot de>, gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Tue, 05 Dec 2006 21:32:18 +0100
- Subject: Re: Gfortran and using C99 cbrt for X ** (1./3.)
- References: <4572F12B.9050801@moene.indiv.nluug.nl> <6023412.112991165269059636.JavaMail.root@dtm1eusosrv72.dtm.ops.eu.uu.net>
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