| 전자부품 데이터시트 검색엔진 |
|
AN3350 데이터시트(PDF) 109 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3350 데이터시트(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] |
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 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 |