This is the mail archive of the
mailing list for the GCC project.
Re: [fortran PATCH] Implement a(:,:) = 0.0 using memset (take 2)
- From: roger at eyesopen dot com
- To: "Steve Kargl" <sgk at troutmask dot apl dot washington dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Wed, 20 Dec 2006 10:56:22 -0700 (MST)
- Subject: Re: [fortran PATCH] Implement a(:,:) = 0.0 using memset (take 2)
- References: <B7EFA6A886FE514B8F7F3E277D8F7FB0FFA277@ukaprdembx01.rd.astrazeneca.net>
> 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?