Speculative Global History Record for Branch Prediction
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In pipelined micro-architectures, the latency between branch prediction and instruction fetch stages, and the need to wait until the EX stage for branch resolution to update the Global History Shift Register (GHSR) and Branch History Table (BHT), leads to inefficiencies and reduced prediction accuracy due to the use of 'old' information for branch predictions.
Innovation Solution
Implementing a speculative Global History Record (GHR) that is updated early in the pipeline with predicted branch decisions and a non-speculative GHR updated at branch resolution, allowing for correction of the speculative GHR when predictions are incorrect, thereby discarding incorrect predictions and maintaining accurate information for future branch instructions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If a speculative Global History Record is updated early in the pipeline with predicted branch decisions, then prediction speed is improved, but prediction accuracy deteriorates due to use of old information
Solution Approach 1:
The patent divides the Global History Record into two separate records: a speculative GHR updated early in the pipeline with predicted branch decisions for fast prediction, and a non-speculative GHR updated at branch resolution with actual outcomes for accuracy. This segmentation allows each record to serve its specific purpose without compromise.
Solution Approach 2:
The speculative GHR is updated preliminarily, before the branch is actually resolved, using predicted branch decisions. This preliminary action enables the prediction to be made early in the pipeline without waiting for the branch resolution, thus improving prediction speed while the non-speculative GHR ensures accuracy.
2Loss of time
If branch predictions are made early in the pipeline, then latency is reduced, but prediction accuracy worsens due to use of outdated branch history information
Solution Approach 1:
The patent segments the branch history information into speculative and non-speculative components, allowing the speculative component to be used early for low-latency predictions while the non-speculative component maintains accuracy by being updated with actual resolution outcomes.
Solution Approach 2:
The system implements feedback by comparing the speculative branch predictions with the actual branch resolutions. When discrepancies are detected, the non-speculative GHR is updated with the correct information, and this corrected information feeds back into the prediction mechanism to improve future predictions.
3Measurement precision
If the Global History Record is updated only at branch resolution, then prediction accuracy is maintained, but pipeline latency increases due to waiting for EX stage
Solution Approach 1:
The speculative GHR is updated preliminarily in the ID stage or earlier, before the branch is resolved in the EX stage. This preliminary update with predicted decisions allows the prediction to be made without waiting for the branch resolution, thus reducing pipeline latency while the non-speculative update at resolution maintains accuracy.
4Speed
If incorrect branch predictions are made, then prediction speed is maintained, but pipeline efficiency deteriorates due to flushing of instructions
Solution Approach 1:
The system prepares for potential prediction errors by maintaining the non-speculative GHR with accurate branch resolution information. This acts as a cushion that can correct erroneous predictions from the speculative GHR, reducing the need for pipeline flushing and maintaining efficiency even when speed is prioritized.
Data Source
AI summary
A system and method are provided for updating a speculative global history prediction record in a microprocessor system using pipelined instruction processing. The method accepts microprocessor instructions with consecutive operations, including a conditional branch operation with an associated first branch address. A speculative global history record (SGHR) of conditional branch resolutions and predictions is accessed and hashed with the first branch address, creating a first hash result. The first hash result is used to index a branch history table (BHT) of previous first branch resolutions. As a result, a first branch prediction is made, and the SGHR is updated with the first branch prediction. A non-speculative global history record (NSGHR) of branch resolutions is updated with the resolution of the first branch operation, and if the first branch prediction is incorrect, the SGHR is corrected using the NSGHR.


