On 11/27/18 10:11 PM, Thomas Koenig wrote: > Am 27.11.18 um 17:22 schrieb Steve Ellcey: >> Why wouldn't clang (flang) want to use the same mechanism as >> GCC/gfortran? I know there is some interest/work going on here for >> flang and we would like a consistent way to use pre-includes to define >> SIMD vector functions in both gfortran and flang. I think this should >> be documented so flang and other compilers can use it. Even if no >> other compilers did use it I think it should be documented because it >> crosses project/package boundries, i.e. it is created by glibc and used >> by gfortran. > > Absolutely. > > As soon as this is committed, we should document all the > specifics in the gfortran manual. > > Regards > > Thomas
Hi. As I installed all needed patches, I'm sending a documentation entry for the new functionality. Thoughts? Thanks, Martin
>From 2d304e3b1d734548811f963c5bed1855b5375c43 Mon Sep 17 00:00:00 2001 From: marxin <mli...@suse.cz> Date: Mon, 18 Feb 2019 14:21:56 +0100 Subject: [PATCH] Document Fortran header directive. --- gcc/fortran/gfortran.texi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index 02ff32f741f..72771a851f7 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -3596,6 +3596,25 @@ loop that follows. N is an integer constant specifying the unrolling factor. The values of 0 and 1 block any unrolling of the loop. +@node BUILTIN directive +@subsection BUILTIN directive + +The syntax of the directive is + +@code{!GCC$ BUILTIN (B) attributes simd FLAGS IF('target')} + +You can used this directive to define which middle-end built-ins have vector +implementation. B is name of the middle-end built-in. FLAGS are optional +and must have be either "(inbranch)" or "(notinbranch)". IF statement +is optional and is used to filter multilib ABIs for that +the built-in should be vectorized. Example usage: + +@smallexample +!GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64') +@end smallexample + +The purpose of the directive is to provide an API among the GCC compiler and +the GNU C Library which would define vector implementation of math routines. @node Non-Fortran Main Program @section Non-Fortran Main Program -- 2.20.1