Interruptible Code Generation
7-6
7.4
Interruptible Code Generation
The ’C6000 code generation tools provide a large degree of flexibility for inter-
ruptibility. Various combinations of single and multiple assignment code can
be generated automatically to provide the best tradeoff in interruptibility and
performance for each part of an application. In most cases, code performance
is not affected by interruptibility, but there are some exceptions:
-
Software pipelined loops that have high register pressure can fail to allo-
cate registers at a given iteration interval when single assignment is re-
quired, but might otherwise succeed to allocate if multiple assignment
were allowed. This can result in a larger iteration interval for single assign-
ment software pipelined loops and thus lower performance. To determine
if this is a problem for looped code, use the -mw feedback option. If you
see a “Cannot allocate machine registers” message after the message
about searching for a software pipeline schedule, then you have a register
pressure problem.
-
Because loops with minimum iteration intervals less than 6 are not inter-
ruptible, higher iteration intervals might be used which results in lower per-
formance. Unrolling the loop, however, prevents this reduction in perfor-
mance (See section 7.4.4.)
-
Higher register pressure in single assignment can cause data spilling to
memory in both looped code and non-looped code when there are not
enough registers to store all temporary values. This reduces performance
but occurs rarely and only in extreme cases.
The tools provide 3 levels of control to the user. These levels are described in
the following sections. For a full description of interruptible code generation,
see the
TMS320C6000 Optimizing C/C++ Compiler User’s Guide.
7.4.1
Level 0 - Specified Code is Guaranteed to Not Be Interrupted
At this level, the compiler does not disable interrupts. Thus, it is up to you to
guarantee that no interrupts occur. This level has the advantage that the com-
piler is allowed to use multiple assignment code and generate the minimum
iteration intervals for software pipelined loops.
The command line option -mi (no value specified) can be used for an entire
module and the following pragma can be used to force this level on a particular
function:
#pragma
FUNC_INTERRUPT_THRESHOLD(func, uint_max);