Optimization Topics/Exercise 03: Difference between revisions
From Wiki**3
No edit summary |
No edit summary |
||
| Line 12: | Line 12: | ||
return c; | return c; | ||
} | } | ||
</source> | </source> | ||
Revision as of 18:06, 14 May 2019
Considere a seguinte função em C:
- Que optimizações independentes da máquina são possíveis?
- Traduza-a para Postfix optimizado.
int fun(int a, int b) {
int i = 10, c;
c = 20 * 1024 + i;
while (++i < a + b) {
if (a + b < 3 * i + 5) c += 2 * i;
}
return c;
}