On 12/5/06, Toon Moene <[EMAIL PROTECTED]> wrote:
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.
Does libgfortran have a cbrt now? The frontend could make the
builtin available conditional on TARGET_C99_FUNCTIONS, this
way we won't need a fallback.
OTOH, I somehow assumed this expansion was protected by
-funsafe-math-optimizations, but further testing showed me that it is not.
Yes, that was a mistake. I posted a patch for this:
http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00320.html
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.
Yes, I guess so ;)
Richard.