Assembly Optimizer Options and Directives
6-4
6.2
Assembly Optimizer Options and Directives
All directives and options that are described in the following sections are listed
in greater detail in Chapter 4 of the
TMS320C6000 Optimizing C/C++ Compil-
er User’s Guide.
6.2.1
The –o
n Option
Software pipelining requires the -o2 or -o3 option. Not specifying -o2 or -o3 fa-
cilitates faster compile time and ease of development through reduced opti-
mization.
6.2.2
The –mt Option and the .no_mdep Directive
Because the assembly optimizer has no idea where objects you are accessing
are located when you perform load and store instructions, the assembly opti-
mizer is by default very conservative in determining dependencies between
memory operations. For example, let us say you have the following loop de-
fined in a linear assembly file:
Example 6–1. Linear Assembly Block Copy
loop:
ldw *reg1++, reg2
add reg2, reg3, reg4
stw reg4, *reg5++
[reg6]
add –1, reg6, reg6
[reg6]
b
loop
The assembly optimizer will make sure that each store to “reg5” completes be-
fore the next load of “reg1”. A suboptimal loop would result if the store to ad-
dress in reg5 in not in the next location to be read by “reg1”. For loops where
“reg5” is pointing to the next location of “reg1”, this is necessary and implies
that the loop has a loop carry path. See section 6.7, Loop Carry Paths, on page
6-77 for more information.
For most loops, this is not the case, and you can inform the assembly optimizer
to be more aggressive about scheduling memory operations. You can do this
either by including the “.no_mdep” (no memory dependencies) directive in
your linear assembly function or with the -mt option when you are compiling
the linear assembly file. Be aware that if you are compiling both C code and
linear assembly code in your application, that the -mt option has different
meanings for both C and linear assembly code. In this case, use the .no_mdep
directive in your linear assembly source files.