Search

US-20260127002-A1 - BRANCH PREDICTOR

US20260127002A1US 20260127002 A1US20260127002 A1US 20260127002A1US-20260127002-A1

Abstract

Disclosed is a branch predictor unit (BPU), comprising a first branch predictor configured to generate a first prediction of a branch based at least in part on a first prediction entry point of two predictions prior to the first prediction, and a second branch predictor configured to generate a second prediction of the branch based at least in part on a second prediction entry point of one prediction prior to the second prediction, wherein either the first prediction or the second prediction is generated based on a determination of whether the branch follows a flush.

Inventors

  • Michael Chin
  • Aaron Lindsay

Assignees

  • AMPERE COMPUTING LLC

Dates

Publication Date
20260507
Application Date
20241107

Claims (14)

  1. 1 . A branch predictor unit (BPU), comprising: a first branch predictor configured to generate a first prediction of a branch based at least in part on a first prediction entry point of two predictions prior to the first prediction, wherein the first prediction entry point is stored as a first set of tag bits in an array that stores a plurality of potential predictions; and a second branch predictor configured to generate a second prediction of the branch based at least in part on a second prediction entry point of one prediction prior to the second prediction, wherein either the first prediction or the second prediction is generated based on a determination of whether the branch follows a flush, wherein the second prediction entry point is stored as a second set of tag bits in the array separate from the first set of tag bits.
  2. 2 - 4 . (canceled)
  3. 5 . The BPU of claim 1 , wherein the second branch predictor is configured to generate the second prediction if the branch follows the flush.
  4. 6 . The BPU of claim 1 , wherein the first branch predictor is configured to generate the first prediction if the branch does not follow the flush.
  5. 7 . The BPU of claim 1 , wherein the first branch predictor comprises a larger prediction array than the second branch predictor.
  6. 8 . The BPU of claim 1 , wherein the second prediction is generated in a shorter time than the first prediction.
  7. 9 . The BPU of claim 1 , wherein the first branch predictor comprises a next-next predictor (NNP).
  8. 10 . The BPU of claim 1 , wherein the second branch predictor comprises a next predictor (NP).
  9. 11 . A method performed at a branch predictor unit (BPU), the method comprising: determining whether a branch that is being predicted follows a flush; generating a first prediction of the branch based at least in part on a first prediction entry point of two predictions prior to the first prediction based on a determination that the branch that is being predicted does not follow the flush, wherein the first prediction entry point is stored as a first set of tag bits in an array that stores a plurality of potential predictions; and generating a second prediction of the branch based at least in part on a second prediction entry point of one prediction prior to the second prediction based on a determination that the branch that is being predicted follows the flush, wherein the second prediction entry point is stored as a second set of tag bits in the array separate from the first set of tag bits.
  10. 12 - 14 . (canceled)
  11. 15 . The method of claim 11 , wherein the first prediction is generated by a next-next predictor (NNP), and wherein the second prediction is generated by a next predictor (NP).
  12. 16 . A branch predictor unit (BPU), comprising: means for determining whether a branch that is being predicted follows a flush; means for generating a first prediction of the branch based at least in part on a first prediction entry point of two predictions prior to the first prediction based on a determination that the branch that is being predicted does not follow the flush, wherein the first prediction entry point is stored as a first set of tag bits in an array that stores a plurality of potential predictions; and means for generating a second prediction of the branch based at least in part on a second prediction entry point of one prediction prior to the second prediction based on a determination that the branch that is being predicted follows the flush, wherein the second prediction entry point is stored as a second set of tag bits in the array separate from the first set of tag bits.
  13. 17 - 19 . (canceled)
  14. 20 . The BPU of claim 16 , wherein the first prediction is generated by a next-next predictor (NNP), and wherein the second prediction is generated by a next predictor (NP).

Description

BACKGROUND OF THE DISCLOSURE 1. Field of the Disclosure Aspects of the disclosure relate generally to branch prediction. More specifically, but not exclusively, to branch prediction for enhanced efficiency. 2. Description of the Related Art Branch predictors have been implemented in processors in an attempt to save computing resources and reduce power consumption. Without branch prediction, a processor core would need to wait until a change of flow instruction for which the next instruction in sequence is not definite (such as a conditional jump instruction or unconditional but indirect branch instruction) has passed the execution stage before the next instruction can enter the fetch stage in the pipeline. A branch predictor may be implemented in the processor core to avoid this waste of time by trying to guess the direction of the change of flow instruction (i.e., whether a jump is most likely to be taken or not taken). The next instruction for the branch direction that is guessed to be the most likely may then be fetched and speculatively executed. If it is later detected that the guess was wrong, then the speculatively executed or partially executed instructions are discarded and the pipeline starts over with the correct branch, thereby incurring a delay. Despite the possibility of misprediction, however, branch predictors have been implemented in modern pipelined processor architectures to achieve higher performance. Various types of branch predictors have been implemented in pipelined processor architectures. Some branch predictors may be suited for making relatively accurate branch predictions but may have difficulties meeting the timing requirements of modern processor architectures. Some branch predictors may have relatively small and/or fast structures but with reduced prediction accuracy. Therefore, there is a need for a branch predictor architecture with improved branch prediction performance, improved efficiency, and reduced power consumption. SUMMARY The following presents a simplified summary relating to one or more aspects disclosed herein. Thus, the following summary should not be considered an extensive overview relating to all contemplated aspects, nor should the following summary be considered to identify key or critical elements relating to all contemplated aspects or to delineate the scope associated with any particular aspect. Accordingly, the following summary has the sole purpose to present certain concepts relating to one or more aspects relating to the mechanisms disclosed herein in a simplified form to precede the detailed description presented below. In some aspects, a branch predictor unit (BPU) includes a first branch predictor configured to generate a first prediction of a branch based at least in part on a first prediction entry point of two predictions prior to the first prediction; and a second branch predictor configured to generate a second prediction of the branch based at least in part on a second prediction entry point of one prediction prior to the second prediction, wherein either the first prediction or the second prediction is generated based on a determination of whether the branch follows a flush. In some aspects, a method performed at a branch predictor unit (BPU) includes determining whether a branch that is being predicted follows a flush; generating a first prediction of the branch based at least in part on a first prediction entry point of two predictions prior to the first prediction based on a determination that the branch that is being predicted does not follow the flush; and generating a second prediction of the branch based at least in part on a second prediction entry point of one prediction prior to the second prediction based on a determination that the branch that is being predicted follows the flush. In some aspects, a branch predictor unit (BPU) includes means for determining whether a branch that is being predicted follows a flush; means for generating a first prediction of the branch based at least in part on a first prediction entry point of two predictions prior to the first prediction based on a determination that the branch that is being predicted does not follow the flush; and means for generating a second prediction of the branch based at least in part on a second prediction entry point of one prediction prior to the second prediction based on a determination that the branch that is being predicted follows the flush. Other objects and advantages associated with the aspects disclosed herein will be apparent to those skilled in the art based on the accompanying drawings and detailed description. BRIEF DESCRIPTION OF THE DRAWINGS A more complete appreciation of aspects of the disclosure and many of the attendant advantages thereof will be readily obtained as the same becomes better understood by reference to the following detailed description when considered in connection with the accompanying drawings which are presented solely for illustrat