> most loops are actually implemented as branches. No kidding! But the article does call attention to a very important technique. It merits serious thought over all the ways it can be applied, that may not look much like this one, on the surface.
Most DSPs have zero overhead loops (still branches) which don't incur a branch penalty. So something like below may take 1-2 cycles atmost, per iteration. for(i=0;i Ofcourse variable length loops would still have the branches.
Compilers prefer to order the instructions so they take two or more cycles.