Reading prediction outcomes within a branch prediction mechanism
AssigneeArm Limited
InventorMatthew Elwood
Life of this patent
Estimating the term…
Abstract
A branch prediction mechanism 2 includes a history value register 4 storing a history value which is used to address into a history buffer 6 from which a plurality of prediction values are read and stored into a prediction value store 8. The one or more prediction values to be used with a potential branch instruction are selected from the prediction values store 8 using a multiplexer 10 switched by a branch predicting portion FA [4:3] of a fetch address. The history buffer 6 is only read when the history value changes whereas the prediction values store 8 is read each time a potential branch instruction is identified requiring a prediction value to be associated with it. The reduced duty cycle of the history buffer 6 saves power.
Claims14
Apparatus for processing data under control of program instructions including branch instructions, said apparatus comprising:
- a memory operable to store said program instructions;
- a fetch unit operable to fetch program instructions from respective fetch addresses within said memory, each fetch address including a prediction selecting portion;
- at least one history register operable to store a history value indicative of a pattern of preceding branch outcomes corresponding to whether a preceding sequence of branch instructions fetched from said memory respectively have taken or not taken branch outcomes;
- a history buffer operable to store for each history value a plurality of prediction values giving predictions of branch outcomes for branch instructions preceded by a sequence of branch instructions corresponding to said history value and having respective prediction selecting portions;
- and
- a prediction values store operable to store a plurality of prediction values corresponding to a current value of said history value;
- wherein
- when said history value is changed, said plurality of prediction values are read from said history buffer and stored in said prediction values store;
- and
- when a potential branch instruction is fetched from a fetch address in said memory, one or more prediction values including a prediction value to be used for said potential branch instruction and corresponding to a prediction selecting portion of said fetch address is read from among said plurality of prediction values stored in said prediction values store, such that
- if said history value does not change, then prediction values for different potential branch instructions having different prediction selecting portions within their fetch addresses are read from said prediction values store without requiring a read from said history buffer.
A method of processing data under control of program instructions including branch instructions, said method comprising:
- storing said program instructions in a memory;
- fetching program instructions from respective fetch addresses within said memory, each fetch address including a prediction selecting portion;
- storing at least one history value indicative of a pattern of preceding branch outcomes corresponding to whether a preceding sequence of branch instructions fetched from said memory respectively have taken or not taken branch outcomes;
- in a history buffer, storing for each history value a plurality of prediction values giving predictions of branch outcomes for branch instructions preceded by a sequence of branch instructions corresponding to said history value and having respective prediction selecting portions;
- and
- in a prediction values store, storing a plurality of prediction values corresponding to a current value of said history value;
- wherein
- when said history value is changed, said plurality of prediction values are read from said history buffer and stored in said prediction values store;
- and
- when a potential branch instruction is fetched from a fetch address in said memory, one or more prediction values including a prediction value to be used for said potential branch instruction and corresponding to a prediction selecting portion of said fetch address is read from among said plurality of prediction values stored in said prediction values store, such that
- if said history value does not change, then prediction values for different potential branch instructions having different prediction selecting portions within their fetch address are read from said prediction values store without requiring a read from said history buffer.
Dependencies are inferred from the claim text.