13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using the C Compilercmp r1,r0blt .L3Coded as a top loop (compiled with --tradeoff=0) is:.L3:.L2:cmp r1,r0 ;; test <strong>for</strong> at least one loop iterationldr r2,.L4 ;; can be omitted when number of iterations is knownldr r3,[r2,#0]bge .L2sub r0,r0,r1;; loop entry pointsubs r0,r0,#1add r0,r0,#1bgt .L3strr3,[r2,#0]Automatic Function InliningYou can enable automatic function inlining with the option --optimize=+inline (-Oi) or by using #pragmaoptimize +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 (ortheir corresponding pragmas inline_max_incr / inline_max_size) to control automatic inlining.By default their values are set to -1. This means that the compiler will select a value depending upon theselected trade-off level. The defaults are:Trade-off value01234inline-max-incr1005020100inline-max-size502520100For example with trade-off value 1, the compiler inlines all functions that are smaller or equal to 25 internalcompiler units. After that the compiler tries to inline even more functions as long as the function will notgrow more than 50%.When these options/pragmas are set to a value >= 0, the specified value is used instead of the valuesfrom the table above.Static functions that are called only once, are always inlined, independent of the values chosen <strong>for</strong>inline-max-incr and inline-max-size.Code CompactionTrade-off levels 0 and 1: code compaction is disabled.Trade-off level 2: only code compaction of matches outside loops.159

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!