IP Library Granted Patent US 9,348,599
Granted Patent B2
US 9,348,599 · App. 13/741,597 · Granted May 24, 2016

Confidence threshold-based opposing branch path execution for branch prediction

Inventors: Fadi Y. Busaba (Poughkeepsie, NY); Steven R. Carlough (Poughkeepsie, NY); Christopher A. Krygowski (Lagrangeville, NY); Brian R. Prasky (Wappingers Falls, NY); Chung-Lung K. Shum (Wappingers Falls, NY)
Assignee: International Business Machines Corporation
G06F9/3844G06F9/38G06F9/3804G06F9/3851
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 9,348,599
App. No.
13/741,597
Granted
May 24, 2016
Kind
B2
Abstract

Embodiments relate to confidence threshold-based opposing path execution for branch prediction. An aspect includes determining a branch prediction for a first branch instruction that is encountered during execution of a first thread, wherein the branch prediction indicates a primary path and an opposing path for the first branch instruction. Another aspect includes executing the primary path by the first thread. Another aspect includes determining a confidence of the branch prediction and comparing the confidence of the branch prediction to a confidence threshold. Yet another aspect includes, based on the confidence of the branch prediction being less than the confidence threshold, starting a second thread that executes the opposing path of the first branch instruction, wherein the second thread is executed in parallel with the first thread.

Claims (28)

1. A computer system for confidence threshold-based opposing path execution for branch prediction, the system comprising:

a processor, the processor configured to perform a method comprising:

determining a branch prediction for a first branch instruction that is encountered during execution of a first thread, wherein the branch prediction indicates a primary path and an opposing path for the first branch instruction;

executing the primary path by the first thread;

determining a confidence of the branch prediction;

comparing the confidence of the branch prediction to a confidence threshold; and

based on the confidence of the branch prediction being less than the confidence threshold, starting a second thread that executes the opposing path of the first branch instruction, wherein the second thread is executed in parallel with the first thread.

2. The computer system of claim 1 , further comprising:

determining a branch resolution of the first branch instruction, wherein the branch resolution indicates whether one of the primary path and the opposing path comprises a correct path of the first branch instruction;

based on the branch resolution of the first branch instruction indicating that the opposing path is the correct path of the first branch instruction, aborting the first thread; and

based on the branch resolution of the first branch instruction indicating that the primary path is the correct path of the first branch instruction, aborting the second thread.

3. The computer system of claim 2 , wherein the second thread is started as a transaction that executes in a transactional memory of the processor, and further comprising:

based on the branch resolution of the first branch instruction indicating that the opposing path is the correct path of the first branch instruction, ending and committing the transaction corresponding to the second thread; and

based on the branch resolution of the first branch instruction indicating that the primary path is the correct path of the first branch instruction, rolling back the transaction corresponding to the second thread.

4. The computer system of claim 1 , wherein the processor comprises a simultaneous multi-threaded (SMT) processor, and wherein starting the second thread is additionally based on a total number of threads currently being handled by the processor being less than a thread maximum of the SMT processor.

5. The computer system of claim 4 , wherein the confidence threshold varies based on the total number of threads currently being handled by the processor.

6. The computer system of claim 4 , further comprising, based on the total number of threads currently being handled by the processor being equal to the thread maximum of the processor:

determining a confidence of a branch prediction associated with a third thread that is currently executing in the processor, the third thread corresponding to an opposing path of a second branch instruction;

comparing the confidence associated with the second branch instruction to the confidence associated with the first branch instruction; and

based on the confidence associated with the second branch instruction being less than the confidence associated with the first branch instruction, aborting the third thread and starting the second thread that executes the opposing path of the first branch instruction.

7. The computer system of claim 1 , wherein the branch prediction for the first branch instruction is determined based on a saturating prediction counter in an entry corresponding to the first branch instruction in a branch taken buffer/branch history table (BTB/BHT) of the processor, and wherein the confidence of the branch prediction is determined based on a correct counter and an incorrect counter in the entry corresponding to the first branch instruction.

8. The computer system of claim 7 , wherein the confidence of the branch prediction is equal to a value of the correct counter divided by a sum of the value of the correct counter and a value of the incorrect counter.

9. The computer system of claim 7 , further comprising, based on one of the correct counter and the incorrect counter reaching a maximum counter value, dividing each of the correct counter and the incorrect counter by two.

10. The computer system of claim 7 , further comprising:

determining a branch resolution of the first branch instruction;

based on the branch resolution of the first branch instruction indicating that the opposing path is a correct path of the first branch instruction, incrementing the incorrect counter in the entry corresponding to the first branch instruction; and

based on the branch resolution of the first branch instruction indicating that the primary path is a correct path of the first branch instruction, incrementing the correct counter in the entry corresponding to the first branch instruction.

11. The computer system of claim 1 , wherein a priority of execution of the first thread is higher than a priority of execution of the second thread, and wherein the priority of execution of the first thread and the priority of execution of the second thread are further determined based on the determined confidence.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 15, 2013
From: BUSABA, FADI Y.; CARLOUGH, STEVEN R.; KRYGOWSKI, CHRISTOPHER A.; PRASKY, BRIAN R.; SHUM, CHUNG-LUNG K.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 029634/0485 →
Continuity (1)
Related Publication 20140201508A1 · Jul 17, 2014