diff --git a/specs/language/statements.tex b/specs/language/statements.tex index 938ca344..f772e89d 100644 --- a/specs/language/statements.tex +++ b/specs/language/statements.tex @@ -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.