This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran PATCH] Implement a(:,:) = 0.0 using memset (take 2)
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: roger at eyesopen dot com
- Cc: sgk at troutmask dot apl dot washington dot edu (Steve Kargl), gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Mon, 18 Dec 2006 21:46:35 -0500 (EST)
- Subject: Re: [fortran PATCH] Implement a(:,:) = 0.0 using memset (take 2)
>
>
> ------=_20061218185522_36006
> Content-Type: text/plain; charset="iso-8859-1"
> Content-Transfer-Encoding: 8bit
>
> As pointed out by Steve Kargl, some of the tests in my recent patch were
> overly conservative, and only handled pointers to arrays, rather than
> local arrays. The revised patch below addresses this limitation/oversight
> and allows us to use __builtin_memset in more cases.
>
> As an example, consider the following test case that's reduced from
> polyhedron's fatigue benchmark.
>
> module fatigue
> integer, parameter :: LONGreal = selected_real_kind(15,90)
>
> contains
> function generalized_hookes_law (mu) result (stress_tensor)
> real (kind = LONGreal), intent(in) :: mu
> real (kind = LONGreal), dimension(3,3) :: stress_tensor
> real (kind = LONGreal), dimension(6,6) :: generalized_constitutive_tensor
>
> generalized_constitutive_tensor(:,:) = 0.0_LONGreal
> end function
>
> end fatigue
>
> + case BT_REAL:
> + return mpfr_sgn (expr->value.real) == 0;
How well does the above handle -0's?
Thanks,
Andrew Pinski