0

Hello ppl,

Do any of you have a sample branch prediction algorithm? I m trying to study deep into branch prediction and I need to see what things are being used in the code.

Thanks in advance
Sunny

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by mr_s70
0

Branch prediction depends upon which processor family and which exact processor. Branch prediction has changed over time!

For example on older 80x86 processors, "if a branch to an earlier address, then it is predicted that the branch will be taken! As it is a loop!" On newer processors last branch will be remembered and used as a hint. There are also hint pre-processor instructions as to what the branch condition will do!

0

@wildgoose
Thanks for the reply

Can I ask u if u have any algorithm (any processor), that is helpful in understanding the logical flow of branch prediction.

Thanks
Sunnny

0

Here's a branch prediction algorithm:

1. Assume the conditional jump won't jump.

That's it.

Here's another.

1. Assume it will do what it did last time.

0

There's a pretty good explanation on page 293-298 in the book "32/64-Bit 80x86 Assembly Language Architecture".

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.