From: Eric Botcazou <ebotcazou@adacore.com>
To: sgk@troutmask.apl.washington.edu
Cc: gcc-patches@gcc.gnu.org, gfortran <fortran@gcc.gnu.org>
Subject: Re: [fortran] Add support for #pragma GCC unroll v3
Date: Wed, 06 Dec 2017 09:21:00 -0000 [thread overview]
Message-ID: <3974132.UbLS4EJLdD@polaris> (raw)
In-Reply-To: <20171125173149.GB40985@troutmask.apl.washington.edu>
[-- Attachment #1: Type: text/plain, Size: 445 bytes --]
> 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
[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 1285 bytes --]
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
next prev parent reply other threads:[~2017-12-06 9:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-25 17:31 Eric Botcazou
2017-11-25 18:57 ` Steve Kargl
2017-11-28 9:59 ` Eric Botcazou
2017-12-06 9:21 ` Eric Botcazou [this message]
2017-12-08 12:23 ` Janne Blomqvist
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3974132.UbLS4EJLdD@polaris \
--to=ebotcazou@adacore.com \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=sgk@troutmask.apl.washington.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).