System and method for branch prediction using two branch history tables and presetting a global branch history register
First Claim
Patent Images
1. A method, comprising:
- providing a program to be executed in accordance with a speculative address;
executing the program, the program comprising a procedure;
setting bits in a taken branch history register to indicate whether a branch is taken or not taken during execution of instructions in the program;
calling the procedure in the program; and
overwriting, responsive to calling the procedure, contents of the taken branch history register to a start address for the procedure;
accessing, using a hash block, a first branch history table based on contents of the taken branch history register for a first prediction of whether a current branch will be taken or not taken;
accessing, using the hash block, a second branch history table based on the contents of the taken branch history register for a second prediction of whether the current branch will be taken or not taken; and
determining whether the first prediction or the second prediction is used based on whether a selection value in a selection entry of a selector table is equal to or greater than a threshold value.
6 Assignments
0 Petitions
Accused Products
Abstract
A method and system for branch prediction are provided herein. The method includes executing a program, wherein the program comprising multiple procedures, and setting bits in a taken branch history register to indicate whether a branch is taken or not taken during execution of instructions in the program. The method further includes the steps of calling a procedure in the program and overwriting, responsive to calling the procedure, the contents of the taken branch history register to a start address for the procedure.
-
Citations
21 Claims
-
1. A method, comprising:
-
providing a program to be executed in accordance with a speculative address; executing the program, the program comprising a procedure; setting bits in a taken branch history register to indicate whether a branch is taken or not taken during execution of instructions in the program; calling the procedure in the program; and overwriting, responsive to calling the procedure, contents of the taken branch history register to a start address for the procedure; accessing, using a hash block, a first branch history table based on contents of the taken branch history register for a first prediction of whether a current branch will be taken or not taken; accessing, using the hash block, a second branch history table based on the contents of the taken branch history register for a second prediction of whether the current branch will be taken or not taken; and determining whether the first prediction or the second prediction is used based on whether a selection value in a selection entry of a selector table is equal to or greater than a threshold value. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. An apparatus, comprising:
-
an instruction cache; and a branch prediction unit configured to supply a speculative address to the instruction cache, the branch prediction unit comprising; a taken branch history register configured to store bits that indicate whether a branch is taken during execution of instructions in a program, wherein the program includes a procedure; a preset circuit configured to overwrite contents of the taken branch history register to a start address for the procedure; a first branch history table including a first prediction of whether a current branch will be taken or not taken; a second branch history table including a second prediction of whether the current branch will be taken or not taken; a selector table including a selection value in a selection entry; and a hash block configured to determine whether the first prediction or the second prediction is used based on whether the selection value is equal to or greater than a threshold value. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19, 20)
-
-
21. An apparatus, comprising:
-
a taken branch history register configured to store bits that indicate whether a branch is taken during execution of instructions in a program, wherein the program includes a procedure; a preset circuit configured to overwrite contents of the taken branch history register to a start address for the procedure; a first branch history table including a first prediction of whether a current branch will be taken or not taken; a second branch history table including a second prediction of whether the current branch will be taken or not taken; a selector table including a selection value in a selection entry; and a hash block configured to determine whether the first prediction or the second prediction is used based on whether the selection value is equal to or greater than a threshold value.
-
Specification