IP Library › Granted Patent US 12,197,917
Granted Patent B2
US 12,197,917 · App. 17/849,994 · Granted Jan 14, 2025

Exit history based branch prediction

Inventors: Kai Chirca (Dallas, TX); Timothy D. Anderson (University Park, TX); David E. Smith, Jr. (Allen, TX); Paul D. Gauvreau (Dallas, TX)
Assignee: Texas Instruments Incorporated
G06F9/3806G06F9/30101G06F9/3844G06F9/3853G06F9/3858
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,197,917
App. No.
17/849,994
Granted
Jan 14, 2025
Kind
B2
Abstract

A computer-implemented method includes fetching a fetch-packet containing a first hyper-block from a first address of a memory. The fetch-packet contains a bitwise distance from an entry point of the first hyper-block to a predicted exit point. A first branch instruction of the first hyper-block is executed that corresponds to a first exit point. The first branch instruction includes an address corresponding to an entry point of a second hyper-block. Responsive to executing the first branch instruction, a bitwise distance from the entry point of the first hyper-block to the first exit point is stored. A program counter is moved from the first exit point of the first hyper-block to the entry point of the second hyper-block.

Claims (55)

1. A method comprising:

receiving, by a processor, machine-readable instructions that include blocks of instructions that each include an entry point instruction and a set of branch instructions;

during a first iteration of executing a first block of the blocks of instructions:

performing a branch based on a first branch instruction of the first block; and

based on the performing of the branch:

storing a first offset between the entry point instruction of the first block and the first branch instruction in an exit history table according to an index that is based on:

an address of the entry point instruction of the first block; and

an exit history of the first block; and

storing an address of a branch target associated with the first branch instruction; and

during a second iteration of executing the first block:

fetching a subset of instructions of the first block based on the first offset; and

fetching a subset of instructions of a second block of the blocks of instructions based on the address of the branch target associated with the first branch instruction.

2. The method of claim 1 , wherein the entry point instruction of the first block is a sequentially first instruction of the first block.

3. The method of claim 1 , wherein the first offset specifies a number of fetch packets between the entry point instruction of the first block and the first branch instruction and specifies a third offset of the first branch instruction within a fetch packet.

4. The method of claim 1 further comprising, based on the performing of the branch, storing an indicator of frequency with which the first branch instruction results in performing of the branch.

5. The method of claim 4 further comprising updating the indicator of frequency based on whether the first branch instruction results in performing of the branch during the second iteration.

6. The method of claim 4 further comprising updating the indicator of frequency based on whether a second branch instruction of the first block results in performing of a branch during the second iteration.

7. The method of claim 1 , wherein:

the storing of the address of the branch target stores the address of the branch target in a cache.

8. The method of claim 1 , wherein the exit history is a set of values associated with previous exit points of the first block.

9. The method of claim 8 , wherein the index has a value equal to an XOR of the address of the entry point instruction of the first block and the set of values of the exit history of the first block.

10. A method comprising:

receiving, by a processor, machine-readable instructions that include blocks of instructions that each include a sequentially first instruction and a set of branch instructions; and

executing the machine-readable instructions by:

during a first iteration of executing a first block of the blocks of instructions:

performing a branch based on a first branch instruction of the first block; and

based on the performing of the branch:

storing a first offset between the sequentially first instruction of the first block and the first branch instruction in an exit history table according to an index that is based on:

 an address of the sequentially first instruction of the first block; and an exit history of the first block; and

 storing an address of a branch target of the first branch instruction; and

during a second iteration of executing the first block, fetching a subset of instructions of the first block based on the first offset.

11. The method of claim 10 , wherein the first offset specifies a number of fetch packets between the sequentially first instruction of the first block and the first branch instruction and specifies a third offset of the first branch instruction within a fetch packet.

12. The method of claim 10 further comprising, based on the performing of the branch, storing an indicator of frequency with which the first branch instruction results in performing of the branch.

13. An integrated circuit processor comprising:

an instruction pipeline configured to execute machine-readable instructions that include blocks of instructions that each include an entry point instruction and a set of branch instructions; and

a branch predictor circuit that includes:

a first memory configured to store an exit history table; and

a second memory configured to store a branch target table;

wherein the instruction pipeline is configured to:

during a first iteration of executing a first block of the blocks of instructions:

perform a branch based on a first branch instruction of the first block; and

based on the performing of the branch, cause the branch predictor circuit to:

store a first offset between the entry point instruction of the first block and the first branch instruction in the exit history table according to an index that is based on:

 an address of the entry point instruction of the first block; and

 an exit history of the first block; and

store, within the branch target table, an address of a branch target associated with the first branch instruction; and

during a second iteration of executing the first block:

fetch a subset of instructions of the first block based on the first offset; and

fetch a subset of instructions of a second block of the blocks of instructions based on the address of the branch target associated with the first branch instruction.

14. The integrated circuit processor of claim 13 , wherein the entry point instruction of the first block is a sequentially first instruction of the first block.

15. The integrated circuit processor of claim 13 , wherein the first offset specifies a number of fetch packets between the entry point instruction of the first block and the first branch instruction and specifies a third offset of the first branch instruction within a fetch packet.

16. The integrated circuit processor of claim 13 , wherein the instruction pipeline is further configured to, based on the performing of the branch, cause the branch predictor circuit to store an indicator of frequency with which the first branch instruction results in performing of the branch in the first memory.

17. The integrated circuit processor of claim 16 , wherein the branch predictor circuit is configured to update the indicator of frequency based on whether the first branch instruction results in performing of the branch during the second iteration.

18. The integrated circuit processor of claim 16 , wherein the branch predictor circuit is configured to update the indicator of frequency based on whether a second branch instruction of the first block results in performing of a branch during the second iteration.

19. The integrated circuit processor of claim 13 , wherein the first memory includes a set of fields each configured to store a respective value that is based on a respective offset of a previous exit point of the first block.

Continuity (3)
Continuation 16684410 · Nov 14, 2019
Provisional Application 62786861 · Dec 31, 2018
Related Publication 20220326954A1 · Oct 13, 2022
References Cited (6)
US 11372646B2 · Chirca · 2022 [cited by examiner]
US 20160132331A1 · Godard et al. · 2016 [cited by applicant]
US 20200210191A1 · Chirca · 2020 [cited by examiner]
Ranganathan, Nitya et al. Combining Hyperblocks and Exit Prediction to Increase Front-End Bandwith and Performance.: Dept. of Computer Sciences Technical Report TR-02-41, The University of Texas, Austin and Rutgers Stat… [cited by applicant]
“Dynamic Branch Prediction.” CSE P548, Autumn 2006. 15 pages. [cited by applicant]
N. Ranganathan; “Control flow speculation for distributed architectures”; Dissertation for the University of Texas at Austin; May 2009; 330 pages; 2009. [cited by applicant]