Mail Archives: djgpp/1997/02/28/08:31:29
> A loop such as
>
> register int i,j;
> for (i=0; i<15; i++) {
> /* simple arithmetic */
> for (j=0; j<21; j++) {
> /* Function call and some math */
> }
> /* More math */
> }
hardly a great surprise seeing as the loop above would quite probably fit in
the cache when well optimised, but unrolled would thrash it horribly.
unrolling loops won't save an enormous amount of time, after all a jump
instruction will only take you 3 or 4 cycles at most.
nik
--
Graham Tootell
nikki AT gameboutique DOT com
- Raw text -