Cost-Based Register Allocation - Texas Instruments TMS320C2x User Manual

Optimizing c compiler digital signal processor
Hide thumbs Also See for TMS320C2x:
Table of Contents

Advertisement

3.8.1

Cost-based Register Allocation

3.8.2
Autoincrement Addressing
3.8.3
Repeat Blocks
The optimizer, when enabled, allocates registers to user variables and com-
piler temporary values according to their type, use, and frequency. Variables
used within loops are weighted to have priority over others, and those vari-
ables whose uses do not overlap may be allocated to the same register.
For pointer expressions of the form
TMS320C2x/C2xx/C5x autoincrement addressing modes. In many cases,
where code steps through an array in a loop, such as for (i = 0; i < n; ++i) a[i ]...,
the loop optimizations convert the array references to indirect references
through autoincremented register variable pointers. See Example 3−1.
The TMS320C2x/C2xx/C5x supports zero-overhead loops with the RPTB (re-
peat block) instruction. With the optimizer, the compiler can detect loops con-
trolled by counters and generate them using the efficient repeat forms. The it-
eration count can be either a constant or an expression. For the TMS320C2x,
which does not have a repeat block instruction, the compiler allocates an AR
as the loop counter and implements the loop with a BANZ instruction. See
Example 3−1 and Example 3−5.
What Kind of Optimization Is Being Performed?
the compiler uses efficient
*p++,
Optimizing Your Code
3-15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tms320c2xxTms320c5x

Table of Contents