Branch Prediction Value Replacement in Arithmetic Processing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing branch prediction methods suffer from increased latency when wrong predictions occur, as they require recalculating values stored in flip-flops for correct subsequent instructions, leading to performance loss due to discarded speculative instructions.
Innovation Solution
An arithmetic processing apparatus with weight tables and weight arithmetic units that perform operations based on instruction addresses, allowing for parallel computation of branch prediction values and update values when wrong predictions are detected, enabling immediate replacement of stored values to maintain accurate predictions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If branch prediction is performed using piecewise-linear method with N weight tables and sequential addition operations, then branch prediction accuracy is improved, but branch prediction latency increases when wrong prediction occurs due to need to recalculate all values
Solution Approach 1:
The patent pre-calculates and stores intermediate sum values (SUM1 through SUMN) in first through Nth storage units respectively, before branch prediction is needed. When a wrong prediction occurs, these pre-computed values can be immediately replaced without requiring sequential recalculation, thus reducing the time penalty for wrong predictions while maintaining the accuracy benefits of the piecewise-linear method.
Solution Approach 2:
The patent divides the branch prediction calculation into N separate segments, each handled by a dedicated storage unit holding a partial sum value (SUM1 through SUMN). This segmentation allows independent management and replacement of each segment's data, enabling faster recovery from wrong predictions by only updating the affected segment rather than recalculating the entire prediction value sequentially.
2Productivity
If speculative instruction execution is performed based on branch prediction, then processor throughput is improved, but performance loss occurs when wrong prediction requires discarding all speculatively executed instructions
Solution Approach 1:
The patent pre-computes and stores intermediate prediction values in dedicated storage units before speculative execution begins. When a wrong prediction is detected, the system can quickly replace these pre-computed values with correct ones, minimizing the penalty for discarding speculative instructions and enabling faster restart of correct execution paths.
Solution Approach 2:
The patent implements a feedback mechanism where the actual branch outcome is compared with the predicted branch outcome. When a mismatch is detected (wrong prediction), the system uses this feedback to trigger replacement of the stored intermediate sum values with correctly computed values, ensuring that subsequent speculative executions are based on accurate prediction data.
3Measurement precision
If N flip-flops are used to store intermediate computation results for branch prediction, then prediction accuracy is maintained, but device complexity increases and replacement operations become more complex upon wrong prediction
Solution Approach 1:
The patent segments the prediction state into N independent storage units, each holding a partial sum value from a specific weight table. This segmentation simplifies the replacement operation upon wrong prediction, as each storage unit can be independently updated without affecting others, reducing the complexity of control logic compared to managing a single combined state in traditional flip-flop implementations.
Solution Approach 2:
The patent creates storage units that serve dual purposes: they store intermediate computation results during normal operation and can be rapidly replaced when wrong predictions occur. This multi-functionality allows the same storage structure to support both accurate prediction maintenance and efficient error recovery, reducing overall device complexity compared to having separate structures for each function.
Data Source
AI summary
An arithmetic processing apparatus includes weight tables each configured to store weighting factors in one-to-one correspondence with indexes associated with instruction addresses, a first weight arithmetic unit configured to perform a first operation and a second operation based on the weighting factors retrieved from the weight tables in response to an instruction fetch address, the first operation producing a first value for branch prediction for the instruction fetch address, the second operation producing second values for future branch prediction, and a second weight arithmetic unit configured to perform, in parallel with the second operation, a third operation equivalent to the second operation based on the weighting factors retrieved from the weight tables in response to an address of a completed branch instruction, wherein the second values stored in the first weight arithmetic unit are replaced with the third values upon detection of a wrong branch prediction.


