# US 10,956,161 B2 · Indirect target tagged geometric branch prediction using a set of target address pattern data

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,956,161 B2
- Document ID: US10956161B2
- Status: Granted
- Kind: B2
- Application number: 16/247,714
- Filed: 2019-01-15
- Published: 2019-05-30
- Granted: 2021-03-23
- Earliest claimed: 2017-04-27
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Satish Kumar Sadasivam; Puneeth A. H. Bhat; Shruti Saxena
- Web page: https://patentgrep.com/patent/US10956161B2

## CPC

- G06F 9/3806: {using address prediction, e.g. return stack, branch history buffer}
- G06F 9/30021: {Compare instructions, e.g. Greater-Than, Equal-To, MINMAX}
- G06F 9/3844: {using dynamic branch prediction, e.g. using branch history tables}
- G06F 9/3848: {using hybrid branch prediction, e.g. selection between prediction techniques}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Provided is a method for predicting a target address using a set of Indirect Target TAgged GEometric (ITTAGE) tables and a target address pattern table. A branch instruction that is to be executed may be identified. A first tag for the branch instruction may be determined. The first tag may be a unique identifier that corresponds to the branch instruction. Using the tag, the branch instruction may be determined to be in a target address pattern table, and an index may be generated. A predicted target address for the branch instruction may be determined using the generated index and the largest ITTAGE table. Instructions associated with the predicted target address may be fetched.

## Claims

### Claim 1

A method for predicting a target address using a set of Indirect Target TAgged GEometric (ITTAGE) tables and a target address pattern table, the method comprising:
generating a target address pattern table, wherein the target address pattern table includes one or more records, each record corresponding to a particular branch instruction that was incorrectly predicted from an ITTAGE table having the longest history;
identifying a branch instruction to be executed by a processor;
determining a first tag for the branch instruction, the first tag being a unique identifier that corresponds to the branch instruction;
determining, using the first tag, that the branch instruction is in the target address pattern table;
generating an index;
determining, using the generated index and a largest ITTAGE table from the set of ITTAGE tables, a predicted target address for the branch instruction; and
fetching instructions associated with the predicted target address.

### Claim 2 (depends on 1)

The method of claim 1, wherein the determining, using the first tag, that the branch instruction is in the target address pattern table includes:
retrieving, using a program counter associated with the branch instruction as a pattern table index, a record from the target address pattern table;
comparing a second tag found in the retrieved record to the first tag for the branch instruction; and
determining that the first tag and the second tag match.

### Claim 3 (depends on 1)

The method of claim 1, wherein the generating the index includes:
retrieving, using a program counter associated with the branch instruction as a pattern table index, a record from the target address pattern table;
identifying, from the retrieved record, a pattern associated with the branch instruction, the pattern including a set of bits extracted from an actual target address associated with the branch instruction, the actual target address being a target address that was executed the last time the branch instruction was executed; and
combining the program counter, the pattern, and a global history vector (GHV) using folding-XOR logic.

### Claim 4 (depends on 1)

The method of claim 1, the method further comprising:
speculatively executing the fetched instructions associated with the predicted target address.

### Claim 5 (depends on 1)

The method of claim 1, wherein the generating the target address pattern table includes:
determining, at a first time, that a first branch is not in the target address pattern table;
deriving a target address prediction for the first branch using a program counter value for the first branch, a global history vector, and the set of ITTAGE tables;
determining, by comparing the target address prediction to an actual target address associated with the first branch, that the target address prediction is incorrect;
determining a third tag and a pattern for the first branch, wherein the third tag is a unique identifier for the first branch, and wherein the pattern is a set of bits extracted from the actual target address associated with the first branch; and
storing the third tag and the pattern in the target address pattern table.

### Claim 6 (depends on 5)

The method of claim 5, the method further comprising:
continuously monitoring the first branch in response to the first branch being stored in the target address pattern table;
determining a second predicted target address for the first branch using the set of ITTAGE tables, the global history vector, the program counter value, and the target address pattern table, wherein the second predicted target address is determined in response to the first branch executing at a second time that is subsequent to the first time;
identifying a correct target address for the first branch; and
updating the target address pattern table using the correct target address, wherein the updating includes replacing the pattern in the target address pattern table with a second pattern, the second pattern being generated using the correct target address.

### Claim 7

A system comprising:
a memory; and
a processing circuit in communication with the memory, the processing circuit being configured to perform a method comprising:
generating a target address pattern table, wherein the target address pattern table includes one or more records, each record corresponding to a particular branch instruction that was incorrectly predicted from an ITTAGE table having the longest history;
identifying a branch instruction to be executed;
determining a first tag for the branch instruction, the first tag being a unique identifier that corresponds to the branch instruction;
determining, using the first tag, that the branch instruction is in the target address pattern table;
generating an index;
determining, using the generated index and a largest ITTAGE table from a set of ITTAGE tables, a predicted target address for the branch instruction; and
fetching instructions associated with the predicted target address.

### Claim 8 (depends on 7)

The system of claim 7, wherein the determining, using the first tag, that the branch instruction is in the target address pattern table includes:
retrieving, using a program counter associated with the branch instruction as a pattern table index, a record from the target address pattern table;
comparing a second tag found in the retrieved record to the first tag for the branch instruction; and
determining that the first tag and the second tag match.

### Claim 9 (depends on 7)

The system of claim 7, wherein the generating the index includes:
retrieving, using a program counter associated with the branch instruction as a pattern table index, a record from the target address pattern table;
identifying, from the retrieved record, a pattern associated with the branch instruction, the pattern including a set of bits extracted from an actual target address associated with the branch instruction, the actual target address being a target address that was executed the last time the branch instruction was executed; and
combining the program counter, the pattern, and a global history vector (GHV) using folding-XOR logic.

### Claim 10 (depends on 7)

The system of claim 7, wherein the method performed by the processing circuit further comprises:
speculatively executing the fetched instructions associated with the predicted target address.

### Claim 11 (depends on 7)

The system of claim 7, wherein the generating the target address pattern table includes:
determining, at a first time, that a first branch is not in the target address pattern table;
deriving a target address prediction for the first branch using a program counter value for the first branch, a global history vector, and the set of ITTAGE tables;
determining, by comparing the target address prediction to an actual target address associated with the first branch, that the target address prediction is incorrect;
determining a third tag and a pattern for the first branch, wherein the third tag is a unique identifier for the first branch, and wherein the pattern is a set of bits extracted from the actual target address associated with the first branch; and
storing the third tag and the pattern in the target address pattern table.

### Claim 12 (depends on 11)

The system of claim 11, wherein the method performed by the processing circuit further comprises:
continuously monitoring the first branch in response to the first branch being stored in the target address pattern table;
determining a second predicted target address for the first branch using the set of ITTAGE tables, the global history vector, the program counter value, and the target address pattern table, wherein the second predicted target address is determined in response to the first branch executing at a second time that is subsequent to the first time;
identifying a correct target address for the first branch; and
updating the target address pattern table using the correct target address, wherein the updating includes replacing the pattern in the target address pattern table with a second pattern, the second pattern being generated using the correct target address.

### Claim 13

A computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising:
generating a target address pattern table, wherein the target address pattern table includes one or more records, each record corresponding to a particular branch instruction that was incorrectly predicted from an ITTAGE table having the longest history;
identifying a branch instruction to be executed;
determining a first tag for the branch instruction, the first tag being a unique identifier that corresponds to the branch instruction;
determining, using the first tag, that the branch instruction is in the target address pattern table;
generating an index;
determining, using the generated index and a largest ITTAGE table from a set of ITTAGE tables, a predicted target address for the branch instruction; and
fetching instructions associated with the predicted target address.

### Claim 14 (depends on 13)

The computer program product of claim 13, wherein the determining, using the first tag, that the branch instruction is in the target address pattern table includes:
retrieving, using a program counter associated with the branch instruction as a pattern table index, a record from the target address pattern table;
comparing a second tag found in the retrieved record to the first tag for the branch instruction; and
determining that the first tag and the second tag match.

### Claim 15 (depends on 13)

The computer program product of claim 13, wherein the generating the index includes:
retrieving, using a program counter associated with the branch instruction as a pattern table index, a record from the target address pattern table;
identifying, from the retrieved record, a pattern associated with the branch instruction, the pattern including a set of bits extracted from an actual target address associated with the branch instruction, the actual target address being a target address that was executed the last time the branch instruction was executed; and
combining the program counter, the pattern, and a global history vector (GHV) using folding-XOR logic.

### Claim 16 (depends on 13)

The computer program product of claim 13, wherein the method performed by the processor further comprises:
speculatively executing the fetched instructions associated with the predicted target address.

### Claim 17 (depends on 13)

The computer program product of claim 13, wherein the generating the target address pattern table includes:
determining, at a first time, that a first branch is not in the target address pattern table;
deriving a target address prediction for the first branch using a program counter value for the first branch, a global history vector, and the set of ITTAGE tables;
determining, by comparing the target address prediction to an actual target address associated with the first branch, that the target address prediction is incorrect;
determining a third tag and a pattern for the first branch, wherein the third tag is a unique identifier for the first branch, and wherein the pattern is a set of bits extracted from the actual target address associated with the first branch;
storing the third tag and the pattern in the target address pattern table;
continuously monitoring the first branch in response to the first branch being stored in the target address pattern table;
determining a second predicted target address for the first branch using the set of ITTAGE tables, the global history vector, the program counter value, and the target address pattern table, wherein the second predicted target address is determined in response to the first branch executing at a second time that is subsequent to the first time;
identifying a correct target address for the first branch; and
updating the target address pattern table using the correct target address, wherein the updating includes replacing the pattern in the target address pattern table with a second pattern, the second pattern being generated using the correct target address.
