Branch prediction in a data processing apparatus
First Claim
1. Branch prediction logic for generating a branch bias providing a prediction as to whether execution of a branch instruction will result in a branch being taken or not taken, the branch prediction logic comprising:
- a first branch bias storage operable to store for each of a plurality of first address portions a corresponding first branch bias value, the first branch bias storage being operable upon receipt of a first address portion of the branch instruction'"'"'s address to output the corresponding first branch bias value from the first branch bias storage;
a history storage operable to store history data identifying an outcome for a number of preceding branch instructions;
a single second branch bias storage having a number of entries, each entry being operable to store a replacement branch bias value and a TAG value indicative of an instance in which the replacement branch bias value should be used as the generated branch bias in preference to the first branch bias value;
index generation logic operable to generate an index identifying a corresponding entry in the single second branch bias storage, the index being derived from the history data;
the single second branch bias storage being operable upon receipt of the index to cause the content of the corresponding entry to be output from the single second branch bias storage; and
selection logic operable to select as the branch bias generated by the branch prediction logic the first branch bias value, unless the TAG value output from the single second branch bias storage corresponds to a comparison TAG value derived from a second address portion of the branch instruction'"'"'s address, in which event, the selection logic is operable to select as the branch bias generated by the branch prediction logic the replacement branch bias value output from the single second branch bias storage.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention relates to a branch prediction logic and method for generating a branch bias providing a prediction as to whether execution of a branch instruction will result in a branch being taken or not taken. The branch prediction logic comprises a first branch bias storage operable to store for each of a plurality of first address portions a corresponding first branch bias value, the first branch bias storage being operable upon receipt of a first address portion of the branch instruction'"'"'s address to output the corresponding first branch bias value from the first branch bias storage. The history storage is also provided for storing history data identifying an outcome for a number of preceding branch instructions. In addition, a single second branch bias storage is provided having a number of entries, each entry being operable to store a replacement branch bias value and a TAG value indicative of an instance in which the replacement branch bias value should be used as the generated branch bias in preference to the first branch bias value. Index generation logic is used to generate an index identifying a corresponding entry in the single second branch bias storage, with the index being derived from the history data. The single second branch bias storage is operable upon receipt of the index to cause the content of the corresponding entry to be output from the single second branch bias storage. Selection logic is then operable to select, as the branch bias generated by the branch prediction logic, the first branch bias value, unless the TAG value output from the single second branch bias storage corresponds to a comparison TAG value derived from a second address portion of the branch instruction'"'"'s address, in which event the selection logic is operable to select as the branch bias generated by the branch prediction logic the replacement branch bias value output from the single second branch bias storage.
-
Citations
19 Claims
-
1. Branch prediction logic for generating a branch bias providing a prediction as to whether execution of a branch instruction will result in a branch being taken or not taken, the branch prediction logic comprising:
-
a first branch bias storage operable to store for each of a plurality of first address portions a corresponding first branch bias value, the first branch bias storage being operable upon receipt of a first address portion of the branch instruction'"'"'s address to output the corresponding first branch bias value from the first branch bias storage;
a history storage operable to store history data identifying an outcome for a number of preceding branch instructions;
a single second branch bias storage having a number of entries, each entry being operable to store a replacement branch bias value and a TAG value indicative of an instance in which the replacement branch bias value should be used as the generated branch bias in preference to the first branch bias value;
index generation logic operable to generate an index identifying a corresponding entry in the single second branch bias storage, the index being derived from the history data;
the single second branch bias storage being operable upon receipt of the index to cause the content of the corresponding entry to be output from the single second branch bias storage; and
selection logic operable to select as the branch bias generated by the branch prediction logic the first branch bias value, unless the TAG value output from the single second branch bias storage corresponds to a comparison TAG value derived from a second address portion of the branch instruction'"'"'s address, in which event, the selection logic is operable to select as the branch bias generated by the branch prediction logic the replacement branch bias value output from the single second branch bias storage. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A data processing apparatus comprising:
-
an execution unit operable to execute a sequence of instructions; and
a prefetch unit operable to prefetch instructions from a memory for passing to the execution unit;
the prefetch unit including branch prediction logic operable to generate a branch bias providing a prediction as to whether execution of a branch instruction by the execution unit will result in a branch being taken or not taken;
the branch prediction logic comprising;
a first branch bias storage operable to store for each of a plurality of first address portions a corresponding first branch bias value, the first branch bias storage being operable upon receipt of a first address portion of the branch instruction'"'"'s address to output the corresponding first branch bias value from the first branch bias storage;
a history storage operable to store history data identifying an outcome for a number of preceding branch instructions;
a single second branch bias storage having a number of entries, each entry being operable to store a replacement branch bias value and a TAG value indicative of an instance in which the replacement branch bias value should be used as the generated branch bias in preference to the first branch bias value;
index generation logic operable to generate an index identifying a corresponding entry in the single second branch bias storage, the index being derived from the history data;
the single second branch bias storage being operable upon receipt of the index to cause the content of the corresponding entry to be output from the single second branch bias storage; and
selection logic operable to select as the branch bias generated by the branch prediction logic the first branch bias value, unless the TAG value output from the single second branch bias storage corresponds to a comparison TAG value derived from a second address portion of the branch instruction'"'"'s address, in which event, the selection logic is operable to select as the branch bias generated by the branch prediction logic the replacement branch bias value output from the single second branch bias storage.
-
-
11. A method of generating within a data processing apparatus a branch bias providing a prediction as to whether execution of a branch instruction will result in a branch being taken or not taken, the method comprising the steps of:
-
referencing a first branch bias storage using a first address portion of the branch instruction'"'"'s address, the first branch bias storage being operable to store for each of a plurality of first address portions a corresponding first branch bias value, and being responsive to said referencing to output the first branch bias value corresponding to the first address portion of the branch instruction'"'"'s address;
storing history data identifying an outcome for a number of preceding branch instructions;
generating an index identifying a corresponding entry in a single second branch bias storage, the index being derived from the history data, the single second branch bias storage having a number of entries, each entry being operable to store a replacement branch bias value and a TAG value indicative of an instance in which the replacement branch bias value should be used as the generated branch bias in preference to the first branch bias value;
referencing the single second branch bias storage using the index to cause the content of the corresponding entry to be output from the single second branch bias storage; and
selecting as the generated branch bias the first branch bias value, unless the TAG value output from the single second branch bias storage corresponds to a comparison TAG value derived from a second address portion of the branch instruction'"'"'s address, in which event, selecting as the generated branch bias the replacement branch bias value output from the single second branch bias storage. - View Dependent Claims (12, 13, 14, 15, 16, 17, 18, 19)
-
Specification