Hybrid Return Address Prediction Unit for Out-of-Order Execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data processing apparatuses face challenges in efficiently managing return addresses during speculative execution, particularly when mispredictions occur, due to the need for complex mechanisms and high hardware usage in handling nested calls and out-of-order instruction execution.
Innovation Solution
A hybrid return address prediction unit that combines a stack portion for maintaining return addresses with a buffer portion for storing a detailed history of unresolved call and return instructions, allowing for targeted updates and reduced storage requirements by displacing oldest entries from the buffer to the stack when full, enabling efficient misprediction handling and out-of-order branch resolution.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If a return stack is used to store return addresses for speculative execution, then multiple return addresses can be stored efficiently, but the entire return stack must be discarded when a misprediction occurs
Solution Approach 1:
The return address storage is segmented into two distinct parts: a return stack for storing return addresses and a buffer for storing detailed history information. This segmentation allows the system to maintain a compact return stack while having access to detailed history in the buffer, enabling selective updates rather than complete stack discarding upon misprediction.
Solution Approach 2:
A buffer is introduced as an intermediary structure between the return stack and the detailed history requirements. The buffer stores intermediate history information that can be selectively updated or discarded based on misprediction, acting as a mediator that protects the return stack from complete discarding while still providing the necessary history for accurate return address prediction.
2Productivity
If targeted mechanisms for recovering the return stack are implemented, then misprediction recovery becomes more efficient, but the mechanism becomes relatively complex
Solution Approach 1:
The recovery mechanism is simplified by segmenting the history storage into a return stack and a buffer. The buffer handles the complex task of tracking detailed history with entry validity bits, while the return stack maintains a simpler structure. This segmentation allows targeted recovery operations to be performed on the buffer without affecting the entire return stack, improving efficiency while managing complexity.
Solution Approach 2:
The system changes the state parameters of history entries by using validity bits to mark entries as valid or invalid. This parameter change approach allows the system to efficiently handle mispredictions by simply invalidating relevant buffer entries rather than performing complex recovery operations, thereby improving productivity while keeping the mechanism relatively simple.
3Productivity
If out-of-order instruction execution is implemented, then instruction processing efficiency improves, but handling call/return instruction resolution becomes complex and requires significant hardware
Solution Approach 1:
The buffer acts as an intermediary structure that handles the complexity of out-of-order call/return resolution. By storing detailed history information including validity bits and instruction pointers in the buffer, the system can track and resolve out-of-order calls and returns without requiring complex hardware mechanisms. The buffer absorbs the complexity while allowing the return stack to remain relatively simple.
Solution Approach 2:
The system copies necessary information into the buffer structure, including history entries with validity bits and instruction pointers. This copying approach allows the system to maintain a simplified return stack while having a complete record of call/return instructions in the buffer, reducing the hardware requirements for out-of-order resolution compared to maintaining complex state in the return stack itself.
4Quantity of substance
If a buffer portion is added to maintain buffered history, then storage requirements are reduced, but the structure becomes more complex
Solution Approach 1:
The return address prediction unit is segmented into a return stack and a buffer portion. The buffer stores detailed history information with validity bits, while the return stack stores return addresses. This segmentation reduces overall storage requirements by only keeping essential information in the return stack while using the buffer for detailed history that can be selectively invalidated.
Solution Approach 2:
The buffer implements a discarding and recovering mechanism where invalid entries are marked with validity bits rather than being physically removed. This allows the system to efficiently manage storage by discarding invalid history entries upon misprediction while recovering valid ones, reducing storage requirements without significantly increasing structural complexity.
Data Source
AI summary
A data processing apparatus executes call instructions, and after a sequence of instructions executed in response to a call instruction a return instruction causes the program flow to return to a point in the program sequence associated with that call instruction. The data processing apparatus is configured to speculatively execute instructions in dependence on a predicted outcome of earlier instructions and a return address prediction unit is configured to store return addresses associated with unresolved call instructions. The return address prediction unit comprises: a stack portion onto which return addresses associated with unresolved call instructions are pushed, and from which a return address is popped when a return instruction is speculatively executed; and a buffer portion which stores an entry for each unresolved call instruction executed and for each return instruction which is speculatively executed.


