IP Library › Granted Patent US 11,188,340
Granted Patent B2
US 11,188,340 · App. 16/226,729 · Granted Nov 30, 2021

Multiple streams execution for hard-to-predict branches in a microprocessor

Inventors: Brian W. Thompto (Austin, TX); Hung Q. Le (Austin, TX); Dung Q. Nguyen (Austin, TX)
Assignee: International Business Machines Corporation
G06F9/3842G06F9/3806G06F9/3838G06F9/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 11,188,340
App. No.
16/226,729
Granted
Nov 30, 2021
Kind
B2
Abstract

Techniques for parallel execution of instructions in an instruction set are described. The techniques include determining a plurality of instruction streams and paths for a branch in an instruction set and executing the determined paths in parallel such that a mis-predicted path does not cause significant mis-prediction penalties.

Claims (76)

1. A method comprising:

during an execution of an instruction set, detecting, one or more instruction branches for the instruction set;

determining an instruction branch of the one or more instruction branches is a hard to predict branch;

determining a plurality of instruction sets for the hard to predict branch by

fetching one or more branch prediction streams from an instruction cache and storing associated instructions in an L0 cache for each of the one or more branch prediction streams; and

storing an entry for each of the one or more branch prediction streams in a stream information table, wherein each entry comprises an indication of the stored associated instructions associated with the branch prediction stream of the entry;

determining a plurality of prediction paths for the determined plurality of instruction sets by sorting the entries for the one or more branch prediction streams in the stream information table into the plurality of prediction paths such that each entry is associated with at least one prediction path; and

executing, in parallel, the plurality of prediction paths for the hard to predict branch.

2. The method of claim 1 , further comprising:

determining that one of the plurality of prediction paths is a correctly predicted path of the hard to predict branch;

assigning the correctly predicted path as a main branch for execution; and

flushing a remainder of the plurality of prediction paths.

3. The method of claim 1 , wherein each instruction branch of the one or more instruction branches comprises an associated confidence score wherein the method further comprises:

for a first associated confidence score, prefetching instructions for a second plurality of prediction paths; and

for a second associated confidence score, fetching instructions and storing instructions for a third plurality of prediction paths; and

wherein for a third associated confidence score, wherein the third associated confidence score indicates the instruction branch is a hard to predict branch, executing the plurality of prediction paths comprises:

fetching and executing instructions for one of the plurality of prediction paths.

4. The method of claim 1 , wherein determining the plurality of prediction paths for the determined plurality of instruction sets comprises:

storing the plurality of prediction paths in a path information table, wherein the path information table further comprises dispatch feedback.

5. The method of claim 4 , wherein executing the plurality of prediction paths for the hard to predict branch comprises:

dispatching instructions for execution for a first path of the plurality of prediction paths, wherein the dispatched instructions are tracked using a stream mask;

updating an allocation of resources and a dependency tracking field associated with the first path in a path information table; and

dispatching instructions for execution for another path of the plurality of prediction paths.

6. The method of claim 1 , wherein executing the plurality of prediction paths for the hard to predict branch comprises:

dispatching instructions for the plurality of prediction paths, wherein instructions within a path are dispatched in order and wherein the plurality of prediction paths are dispatched out of order.

7. A system comprising:

one or more computer processors; and

a memory containing a program which when executed by the one or more computer processors performs an operation comprising:

during an execution of an instruction set, detecting, one or more instruction branches for the instruction set;

determining an instruction branch of the one or more instruction branches is a hard to predict branch;

determining a plurality of instruction sets for the hard to predict branch by:

fetching one or more branch prediction streams from an instruction cache and storing associated instructions in an L0 cache for each of the one or more branch prediction streams; and

storing an entry for each of the one or more branch prediction streams in a stream information table, wherein each entry comprises an indication of the stored associated instructions associated with the branch prediction stream of the entry;

determining a plurality of prediction paths for the determined plurality of instruction sets by sorting the entries for the one or more branch prediction streams in the stream information table into the plurality of prediction paths such that each entry is associated with at least one prediction path; and

executing, in parallel, the plurality of prediction paths for the hard to predict branch.

8. The system of claim 7 , wherein the operation further comprises:

determining that one of the plurality of prediction paths is a correctly predicted path of the hard to predict branch;

assigning the correctly predicted path as a main branch for execution; and

flushing a remainder of the plurality of prediction paths.

9. The system of claim 7 , wherein each instruction branch of the one or more instruction branches comprises an associated confidence score wherein the operation further comprises:

for a first associated confidence score, prefetching instructions for a second plurality of prediction paths;

for a second associated confidence score, fetching instructions and storing instructions for a third plurality of prediction paths; and

wherein for a third associated confidence score, wherein the third associated confidence score indicates the instruction branch is a hard to predict branch, executing the plurality of prediction paths comprises:

fetching and executing instructions for the plurality of prediction paths.

10. The system of claim 7 , wherein determining the plurality of prediction paths for the determined plurality of instruction sets comprises:

storing the plurality of prediction paths in a path information table, wherein the path information table further comprises dispatch feedback.

11. The system of claim 10 , wherein executing the plurality of prediction paths for the hard to predict branch comprises:

dispatching instructions for execution for a first path of the plurality of prediction paths, wherein the dispatched instructions are tracked by a processor of the one or more computer processors using a stream mask;

updating an allocation of resources and a dependency tracking field associated with the first path in the path information table; and

dispatching instructions for execution for another path of the plurality of prediction paths.

12. The system of claim 7 , wherein executing the plurality of prediction paths for the hard to predict branch comprises:

dispatching instructions for the plurality of prediction paths, wherein instructions within a path are dispatched in order and wherein the plurality of prediction paths are dispatched out of order.

13. A computer program product comprising:

a computer-readable storage medium having computer-readable program code embodied therewith, the computer-readable program code executable by one or more computer processors to perform an operation, the operation comprising:

during an execution of an instruction set, detecting, one or more instruction branches for the instruction set;

determining an instruction branch of the one or more instruction branches is a hard to predict branch;

determining a plurality of instruction sets for the hard to predict branch by:

fetching one or more branch prediction streams from an instruction cache and storing associated instructions in an L0 cache for each of the one or more branch prediction streams; and

storing an entry for each of the one or more branch prediction streams in a stream information table, wherein each entry comprises an indication of the stored associated instructions associated with the branch prediction stream of the entry;

determining a plurality of prediction paths for the determined plurality of instruction sets by sorting the entries for the one or more branch prediction streams in the stream information table into the plurality of prediction paths such that each entry is associated with at least one prediction path; and

executing, in parallel, the plurality of prediction paths for the hard to predict branch.

14. The computer program product of claim 13 , wherein the operation further comprises:

determining that one of the plurality of prediction paths is a correctly predicted path of the hard to predict branch;

assigning the correctly predicted path as a main branch for execution; and

flushing a remainder of the plurality of prediction paths.

15. The computer program product of claim 13 , wherein instruction branch of the one or more instruction branches comprises an associated confidence score wherein the operation further comprises:

for a first associated confidence score, prefetching instructions for a second plurality of prediction paths;

for a second associated confidence score, fetching instructions and storing instructions for a third plurality of prediction paths; and

wherein for a third associated confidence score, wherein the third associated confidence score indicates the instruction branch is a hard to predict branch, executing the plurality of prediction paths comprises:

fetching and executing instructions for the plurality of prediction paths.

16. The computer program product of claim 13 , wherein determining the plurality of prediction paths for the determined plurality of instruction sets comprises:

storing the plurality of prediction paths in a path information table, wherein the path information table further comprises dispatch feedback.

17. The computer program product of claim 16 , wherein executing the plurality of prediction paths for the hard to predict branch comprises:

dispatching instructions for execution for a first path of the plurality of prediction paths, wherein the dispatched instructions are dispatched in order, wherein the dispatched instructions are tracked using a stream mask;

updating an allocation of resources and a dependency tracking field associated with the first path in the path information table; and

dispatching instructions for execution for another path of the plurality of prediction paths, wherein the another path is an out of order path.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 20, 2018
From: THOMPTO, BRIAN W.; LE, HUNG Q.; NGUYEN, DUNG Q.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 047826/0269 →
Continuity (1)
Related Publication 20200201646A1 · Jun 25, 2020