Technical data
#pragma Directives [3]
loops in addition to those automatically aligned by the compiler. In these cases,
you must use the align directive.
The align directive must appear directly preceding a loop or a label; it must not
appear in any other context within local scope. (As described in the previous
subsection, the align directive may appear in global scope to indicate functions
to be aligned.)
The code generated for the statement that follows the align directive is aligned
on the next instruction buffer boundary. An align directive directly preceding
a for loop causes code starting at the second expression of the for statement
to be aligned on an instruction buffer boundary. When any code space is left
unused, either it is filled with NOP instructions or a jump instruction is generated,
whichever executes faster.
Use of the align directive before a label lets you align if...goto loops,
where the label designates the top of the loop that is the target of the goto
statement. However, use of the directive for labels is not restricted to this use.
Any referenced label that is preceded by an align directive will be aligned
on an instruction buffer boundary. If the label is never referenced, the align
directive has no effect.
If a loop following an align directive is tasked, the directive applies only to the
loop in the unitasked section of code. This is because the original loop does not
appear in its original form in the master code and slave function. Any loops that
are not tasked and labels following an align directive in a parallel region are
aligned in all three versions of the generated code (master, slave, and unitasked)
(see Section 3.8.1.1, page 63).
Generally, the align directive has no effect on automatically aligned loops.
However, if a loop is aligned by using the align directive, the resulting increase
in code size may prevent alignment of an outer loop that would normally have
been automatically aligned because the outer loop no longer fits within the
instruction buffers. Conversely, an outer loop that would have been too small to
be aligned, may now be automatically aligned because of the increased size of an
aligned inner loop.
The following example illustrates the use of the align directive when it is
used in local scope for loop alignment:
S–2179–36 89










