The Problem with Branching


Any good computer program needs branches. Without if-then, else, while, for, what sort of programs would exist? Simple linear progressions. Each instruction would execute once and only once. That would make most programs a lot longer, and a lot less interesting.

Fortunately, most computers do have some branching statements in their instruction sets. Unfortunately, this poses a major problem for RISC machines. When you have a pipline that needs to be filled to maintain maximum speed, and a branch instruction that may cause one of two different lines of code to execute, what is a computer to do?

There are a few different methods that can be used to overcome this problem. These methods all help to reduce the average performance penalty imposed by branch instructions, or at least overcome the hazard, but none of these methods are able to completely eliminate the penalty in all situations.

So, select one of the methods of dealing with branches from the list to the left and we will describe the method, the problems with it, the gains from using it, and give an example or two that utilize the method.

NEXT: Freezing
Go to the Problems

 

Authors David Sheets and Scott Campbell
References

Hennessy and Patterson. "Computer Architecture, A Quantitative Approach." San Francisco: Morgan Kaufmann Publishers, Inc, 1996.

"1996 Twenty-Third Annual International Symposium on Computer Architecture." Philadelphia: ACM Press, 1996.
Furber, Stephen B. "VLSI RISC Architecture and Organization." New York: Marcel Dekker, Inc, 1989.
Heydin and Panetoo. "RISC Architectures." New York: Chapman and Hall, 1992.