Download TASKING VX-toolset for RH850 User Guide

Transcript
TASKING VX-toolset for RH850 User Guide
Trade-off value
Try to rewrite top-loops to Optimize loops for
bottom-loops
size/speed
4
yes
size
Example:
int a;
void i( int l, int m )
{
int i;
for ( i = m; i < l; i++ )
{
a++;
}
return;
}
Coded as a bottom loop (compiled with --tradeoff=4) is:
movhi
ld.w
br
@ha(_a),r0,r11
@lo(_a)[r11],r11
.L2
add
add
1,r11
1,r7
cmp
blt
r6,r7
.L3
;; unconditional jump to loop test at bottom
.L3:
.L2:
;; loop entry point
Coded as a top loop (compiled with --tradeoff=0) is:
movhi
ld.w
cmp
bge
@ha(_a),r0,r11
@lo(_a)[r11],r11
r6,r7
.L2
add
add
cmp
blt
1,r11
1,r7
r6,r7
.L3
.L3:
;; test for at least one loop iteration
;; can be omitted when number of iterations is known
;; loop entry point
.L2:
Automatic Function Inlining
You can enable automatic function inlining with the option --optimize=+inline (-Oi) or by using #pragma
optimize +inline. This option is also part of the -O3 predefined option set.
When automatic inlining is enabled, you can use the options --inline-max-incr and --inline-max-size (or
their corresponding pragmas inline_max_incr / inline_max_size) to control automatic inlining.
118