Download RealView Compilation Tools Compiler Reference Guide

Transcript
Compiler-specific Features
See also
•
__softfp on page 4-15
•
Floating-point computations and linkage on page 5-37 in the Compiler User
Guide.
4.6.24
#pragma unroll [(n)]
This pragma instructs the compiler to unroll a loop by n interations.
Note
Both vectorized and non vectorized loops can be unrolled using #pragma unroll [(n)].
That is, #pragma unroll [(n)] applies to both --vectorize and --no_vectorize.
Syntax
#pragma unroll
#pragma unroll (n)
Where:
n
is an optional value indicating the number of iterations to unroll.
Default
If you do not specify a value for n, the compiler assumes #pragma unroll (4).
Usage
When compiling at -O3 -Otime, the compiler automatically unrolls loops where it is
beneficial to do so. You can use this pragma to request that the compiler to unroll a loop
that has not been unrolled automatically.
Note
Use this #pragma only when you have evidence, for example from
--diag_warning=optimizations, that the compiler is not unrolling loops optimally by
itself.
Restrictions
#pragma unroll [(n)] can be used only immediately before a for loop, a while loop, or
a do ... while loop.
ARM DUI 0348C
ID101213
Copyright © 2007-2010 ARM. All rights reserved.
Non-Confidential,
4-71