IP Library Granted Patent US 12,360,769
Granted Patent B2
US 12,360,769 · App. 18/534,786 · Granted Jul 15, 2025

Branch target buffer operation with auxiliary indirect cache

Inventors: James Youngsae Cho (Los Gatos, CA); Chandramouli Banerjee (Fremont, CA); Rabin Sugumar (Sunnyvale, CA)
Assignee: Akeana, Inc.
G06F9/3806G06F12/0875G06F2212/452
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,360,769
App. No.
18/534,786
Granted
Jul 15, 2025
Kind
B2
Abstract

Disclosed embodiments provide techniques for branch prediction. A processor core is accessed. The processor core is coupled to memory and includes branch prediction circuitry. The branch prediction circuitry includes a branch target buffer (BTB) and an indirect branch target buffer (BTBI). A hashed program counter within the processor core is read. The BTB and BTBI are searched. The searching the BTB is accomplished with the hashed program counter and the searching the BTBI is accomplished with the hashed program counter and branch history information. A predicted branch target address within the BTBI or the BTB is matched. The matching within the BTBI is based on an indirect branch instruction, and the matching within the BTB is based on other branch instruction types. The predicted branch target address that was matched is predicted taken. The processor core is directed to fetch a next instruction from the predicted branch target address.

Claims (45)

1. A processor-implemented method for branch prediction comprising:

accessing a processor core, wherein the processor core is coupled to memory, and wherein the processor core includes branch prediction circuitry, wherein the branch prediction circuitry includes a branch target buffer (BTB) and an indirect branch target buffer (BTBI);

reading a hashed program counter within the processor core;

searching the BTB and the BTBI, wherein the searching the BTB is accomplished with the hashed program counter and the searching the BTBI is accomplished with the hashed program counter and branch history information;

matching a predicted branch target address within the BTBI or the BTB, wherein the matching within the BTBI is based on an indirect branch instruction, and wherein the matching within the BTB is based on other branch instruction types;

deciding that the predicted branch target address that was matched is predicted taken; and

directing the processor core to fetch a next instruction from the predicted branch target address.

2. The method of claim 1 wherein the BTB comprises an n-way set associative cache, wherein each way of the n-ways comprises multiple banks.

3. The method of claim 2 wherein the number of multiple banks equals a number of instructions fetched by the processor core in a single cycle.

4. The method of claim 3 wherein each bank within the number of multiple banks can be accessed by the fetched instruction of its address offset matches.

5. The method of claim 2 wherein the BTB comprises a tag cache and a data cache.

6. The method of claim 5 wherein a data size of a tag offset is parameterized.

7. The method of claim 1 wherein the BTB stores compressed branch target addresses.

8. The method of claim 7 wherein multiple compressed instructions are stored in a single BTB entry.

9. The method of claim 8 wherein each entry of the BTB stores a portion of a branch target address.

10. The method of claim 9 wherein the portion of the branch target address is combined with the hashed program counter to obtain the branch target address.

11. The method of claim 10 wherein the hashed program counter includes information from a program counter and a global branch history table.

12. The method of claim 9 wherein the portion of the branch target address is 12 bits.

13. The method of claim 1 wherein the BTB supports unaligned instructions.

14. The method of claim 13 wherein each bank of the BTB is accessed either by a fetch group “N” or a mix of fetch group “N” and fetch group “N+1”.

15. The method of claim 1 wherein the BTBI includes a cache structure that comprises a different size, associativity, or number of banks than the BTB.

16. The method of claim 15 wherein the BTBI is direct mapped.

17. The method of claim 15 wherein the BTBI comprises 512 entries.

18. The method of claim 15 wherein each entry of the BTBI comprises a target address of the indirect branch instruction and a valid bit.

19. The method of claim 18 wherein the valid bit within the BTBI remains valid once set.

20. The method of claim 1 further comprising updating the BTB with branch mispredict information.

21. The method of claim 20 wherein the BTB is updated for a taken misprediction of all branch instructions, and wherein a branch target address within the BTB is updated only for direct branch instructions.

22. The method of claim 1 further comprising updating the BTBI with indirect branch mispredict information.

23. The method of claim 22 wherein the BTBI is updated for a taken misprediction of the indirect branch instruction.

24. The method of claim 1 wherein the processor core is included in a multiprocessor system.

25. A computer program product embodied in a non-transitory computer readable medium for branch prediction, the computer program product comprising code which causes one or more processors to generate semiconductor logic for:

accessing a processor core, wherein the processor core is coupled to memory, and wherein the processor core includes branch prediction circuitry, wherein the branch prediction circuitry includes a branch target buffer (BTB) and an indirect branch target buffer (BTBI);

reading a hashed program counter within the processor core;

searching the BTB and the BTBI, wherein the searching the BTB is accomplished with the hashed program counter and the searching the BTBI is accomplished with the hashed program counter and branch history information;

matching a predicted branch target address within the BTBI or the BTB, wherein the matching within the BTBI is based on an indirect branch instruction, and wherein the matching within the BTB is based on other branch instruction types;

deciding that the predicted branch target address that was matched is predicted taken; and

directing the processor core to fetch a next instruction from the predicted branch target address.

26. An apparatus for branch prediction comprising:

a processor core coupled to memory, wherein the processor core and the memory are used to perform operations comprising:

accessing the processor core, wherein the processor core is coupled to the memory, and wherein the processor core includes branch prediction circuitry, wherein the branch prediction circuitry includes a branch target buffer (BTB) and an indirect branch target buffer (BTBI);

reading a hashed program counter within the processor core;

searching the BTB and the BTBI, wherein the searching the BTB is accomplished with the hashed program counter and the searching the BTBI is accomplished with the hashed program counter and branch history information;

matching a predicted branch target address within the BTBI or the BTB, wherein the matching within the BTBI is based on an indirect branch instruction, and wherein the matching within the BTB is based on other branch instruction types;

deciding that the predicted branch target address that was matched is predicted taken; and

directing the processor core to fetch a next instruction from the predicted branch target address.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 5, 2025
From: CHO, JAMES YOUNGSAE; BANERJEE, CHANDRAMOULI; SUGUMAR, RABIN
To: AKEANA, INC.
Reel/Frame 070747/0625 →
Continuity (22)
Provisional Application 63605620 · Dec 4, 2023
Provisional Application 63602514 · Nov 24, 2023
Provisional Application 63547574 · Nov 7, 2023
Provisional Application 63547404 · Nov 6, 2023
Provisional Application 63546769 · Nov 1, 2023
Provisional Application 63545961 · Oct 27, 2023
Provisional Application 63542797 · Oct 6, 2023
Provisional Application 63526009 · Jul 11, 2023
Provisional Application 63521365 · Jun 16, 2023
Provisional Application 63471283 · Jun 6, 2023
Provisional Application 63467335 · May 18, 2023
Provisional Application 63463371 · May 2, 2023
Provisional Application 63462542 · Apr 28, 2023
Provisional Application 63444619 · Feb 10, 2023
Provisional Application 63439761 · Jan 18, 2023
Provisional Application 63436133 · Dec 30, 2022
Provisional Application 63436144 · Dec 30, 2022
Provisional Application 63435831 · Dec 29, 2022
Provisional Application 63435343 · Dec 27, 2022
Provisional Application 63434104 · Dec 21, 2022
Provisional Application 63431756 · Dec 12, 2022
Related Publication 20240192958A1 · Jun 13, 2024
References Cited (17)
US 6934809B2 · Tremblay et al. · 2005 [cited by applicant]
US 7506105B2 · Al-Sukhni et al. · 2009 [cited by applicant]
US 10013356B2 · Chou · 2018 [cited by applicant]
US 10671394B2 · Britto et al. · 2020 [cited by applicant]
US 10929948B2 · Benthin et al. · 2021 [cited by applicant]
US 11288405B2 · Belgarric et al. · 2022 [cited by applicant]
US 11403099B2 · Cerny et al. · 2022 [cited by applicant]
US 11403225B2 · Zheng et al. · 2022 [cited by applicant]
US 11429529B2 · Hornung et al. · 2022 [cited by applicant]
US 11442863B2 · Shulyak et al. · 2022 [cited by applicant]
US 11474130B2 · Lentz et al. · 2022 [cited by applicant]
US 11486911B2 · Tuncer et al. · 2022 [cited by applicant]
US 20140195789A1 · Gupta · 2014 [cited by examiner]
US 20220004639A1 · Yardi et al. · 2022 [cited by applicant]
US 20220029780A1 · Dafali · 2022 [cited by applicant]
US 20220197657A1 · Soundararajan et al. · 2022 [cited by applicant]
WO 2022117687A1 · 2022 [cited by applicant]