[fortran PATCH] Implement a(:,:) = 0.0 using memset (take 2)
Andrew Pinski
pinskia@physics.uc.edu
Tue Dec 19 03:10:00 GMT 2006
>
>
> ------=_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
More information about the Fortran
mailing list