Branch prediction using hypervectors
Abstract
Apparatuses and methods for branch prediction are provided. Branch prediction circuitry generates prediction with respect to branch instructions of whether those branches will be taken or not-taken. Hypervector generation circuitry assigns an arbitrary hypervector in deterministic dependence on an address of each branch instruction, wherein the hypervectors comprises at least 500 bits. Upon the resolution of a branch a corresponding hypervector is added to a stored taken hypervector or a stored not-taken hypervector in dependence on the resolution of the branch. The branch prediction circuitry generates a prediction for a branch instructions in dependence on a mathematical distance metric of a hypervector generated for that branch instruction from the stored taken hypervector or the not-taken hypervector.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 7 · Forward citations: 2.
Claims (8)
- Claim 1Independent Claim
An apparatus comprising: processing circuitry configured to perform data processing operations in response to instructions, wherein the instructions comprises branch instructions; branch prediction circuitry configured to generate a prediction with respect to a branch instruction of whether a branch specified by the branch instruction will be taken or not-taken; and hypervector storage configured to store at least one of a taken hypervector and a not-taken hypervector, wherein the processing circuitry is configured to perform speculative instruction execution based on the prediction generated by the branch prediction circuitry, and the branch prediction circuitry comprises hypervector generation circuitry configured to assign an arbitrary hypervector in deterministic dependence on an address of the branch instruction, wherein the hypervector comprises at least 500 bits, wherein the branch prediction circuitry is responsive to a resolution of the branch specified by the branch instructi
- Claim 2Depends on #1
The apparatus as claimed in claim 1, wherein the hypervector storage is configured to store the taken hypervector and the not-taken hypervector, wherein the branch prediction circuitry is responsive to a resolution of the branch specified by the branch instruction when the processing circuitry has executed the branch instruction to add the hypervector to either the stored taken hypervector or the stored not-taken hypervector in dependence on the resolution of the branch, and wherein the branch prediction circuitry is configured to generate the prediction as taken when the mathematical distance metric of the hypervector from the stored taken hypervector is smaller than the mathematical distance metric of the hypervector from the stored not-taken hypervector and to generate the prediction as not-taken when the mathematical distance metric of the hypervector from the stored not-taken hypervector is smaller than the mathematical distance metric of the hypervector from the stored taken hype
- Claim 3Depends on #1
The apparatus as claimed in claim 1, wherein the hypervector generation circuitry is configured to generate the hypervector in deterministic dependence on a sequence of addresses of branch instructions.
- Claim 4Depends on #3
The apparatus as claimed in claim 3, wherein the hypervector generation circuitry is configured to generate a respective hypervector for each address of the sequence of addresses of branch instructions and to combine the respective hypervectors to generate the hypervector.
- Claim 5Depends on #4
The apparatus as claimed in claim 4, wherein the hypervector generation circuitry is configured to combine the respective hypervectors to generate the hypervector by applying an element translocation to each hypervector, wherein a number of element positions by which each hypervector is translocated is dependent on a number of branches by which each branch is separated from a current branch subject of the branch prediction.
- Claim 6Depends on #3
The apparatus as claimed in claim 3, wherein the hypervector generation circuitry is configured to generate the respective hypervector for each address of the sequence of addresses of branch instructions in further dependence on a direction bit indicative of whether the branch of each branch instruction was taken or not-taken.
- Claim 7Depends on #3
The apparatus as claimed in claim 3, wherein the hypervector generation circuitry is configured to generate the hypervector by removing an oldest hypervector contribution from an oldest branch instruction from a preceding sequence of addresses of branch instructions and adding a newest hypervector contribution from a youngest branch instruction of the sequence of addresses of branch instructions.
- Claim 8Depends on #3
The apparatus as claimed in claim 3, wherein the hypervector storage is configured to store the at least one of a taken hypervector and a not-taken hypervector for each of a range of lengths of sequences of addresses of branch instructions, and wherein the branch prediction circuitry is configured to generate the prediction in further dependence on a mathematical distance metric of the hypervector from the stored at least one of the taken hypervector and the not-taken hypervector for each of the lengths of sequences of addresses of branch instructions.
Technical Overview & Description
The present techniques relate to data processing. More particularly they relate to branch prediction. A data processing apparatus which executes a sequence of instructions which comprise branch instructions may be provided with the capability to predict the outcome of a given branch based on past behaviour and on that basis to speculatively execute further instructions following the assumed outcome before the given branch actually resolves. Such branch prediction mechanisms enhance the instruction execution throughput of an apparatus, since it need not wait for each branch to resolve before the instructions which follow the branch outcome are executed. Furthermore the occasions on which the branch prediction is correct may be relatively infrequent if the branch predictor is well trained and the price of abandoning the data processing incorrectly speculatively performed maybe significantly outweighed by the instruction execution throughput advantages of speculative execution. Nevertheless opportunities remain for further improvements in branch prediction technologies. At least some examples provide an apparatus comprising: processing circuitry to perform data processing operations in response instructions, wherein the instructions comprises branch instructions; branch prediction circuitry to generate a prediction with respect to a branch instruction of whether a branch specified by the branch instruction will be taken or not-taken; and hypervector storage to store at least one of a taken hypervector and a not-taken hypervector, wherein the processing circuitry is arranged to perform speculative instruction execution based on the prediction generated by the branch prediction circuitry, and the branch prediction circuitry comprises hypervector generation circuitry to assign an arbitrary hypervector in deterministic dependence on an address of the branch instruction, wherein the hypervector comprises at least 500 bits, wherein the branch prediction circuitry is responsi
Cited By — Indexed Forward Citations (2 of 2 total)
| Patent | Title | Year | Citations |
|---|---|---|---|
| US 12,518,150 B2 | Bundling hypervectors | 2026 | 0 |
| US 12,572,789 B2 | Blockwise factorization of hypervectors | 2026 | 0 |
References Cited — Backward Prior Art (7)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (5)
- Huang Mingkai, et al.,
- “
- An Energy-Efficient Branch Prediction with Grouped Global History
- ”
- , International Conference on Parallel Processing, IEEE, Sep. 1, 2015 (Sep. 1, 2015), pp. 140-149, XP032828151, ISSN: 0190-3918, DOI: 10.1109/ICPP.2015.23; [retrieved on Dec. 8, 2015] the whole document.