www.ti.com
Changing the Compiler's Behavior with Options
19
SPRU514P–January 2018
Submit Documentation Feedback
Copyright © 2018, Texas Instruments Incorporated
Using the C/C++ Compiler
2.3 Changing the Compiler's Behavior with Options
Options control the operation of the compiler. This section provides a description of option conventions
and an option summary table. It also provides detailed descriptions of the most frequently used options,
including options used for type-checking and assembling.
For a help screen summary of the options, enter cl2000 with no parameters on the command line.
The following apply to the compiler options:
• There are typically two ways of specifying a given option. The "long form" uses a two hyphen prefix
and is usually a more descriptive name. The "short form" uses a single hyphen prefix and a
combination of letters and numbers that are not always intuitive.
• Options are usually case sensitive.
• Individual options cannot be combined.
• An option with a parameter should be specified with an equal sign before the parameter to clearly
associate the parameter with the option. For example, the option to undefine a constant can be
expressed as --undefine=name. Likewise, the option to specify the maximum amount of optimization
can be expressed as -O=3. You can also specify a parameter directly after certain options, for example
-O3 is the same as -O=3. No space is allowed between the option and the optional parameter, so -O 3
is not accepted.
• Files and options except the --run_linker option can occur in any order. The --run_linker option must
follow all compiler options and precede any linker options.
You can define default options for the compiler by using the C2000_C_OPTION environment variable. For
a detailed description of the environment variable, see Section 2.4.1.
Table 2-6 through Table 2-28 summarize all options (including link options). Use the references in the
tables for more complete descriptions of the options.
Table 2-1. Processor Options
Option Alias Effect Section
--silicon_version=28 -v28 Specifies TMS320C28x architecture. The default (and only value
accepted) is 28. This option is no longer required.
Section 2.3.4
--unified_memory -mt Generates code for the unified memory model. Section 2.3.4
--cla_support[=cla0|cla1|cla2] Specifies TMS320C28x CLA accelerator support for Type 0, Type 1,
or Type 2. Default is cla0.
Section 2.3.4
--float_support={fpu32|softlib} Specifies use of TMS320C28x 32-bit hardware floating-point support.
The default is softlib.
Section 2.3.4
--tmu_support[=tmu0] Enables support for the Trigonometric Math Unit (TMU). Using this
option also enables FPU32 support (as with --float_support=fpu32).
If this option is used but no value is specified, the default is tmu0.
Section 2.3.4
--vcu_support[=vcu0|vcu2] Specifies C28x VCU coprocessor support Type 0 or Type 2. Default
is vcu0.
Section 2.3.4
(1)
Note: Machine-specific options (see Table 2-11) can also affect optimization.
Table 2-2. Optimization Options
(1)
Option Alias Effect Section
--opt_level=off Disables all optimization (default). Section 3.1
--opt_level=n -On Level 0 (-O0) optimizes register usage only.
Level 1 (-O1) uses Level 0 optimizations and optimizes locally.
Level 2 (-O2) uses Level 1 optimizations and optimizes globally.
Level 3 (-O3) uses Level 2 optimizations and optimizes the file. ()
Level 4 (-O4) uses Level 3 optimizations and performs link-time
optimization. ()
Section 3.1,
Section 3.2,
Section 3.4
--opt_for_space=n -ms Controls code size on four levels (0, 1, 2, and 3). Section 3.13
--fp_mode={relaxed|strict} Enables or disables relaxed floating-point mode. Section 2.3.3
--fp_reassoc={on|off} Enables or disables the reassociation of floating-point arithmetic. Section 2.3.3