IP Library › Granted Patent US 12,547,408
Granted Patent B2
US 12,547,408 · App. 18/654,060 · Granted Feb 10, 2026

Multi-level PHT entry swaps based on first level miss and second level hit

Inventors: James Raymond Cuffney (Poughkeepsie, NY); Dominic Ditomaso (Hyde Park, NY); Brian Robert Prasky (Campbell Hall, NY)
Assignee: International Business Machines Corporation
G06F9/3806G06F9/30058
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,547,408
App. No.
18/654,060
Granted
Feb 10, 2026
Kind
B2
Abstract

A branch prediction logic system includes a branch history table (BHT), a multi-level history table, and a prediction update queue. The BHT includes a plurality of lines, each line corresponding to at least one branch instruction and containing history information specific to the at least one branch instruction. A first pattern history table (PHT-1) stores first branch data corresponding to the at least one branch instruction included in a given line of the BHT and a second pattern history table (PHT-2) stores second branch data corresponding to the at least one branch instruction included in a given line. The prediction update queue stores a line presence bit having one of a “1” logic state or a “0” logic state. The branch prediction logic system performs a data swap between the PHT-2 and the PHT-1 based on the logic state of the line presence bit.

Claims (47)

1 . A computing system including a branch prediction logic system comprising:

a branch history table (BHT) including a plurality of lines, each line corresponding to at least one branch instruction and containing history information specific to the at least one branch instruction;

a multi-level pattern history table configured to store branch data indexed to the at least one branch instruction, the multi-level pattern history table including a first pattern history table (PHT-1) configured to store first branch data corresponding to the at least one branch instruction included in a given line of the BHT and a second pattern history table (PHT-2) configured to store second branch data corresponding to the at least one branch instruction included in a given line; and

a prediction update queue (PUQ) configured to store at least one PUQ entry corresponding to the at least one branch instruction, the PUQ entry including a line presence bit having one of a “1” logic state or a “0” logic state,

wherein the branch prediction logic system is configured to perform a data swap between the PHT-2 and the PHT-1 based on the logic state of the line presence bit, the data swap including replacing, at the same index, the first branch data stored in the PHT-1 with the second branch data, and replacing, at the same index, the second branch data stored in the PHT-2 with the first branch data.

2 . The computing system of claim 1 , wherein a combination of the first branch data and the history information provides first result data when the at least one branch instruction corresponding to the first branch data completes, and wherein a combination of the second branch data and the history information provides second result data when the at least one branch instruction corresponding to the second branch data completes.

3 . The computing system of claim 2 , wherein the branch prediction logic system updates the PHT-1 and the BHT based on the first result data, and updates the PHT-2 and the BHT based on the second result data.

4 . The computing system of claim 3 , wherein the branch prediction logic system performs the data swap when a completed branch from the line matches a PUQ entry indicating a need to update, the matching PUQ entry includes the line presence bit set to the “1” logic state, and the completed branch indexes to the second branch data in the PHT-2.

5 . The computing system of claim 4 , wherein the branch prediction logic system maintains the first branch data in the PHT-1 and the second branch data in the PHT-2 when the matching PUQ entry includes the line presence bit set to the “0” logic state.

6 . A computer implemented method comprising:

storing a plurality of lines in a branch history table (BHT), each line corresponding to at least one branch instruction and containing history information specific to the at least one branch instruction;

storing, in a first pattern history table (PHT-1) of a multi-level pattern history table, first branch data corresponding to the at least one branch instruction included in a given line of the BHT;

storing, in a second pattern history table (PHT-2) of the multi-level pattern history table, second branch data corresponding to the at least one branch instruction included in a given line;

storing, in a prediction update queue, at least one PUQ entry corresponding to the at least one branch instruction, the PUQ entry including a line presence bit having one of a “1” logic state or a “0” logic state; and

performing a data swap between the PHT-2 and the PHT-1 based on the logic state of the line presence bit, the data swap including replacing, at the same index, the first branch data stored in the PHT-1 with the second branch data, and replacing, at the same index, the second branch data stored in the PHT-2 with the first branch data.

7 . The computer implemented method of claim 6 , further comprising:

providing first result data based on a combination of the first branch data and the history information in response to completion of the at least one branch instruction corresponding to the first branch data; and

providing second result data based on a combination of the second branch data and the history information in response to completion of the at least one branch instruction corresponding to the second branch data.

8 . The computer implemented method of claim 7 , further comprising:

updating the PHT-1 and the BHT based on the first result data; and

updating the PHT-2 and the BHT based on the second result data.

9 . The computer implemented method of claim 8 , further comprising:

performing the data swap in response to:

a completed branch from the line corresponds to a matching PUQ entry indicating a need to update;

the matching PUQ entry including the line presence bit set to the “1” logic state; and

the completed branch indexes to the second branch data in the PHT-2.

10 . The computer implemented method of claim 9 , further comprising:

maintaining the first branch data in the PHT-1 and the second branch data in the PHT-2 when the matching PUQ entry includes the line presence bit set to the “0” logic state.

11 . 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 operations comprising:

storing a plurality of lines in a branch history table (BHT), each line corresponding to at least one branch instruction and containing history information specific to the at least one branch instruction;

storing, in a first pattern history table (PHT-1) of a multi-level pattern history table, first branch data corresponding to the at least one branch instruction included in a given line of the BHT;

storing, in a second pattern history table (PHT-2) of the multi-level pattern history table, second branch data corresponding to the at least one branch instruction included in a given line;

storing, in a prediction update queue, at least one PUQ entry corresponding to the at least one branch instruction, the PUQ entry including a line presence bit having one of a “1” logic state or a “0” logic state; and

performing a data swap between the PHT-2 and the PHT-1 based on the logic state of the line presence bit, the data swap including replacing, at the same index, the first branch data stored in the PHT-1 with the second branch data, and replacing, at the same index, the second branch data stored in the PHT-2 with the first branch data.

12 . The computer program product of claim 11 , further comprising:

providing first result data based on a combination of the first branch data and the history information in response to completion of the at least one branch instruction corresponding to the first branch data; and

providing second result data based on a combination of the second branch data and the history information in response to completion of the at least one branch instruction corresponding to the second branch data.

13 . The computer program product of claim 12 , further comprising:

updating the PHT-1 and the BHT based on the first result data; and

updating the PHT-2 and the BHT based on the second result data.

14 . The computer program product of claim 13 , further comprising:

performing the data swap in response to:

a completed branch from the line corresponds to a matching PUQ entry indicating a need to update;

the matching PUQ entry including the line presence bit set to the “1” logic state;

the completed branch indexes to the second branch data in the PHT-2.

15 . The computer program product of claim 14 , further comprising:

maintaining the first branch data in the PHT-1 and the second branch data in the PHT-2 when the matching PUQ entry includes the line presence bit set to the “0” logic state.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 3, 2024
From: CUFFNEY, JAMES RAYMOND; DITOMASO, DOMINIC; PRASKY, BRIAN ROBERT
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 067302/0438 →
Continuity (1)
Related Publication 20250342037A1 · Nov 6, 2025
References Cited (18)
US 10534611B2 · Bonanno et al. · 2020 [cited by applicant]
US 11556474B1 · Bonanno et al. · 2023 [cited by applicant]
US 11782919B2 · Collura et al. · 2023 [cited by applicant]
US 11868779B2 · Cuffney et al. · 2024 [cited by applicant]
US 20090210686A1 · Bonanno et al. · 2009 [cited by applicant]
US 20110320792A1 · Bonanno · 2011 [cited by examiner]
US 20130339695A1 · Bonanno · 2013 [cited by examiner]
US 20160026470A1 · Manoukian · 2016 [cited by examiner]
US 20200257534A1 · Bonanno · 2020 [cited by examiner]
US 20230053733A1 · Collura · 2023 [cited by examiner]
US 20230075992A1 · Cuffney · 2023 [cited by examiner]
Anonymous, “A Method and System for Improving Power Efficiency by Throttling branch Prediction Search Rate based on Queue Occupancy”, IPCOM000237562D, IP.com, Jun. 24, 2014, 4 pages. [cited by applicant]
Anonymous, “Correlating Lookahead Branch Prediction to Instruction Fetching in a High Frequency Superscalar Microprocessor”, IPCOM000236655D, IP.com, May 7, 2014, 6 pages. [cited by applicant]
Anonymous, “Method to Exclude Bad Patterns From A Pattern History Table Branch Predictor”, IPCOM000191968D, IP.com, Jan. 19, 2010, 5 pages. [cited by applicant]
Chowdhuryy, et al., Leaking Secrets through Modern Branch Predictors in the Speculative World, arXiv preprint, 2021, 14 pages. [cited by applicant]
Yeh, et al., A Comparison of Dynamic Branch Predictors that us Two Levels of Branch History, Department of Electrical Engineering and Computer Science, The University of Michigan, IEEE, 1993, pp. 257-266. [cited by applicant]
Yeh, et al., “Alternative Implementations of Two-Level Adaptive Branch Prediction”, The 19th Annual International Symposium on Computer Architecture, 1992, 11 pages. [cited by applicant]
Zangeneh, et al., “BranchNet: A Convolutional Neural Network to Predict Hard-To-Predict Branches”, 53rd Annual IEEE/ACM International Symposium on Microarchitecture (MICRO), 2020, 13 pages. [cited by applicant]