This is the mail archive of the
mailing list for the GCC project.
Re: libmvec simd math functions in fortran
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Toon Moene <toon at moene dot org>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Fri, 3 Nov 2017 10:50:16 +0100
- Subject: Re: libmvec simd math functions in fortran
- Authentication-results: sourceware.org; auth=none
- References: <59F9F4EF.email@example.com> <20171101162641.GC14653@tucnak> <firstname.lastname@example.org>
On Thu, Nov 2, 2017 at 7:42 PM, Toon Moene <email@example.com> wrote:
> On 11/01/2017 05:26 PM, Jakub Jelinek wrote:
>> On Wed, Nov 01, 2017 at 04:23:11PM +0000, Szabolcs Nagy wrote:
>>> is there a way to get vectorized math functions in fortran?
>>> in c code there is attribute simd declarations or openmp
>>> declare simd pragma to tell the compiler which functions
>>> have simd variant, but i see no such thing in fortran.
>> !$omp declare simd should work fine in fortran (with -fopenmp
>> or -fopenmp-simd).
> Note that - if you don't want to change the Fortran code, this - almost two
> years old - proposal would work:
> Obviously, I'll only be able to implement this once retirement comes around
> (i.e., after 2023).
I think a better user-interface would be
gfortran ... -include mathvec
which pulls in a pre-def for the vectorized math functions as available.
Somewhere that mathvec "module" needs to reside, ideally it came
from the local glibc install (but module files are GCC version dependent?).
Not sure if gfortran supports -include for module files, OTOH a
-include of fortran source should also work in all contexts(?).
The implementation challenge is
1) actually being able to declare the relevant math functions appropriately
(say, for -ffixed-form f77 style source)
2) make gfortran pick the FUNCTION_DECLs from those declarations
instead of those generated from the mathbuiltins.def.
Solving 2) would be nice to make this work "manually" anyway.
I'm not quite sure we properly override / merge (for other attributes)
with the builtins.
> Kind regards,
> Toon Moene - e-mail: firstname.lastname@example.org - phone: +31 346 214290
> Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
> At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
> Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news