General Compiler Directive: Enables or disables loop unrolling and jamming. These directives can only be applied to iterative DO loops.
cDEC$ UNROLL_AND_JAM [(n)] -or- cDEC$ UNROLL_AND_JAM [=n]
cDEC$ NOUNROLL_AND_JAM
c |
Is one of the following: C (or c), !, or *. (See Syntax Rules for Compiler Directives.) |
n |
Is an integer constant. The range of n is 0 through 255. |
If n is specified, the optimizer unrolls the loop n times. If n is omitted, or if it is outside the allowed range, the optimizer picks the number of times to unroll the loop. The loops are partially unrolled and then the resulting loops are fused ("jammed") back together.
The UNROLL_AND_JAM directive overrides any setting of loop unrolling from the command line. It takes precedence over all other unrolling directives, including NOUNROLL.
To use these directives, compiler option O2 or O3 must be set.
cDEC$ UNROLL_AND_JAM = 4
do i =1, m
b(i) = a(c(i)) + 1
enddo