| Electronic Components Datasheet Search |
|
AN3350 Datasheet(PDF) 109 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3350 Datasheet(HTML) 109 Page - STMicroelectronics |
|
109 / 185 page ![]() AN3350 Intermediate optimizations Doc ID 018512 Rev 2 109/185 For example, in Example 61, the assignment to the variable circ does not refer to the counter variable of the for loop, i. But the assignment to circ will be executed at each loop iteration. Example 62 shows source code that is equivalent to how the compiler would rearrange instructions after applying this optimization. The compiler has moved the assignment to circ outside the for loop so that it is only executed once instead of each time the for loop iterates. Example 61 Before loop-invariant code motion void func_from(float* vec, int max, float val) { float circ; int i; for (i = 0; i < max; ++i) { circ = val * 2 * PI; vec[i] = circ; } } Example 62 After loop-invariant code motion void func_to(float* vec, int max, float val) { float circ; int i; circ = val * 2 * PI; for (i = 0; i < max; ++i) { vec[i] = circ; } } 13.1.8 Strength reduction Strength reduction attempts to replace slower multiplication operations with faster addition operations. This optimization improves execution speed but increases code size. Table 24 explains how to control the optimization for strength reduction. Table 23. Controlling loop-invariant code motion Turn control this option from here... use this setting Source code #pragma opt_loop_invariants on | off | reset Command line -opt [no]loop[invariants] |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |