This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran] Add support for #pragma GCC unroll v3
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: sgk at troutmask dot apl dot washington dot edu
- Cc: gcc-patches at gcc dot gnu dot org, gfortran <fortran at gcc dot gnu dot org>
- Date: Wed, 06 Dec 2017 10:21:15 +0100
- Subject: Re: [fortran] Add support for #pragma GCC unroll v3
- Authentication-results: sourceware.org; auth=none
- References: <1957613.VqFDUkVbj2@polaris> <20171125173149.GB40985@troutmask.apl.washington.edu>
> 6.1 Extensions implemented in GNU Fortran
> 7.2 GNU Fortran Compiler Directives
>
> 6.1 describes extension covering legacy code and vendor extensions.
> 7.2 describes other !$GCC directives. Currently, the section is
> mainly calling conventions (CDECL, STDCALL, etc) and library
> macroc (DLLEXPORT). These should probably be in 7.2.1 and the
> UNROLL directive in 7.2.2.
Attached is a minimal patch along these lines.
--
Eric Botcazou
Index: fortran/gfortran.texi
===================================================================
--- fortran/gfortran.texi (revision 255437)
+++ fortran/gfortran.texi (working copy)
@@ -3423,6 +3423,14 @@ as this requires the new array descripto
@node GNU Fortran Compiler Directives
@section GNU Fortran Compiler Directives
+@menu
+* ATTRIBUTES directive::
+* UNROLL directive::
+@end menu
+
+@node ATTRIBUTES directive
+@subsection ATTRIBUTES directive
+
The Fortran standard describes how a conforming program shall
behave; however, the exact implementation is not standardized. In order
to allow the user to choose specific implementation details, compiler
@@ -3496,6 +3504,19 @@ of the procedure; for variables and proc
the same declaration part as the variable or procedure pointer.
+@node UNROLL directive
+@subsection UNROLL directive
+
+The syntax of the directive is
+
+@code{!GCC$ unroll N}
+
+You can use this directive to control how many times a loop should be unrolled.
+It must be placed immediately before a @code{DO} loop and applies only to the
+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 Non-Fortran Main Program
@section Non-Fortran Main Program