CS211Lecture4Module3

CS211Lecture4Module3 - CS 211: Computer Architecture Branch...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 211: Computer Architecture Branch Prediction Instructor: M. Lancaster
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
02/06/2010 2 Reducing Branch Costs The frequency of branches and jumps demands that we also attack stalls arising from control dependencies As we are able to add parallel and multiple parallel units, branching becomes a constraining factor On an n-issue processor, branches will arrive n times faster
Background image of page 2
02/06/2010 3 Dynamic Branch Prediction Branch prediction buffer Simplest scheme A small memory indexed by the lower portion of the address of the branch instruction Includes a bit that says whether the branch was taken recently or not No other tags Useful only to reduce the branch delay when it its longer than the time to compute the possible target PCs Since we only use low order bits, some other branch instruction could have set the tag The prediction is a hint that is assumed to be correct, if it turns out wrong, the prediction bit is inverted and stored back
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
02/06/2010 4 Dynamic Branch Prediction Branch prediction buffer is a cache The 1 bit scheme has a shortcoming Even if a branch is almost always taken, we will usually predict incorrectly twice, rather than once, when it is not taken Consider a loop branch that is taken nine times in a row then not taken. What is the prediction accuracy for this branch, assuming the prediction bit for this branch remains in the prediction buffer Mispredict on the the first and last predictions, as the loop branch was not taken on the first one as is set to 0. Then on the last loop it will not be taken and the prediction will be wrong again. Down to 80% accuracy here
Background image of page 4
02/06/2010 5 Dynamic Branch Prediction To remedy this situation, 2 bit branch prediction schemes are often used. A prediction must miss twice before it is changed. A specialization of a more general scheme that has a n-bit saturating counter for each entry in the prediction buffer. With n bits,we can take on the values 0 to 2
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/24/2010 for the course CS 211 taught by Professor Staff during the Spring '08 term at George Mason.

Page1 / 26

CS211Lecture4Module3 - CS 211: Computer Architecture Branch...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online