This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [fortran] Add support for #pragma GCC unroll v3


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]