[fortran PATCH] Implement a(:,:) = 0.0 using memset (take 2)

roger@eyesopen.com roger@eyesopen.com
Wed Dec 20 18:40:00 GMT 2006


Hi Steve,

> I think this is OK for trunk; however, Andrew did bring up
> the potential problem of a signed zero.  I'm not sure if
> -0 occurs very often in Fortran code, but we can guard against
> this by changing your code
> ...
>                   && MPFR_SIGN (expr->value.real) == 1);
> ...
> MPFR_SIGN retrieves the sign bit from the mpfr_t structure.

Many thanks.  Committed to mainline after another bootstrap and
regression test on x86_64-unknown-linux-gnu with a minor tweak;
I was a little paranoid of the " == 1" in this test, so I went with a
slightly more conservative (but equivalent) "MPFR_SIGN (...) >= 0;"
[This avoids the magic number MPFR_POS_SIGN, and the middle-end
prefers comparisons against zero :-)]  I also corrected the ChangeLog
typos spotted by Bernhard.  I hope this was OK.


> As a side note, I found that your patch provides a 7.2% decrease
> in computation time for the Bergen Ocean Model (ie., your patch
> is beneficial!).  There are 176 __builtin_memset calls in BOM
> due to your patch.

I've managed to find the source code for BOM, but is there a particular
release version number and input set you use for benchmarking?

Thanks again.

Roger
--




More information about the Fortran mailing list