Branch Prediction Using Call Stack Leading Values
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current branch prediction technologies for indirect branching in processors require explicit operation instructions, increasing development time and effort, and are inefficient in predicting branch destinations without additional processing.
Innovation Solution
A branch prediction device that utilizes a call stack to store function arguments and records branch results, allowing the prediction of branch destinations by matching branch instruction addresses and call stack values, eliminating the need for explicit operation instructions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If conventional indirect branching prediction technologies are used, then branch destination prediction capability is provided, but explicit operation instructions are required which increase development time and effort
Solution Approach 1:
The system uses existing function call instructions and call stack data to automatically perform branch prediction, eliminating the need for explicit prediction instructions. The call stack already contains function arguments that serve as key information for prediction, so the system leverages this existing data structure to serve its own prediction needs without additional programming effort.
Solution Approach 2:
The call stack, originally designed for function call management, is also utilized for branch prediction purposes. By making the call stack serve dual functions (function management and prediction data storage), the system eliminates the need for separate prediction instruction mechanisms, reducing development complexity while maintaining prediction capability.
2Reliability
If explicit operation instructions are added for branch prediction, then prediction capability is improved, but program complexity and processing overhead increase
Solution Approach 1:
The existing call stack data structure automatically provides the key information needed for branch prediction through its existing function argument storage. No additional prediction instructions or data structures are required, as the call stack self-provides the necessary prediction data through its normal operation.
Solution Approach 2:
The branch prediction function is merged with the existing function call mechanism. By combining prediction capabilities with the already-present function call instructions and call stack, the system avoids adding separate prediction instruction sequences, thereby reducing program complexity while achieving prediction accuracy.
3Productivity
If traditional branch prediction methods are used for indirect branching, then some prediction capability is achieved, but efficiency is reduced due to lack of automatic key information extraction
Solution Approach 1:
The call stack pre-stores function arguments during normal function call execution, preparing the key information needed for branch prediction in advance. When branch prediction is needed, this information is already available in the call stack, eliminating the time required for extracting key information at prediction time and thus improving processing efficiency.
Data Source
AI summary
A branch prediction mechanism within an information processing device comprises a call stack where function arguments are stacked when function calls are performed. The call stack stores arguments relating to branch instructions within the function. The branch prediction mechanism stores the branch instruction address, the leading value of the call stack, and the branch destination address at branch instruction execution time, which are in correspondence, in a branch result buffer. A branch prediction unit obtains the branch instruction address and leading value of the call stack when notified of branch instruction execution, searches the branch result buffer for a branch destination corresponding to the address and leading value, and predicts the search result as the branch destination of the executed branch instruction. An instruction fetch unit fetches instructions from the branch destination predicted by the branch prediction unit.


