Optimization Command-Line Options. NXP CodeWarrior Development Studio
Реклама
Реклама
Chapter 11 Command-Line
This option tells the compiler and linker to generate and lay out Variable Length Encoded
(VLE) instructions. VLE instructions give extra flexibility in instruction encoding and alignment, allowing the compiler and linker to greatly reduce the size of runtime object code with only a small penalty in execution performance.
This option also turns on the
-processor Zen
option.
11.7 Optimization Command-Line Options
This chapter explains the following command-line options:
•
•
•
•
•
11.7.1 -code_merging
Removes duplicated functions to reduce object code size.
Syntax
-code_merging keyword[,...]
The choices for keyword are: all
Use the all
argument to specify that the linker should remove all duplicate functions except one.
safe
Use the safe
argument to specify that only duplicate functions marked as weak should be reduced to one function.
aggressive
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
Freescale Semiconductor, Inc.
139
Optimization Command-Line Options
Use the aggressive
option to specify that the linker should ignore references to function addresses when considering which duplicate functions to remove.
off
Use the off
argument to disable code merging optimization.
Remarks
This linker optimization removes duplicate copies of functions with identical executable code.
The linker does not apply this optimization to functions that have been declared with the
__declspec(no_linker_opts)
directive.
By default the code merging optimization is off.
11.7.2 -far_near_addressing
Simplifies address computations to reduce object code size and improve performance.
Syntax
-far_near_addressing
-nofar_near_addressing
Remarks
This linker optimization simplifies address computations in object code. If an address value is within the range that can be stored in the immediate field of the load immediate instruction, the linker replaces the address's two-instruction computation with a single instruction. An address value that is outside this range still requires two instructions to compute.
The ranges of values that may be stored in the immediate field is
-0x7fff
to
0x8000
for the regular li
instruction and
-0x7ffff
to
0x80000
for e_li
, the VLE (Variable Length
Encoding) instruction.
The linker does not apply this optimization to functions that have been declared with the
__declspec(no_linker_opts)
directive.
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
140 Freescale Semiconductor, Inc.
Chapter 11 Command-Line
11.7.3 -vle_bl_opt
Replaces branch instructions to reduce object code size.
Syntax
-ble_bl_opt
-noble_bl_opt
Remarks
This linker optimization replaces each 32-bit e_bl
instruction with a 16-bit se_bl instruction for a function call when the span of memory between the calling function and called function is sufficiently close.
This optimization requires that the target processor has the Variable Length Encoding
(VLE) extension.
The linker does not apply this optimization to functions that have been declared with the
__declspec(no_linker_opts)
directive.
11.7.4 -vle_enhance_merging
Removes duplicated functions that are called by functions that use VLE instructions to reduce object code size.
Syntax
-vle_enhance_merging
-novle_enhance_merging
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
Freescale Semiconductor, Inc.
141
Изтегляне
Реклама