PDA

View Full Version : Pentium Branch Prediction


atc_traffic856
03-01-2002, 06:07 PM
Can someone explain what exactly is Branch Prediction that a CPU can use?
I have tried to look up more on this subject, but here is very little availiable. It deals with Cache {internal} one pipeline is data and the other is for programs. The program pipeline uses branch prediction, this is what I am a little confused?
Thank you.

Ghost_Hacker
03-01-2002, 09:46 PM
Most programs are made of branches. A branch is alot like an "If..then..else statment" (a conditional branch) or a "goto" statement (a unconditional branch)

To increase performance CPUs have branch prediction that enables them to "guess" what the result of a conditional branch statement will be and fetch the data or run the code that's after the branch before the branch returns a result. If they're right you get faster excution of code, if they're wrong the pipeline must be flushed and you get slugglish program excution.

Hope this helps http://www.PCGuide.com/ubb/smile.gif



[This message has been edited by Ghost_Hacker (edited 03-01-2002).]

atc_traffic856
03-02-2002, 09:40 AM
Thank you for your help, it is now becoming alot clearer. These branches that are programs which are code will be executed in the next phase; immediately after compilation to machine language, if I am wrong in saying this please correct>>> I try to do as much research as I possibly can before I request a reply. Even if the editors or the people that answer my request for help, is on a info site a direction would be well accepted, for I can realize that the questions can be very numerous, and could be very well research by the individual. So thank you again/

Ghost_Hacker
03-03-2002, 05:37 AM
Yes, that's it. The branch prediction guesses what the next "phase" will be and excutes that code.