On 15 May 2017 at 08:41, Pieter Wiid <pw...@mweb.co.za> wrote:
> With the IF structure, given the normal ratio of comment to "real" data, > you will have a very high percentage of pipeline flush due to incorrect > branch prediction. > Why would prediction of a branch in a loop be notoriously bad? You can't surprise the CPU more than once, can you? Unless you'd test on the rightmost bit of a counter, in which case unrolling the loop a bit might be attractive. Rob