Selectively performing ahead branch prediction based on types of branch instructions

US11416256B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-11416256-B2
Application numberUS-202016945275-A
CountryUS
Kind codeB2
Filing dateJul 31, 2020
Priority dateJun 18, 2018
Publication dateAug 16, 2022
Grant dateAug 16, 2022

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A set of entries in a branch prediction structure for a set of second blocks are accessed based on a first address of a first block. The set of second blocks correspond to outcomes of one or more first branch instructions in the first block. Speculative prediction of outcomes of second branch instructions in the second blocks is initiated based on the entries in the branch prediction structure. State associated with the speculative prediction is selectively flushed based on types of the branch instructions. In some cases, the branch predictor can be accessed using an address of a previous block or a current block. State associated with the speculative prediction is selectively flushed from the ahead branch prediction, and prediction of outcomes of branch instructions in one of the second blocks is selectively initiated using non-ahead accessing, based on the types of the one or more branch instructions.

First claim

Opening claim text (preview).

What is claimed is: 1. A method comprising: initiating speculative prediction of outcomes of first branch instructions in a set of first blocks that correspond to predicted outcomes of a second branch instruction in a second block; determining a type of the second branch instruction concurrently with the speculative prediction of the outcomes of the first branch instructions; and selectively flushing a state associated with the speculative prediction based on the type of the second branch instruction. 2. The method of claim 1 , further comprising: accessing, based on a first address of the second block, a set of entries in a branch prediction structure for the set of first blocks. 3. The method of claim 2 , wherein accessing the set of entries in the branch prediction structure comprises accessing a set of entries in the branch prediction structure for a set of first blocks that are potential targets of the second branch instruction or a block that follows the second block if the second branch instruction is not taken. 4. The method of claim 2 , further comprising: reinitiating speculative prediction of at least one of the first branch instructions in a predicted first block of the first blocks based on an entry in the branch prediction structure that is indexed by a second address of the predicted first block. 5. The method of claim 4 , wherein the predicted first block corresponds to a predicted outcome of the second branch instruction in the second block. 6. The method of claim 1 , further comprising: determining the type of the second branch instruction concurrently with the speculative prediction of the outcomes of the first branch instructions in the set of first blocks. 7. The method of claim 6 , wherein determining the type of the second branch instruction comprises determining the type of the second branch instruction based on whether an outcome of the second branch instruction is determined by a branch target buffer, an indirect branch predictor, or a return address stack. 8. The method of claim 1 , wherein selectively flushing the state comprises flushing the state associated with the speculative prediction of the outcomes of the first branch instructions in response to the type of the second branch instruction belonging to a first subset of a set of types of branch instructions. 9. The method of claim 8 , wherein the first subset comprises call instructions, return instructions, and indirect branch instructions. 10. The method of claim 8 , wherein selectively flushing the state comprises bypassing flushing the state and continuing with the speculative prediction in response to the type of the second branch instruction belonging to a second subset of the set of types of branch instructions. 11. An apparatus comprising: a scheduler configured to initiate speculative prediction of outcomes of first branch instructions in a set of first blocks that correspond to predicted outcomes of a second branch instruction in a second block; and a branch predictor configured to determine a type of the second branch instruction concurrently with the speculative prediction of the outcomes of the first branch instructions and selectively flush a state associated with the speculative prediction based on the type of the second branch instruction. 12. The apparatus of claim 11 , wherein the branch predictor is configured to access, based on a first address of the second block, a set of entries in a branch prediction structure for the set of first blocks. 13. The apparatus of claim 12 , wherein the branch predictor is configured to access a set of entries in the branch prediction structure for a set of first blocks that are potential targets of the second branch instruction or a block that follows the second block if the second branch instruction is not taken. 14. The apparatus of claim 12 , wherein the branch predictor is configured to re-initiate speculative prediction of at least one of the first branch instructions in a predicted first block of the first blocks based on an entry in the branch prediction structure that is indexed by a second address of the predicted first block. 15. The apparatus of claim 14 , wherein the predicted first block corresponds to a predicted outcome of the second branch instruction in the second block. 16. The apparatus of claim 11 , wherein the branch predictor is configured to determine the type of the second branch instruction concurrently with the speculative prediction of the outcomes of the first branch instructions in the set of first blocks. 17. The apparatus of claim 16 , wherein the branch predictor is configured to determine the type of the second branch instruction based on whether an outcome of the second branch instruction is determined by a branch target buffer, an indirect branch predictor, or a return address stack. 18. The apparatus of claim 11 , wherein the branch predictor is configured to flush the state associated with the speculative prediction of the outcomes of the first branch instructions in response to the type of the second branch instruction belonging to a first subset of a set of types of branch instructions. 19. The apparatus of claim 18 , wherein the first subset comprises call instructions, return instructions, and indirect branch instructions. 20. The apparatus of claim 18 , wherein the branch predictor is configured to flush the state and continue with the speculative prediction in response to the type of the second branch instruction belonging to a second subset of the set of types of branch instructions.

Assignees

Inventors

Classifications

  • Indirect addressing · CPC title

  • Recovery, e.g. branch miss-prediction, exception handling (error detection or correction G06F11/00) · CPC title

  • Indexed addressing · CPC title

  • G06F9/3844Primary

    using dynamic branch prediction, e.g. using branch history tables · CPC title

  • G06F9/3806Primary

    using address prediction, e.g. return stack, branch history buffer · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US11416256B2 cover?
A set of entries in a branch prediction structure for a set of second blocks are accessed based on a first address of a first block. The set of second blocks correspond to outcomes of one or more first branch instructions in the first block. Speculative prediction of outcomes of second branch instructions in the second blocks is initiated based on the entries in the branch prediction structure.…
Who is the assignee on this patent?
Advanced Micro Devices Inc
What technology area does this patent fall under?
Primary CPC classification G06F9/3844. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Aug 16 2022 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).