Category "branch-prediction"

Create a branch history in loop

Consider int t = 0; for( int i = 0; i < 8; i++ ) { for( int j = 0; j < 8; j++ ) { t = t + i*j; } } Ex: Create a branch history table in t =

Optimize a loop for static predict-not-taken? Which prediction problems exist for that in a normal loop?

Which problems arise in the following assembly loop, if Predict Not Taken is chosen by default? Optimize the example to Predict not Taken. addi $s1, $zero, 1024

Anlysing branch prediction accuracy with certain pipelinedepth

Currently I'm studying about branch prediction accuracy and the relation with pipelinedepth and/or using parallel fetching (f.e. in superscalar processors). Is

Why is a conditional move not vulnerable to Branch Prediction Failure?

After reading this post (answer on StackOverflow) (at the optimization section), I was wondering why conditional moves are not vulnerable for Branch Prediction

Why is processing a sorted array faster than processing an unsorted array?

Here is a piece of C++ code that shows some very peculiar behavior. For some strange reason, sorting the data (before the timed region) miraculously makes the l