-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add a spec for loop unroll
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
\Ch{Statements}{Stmt} | ||
\begin{grammar} | ||
\define{statement}\br | ||
labeled-statement\br | ||
\opt{attribute-specifier-sequence} expression-statement\br | ||
\opt{attribute-specifier-sequence} compound-statement\br | ||
\opt{attribute-specifier-sequence} iteration-statement\br | ||
\opt{attribute-specifier-sequence} selection-statement\br | ||
declaration-statement | ||
\end{grammar} | ||
\Sec{Label Statements}{Stmt.Label} | ||
\p The optional \textit{attribute-specifier-sequence} applies to the statement | ||
that immediately follows it. | ||
\Sec{Attributes}{Stmt.Attr} | ||
\Sub{Unroll Attribute}{Stmt.Attr.Unroll} | ||
\p The \textit{[unroll]} attribute is only valid when applied to | ||
\textit{iteration-statements}. It is used to indicate that | ||
\textit{iteration-statements} like \texttt{for}, \texttt{while} and | ||
\texttt{do while} can be unrolled. This attribute qualifier can be used to | ||
specify full unrolling or partial unrolling by a specified amount. This is a | ||
compiler hint and the compiler may ignore this directive. | ||
|
||
\p The unroll attribute may optionally have an unroll factor represented as a | ||
single argument \texttt{n} that is an integer constant expression value | ||
greater than zero. If n is not specified, the compiler determines the | ||
unrolling factor for the loop. The \textit{[unroll]} attribute can not be | ||
applied to the same \textit{iteration-statement} as the \texttt{[loop]} | ||
attribute. | ||
|
||
\Sub{Loop Attribute}{Stmt.Attr.Loop} | ||
\p The Attribute \texttt{[loop]} tells the compiler to execute each iteration | ||
of the loop. In other words, its a hint to indicate a loop should not be | ||
unrolled. Therefore it is not compatible with the \texttt{[unroll]} attribute. |