
Contents
x
2.6
Using Inline Function Expansion
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.1
Inlining Intrinsic Operators
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.2
Controlling Inline Function Expansion (
−
x Option)
. . . . . . . . . . . . . . . . . . . . . . .
2.6.3
Using the inline Keyword
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6.4
The _INLINE Preprocessor Symbol
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.7
Using the Interlist Utility
2.8
Understanding and Handling Compiler Errors
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.8.1
Generating an Error Listing (
−
pr Option)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.8.2
Treating Code-E Errors as Warnings (
−
pe Option)
. . . . . . . . . . . . . . . . . . . . . .
2.8.3
Altering the Level of Warning Messages (
−
pw Option)
. . . . . . . . . . . . . . . . . . .
2.8.4
An Example of How You Can Use Error Options
. . . . . . . . . . . . . . . . . . . . . . . .
2.9
Invoking the Tools Individually
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.9.1
Invoking the Parser
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.9.2
Parsing in Two Passes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.9.3
Invoking the Optimizer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.9.4
Invoking the Code Generator
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.9.5
Invoking the Interlist Utility
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
Optimizing Your Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Describes how to optimize your C code, including such features as software pipelining and loop
unrolling. Also describes the types of optimizations that are performed when you use the opti-
mizer.
3.1
Using the C Compiler Optimizer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2
Using the
−
o3 Option
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.1
Controlling File-Level Optimization (
−
oln Option)
. . . . . . . . . . . . . . . . . . . . . . . . .
3.2.2
Creating an Optimization Information File (
−
onn Option)
. . . . . . . . . . . . . . . . . .
3.3
Performing Program-Level Optimization (
−
pm and
−
o3 Options)
. . . . . . . . . . . . . . . . . .
3.3.1
Controlling Program-Level Optimization (
−
opn Option)
. . . . . . . . . . . . . . . . . . .
3.3.2
Optimization Considerations When Mixing C and Assembly
. . . . . . . . . . . . . . .
3.3.3
Naming the Program Compilation Output File (
−
px Option)
. . . . . . . . . . . . . . . .
3.4
Special Considerations When Using the Optimizer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.1
Use Caution With asm Statements in Optimized Code
. . . . . . . . . . . . . . . . . . .
3.4.2
Use Caution With the Volatile Keyword
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.3
Use Caution When Accessing Aliased Variables
. . . . . . . . . . . . . . . . . . . . . . . .
3.4.4
Assume Functions Are Not Interrupts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5
Automatic Inline Expansion (
−
oi Option)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.6
Using the Interlist Utility With the Optimizer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7
Debugging Optimized Code
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8
What Kind of Optimization Is Being Performed?
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.1
Cost-based Register Allocation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.2
Autoincrement Addressing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.3
Repeat Blocks
3.8.4
Delays, Banches, Calls, and Returns
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.5
Algebraic Reordering / Symbolic Simplification / Constant Folding
3.8.6
Alias Disambiguation
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Содержание TMS320C2x
Страница 8: ...viii...
Страница 69: ...2 47 C Compiler Description...
Страница 159: ...6 36...
Страница 226: ...8 6...
Страница 250: ...Index Index 14 Z z shell option 2 2 2 4 2 14 overriding with c option 4 5 overriding with n option 2 13...