Patent ID: 7975133

Claim:
In a microprocessor system using pipelined instruction processing, a method for repairing a speculative global history prediction record, the method comprising: accepting a first microprocessor instruction of consecutive operations, including a first conditional branch operation with an associated first branch address, at a first stage in a pipelined microprocessor execution process; hashing a speculative global history record (SGHR) of conditional branch resolutions and predictions with the first conditional branch address, creating a first hash result; using the first hash result to index a branch history table (BHT) of previous first conditional branch resolutions, wherein hashing the speculative global history record with the first branch address includes performing an exclusive-OR (XOR) operation between a value representing the speculative global history record and a value representing the first branch address; and, in response to indexing the BHT, making a first branch prediction; resolving the first conditional branch operation; in response to the first branch prediction being incorrect, correcting the SGHR using the non-speculative global history record; and, updating the BHT with the first branch resolution as follows: incrementing the count in response to the first branch being taken, clamping the count to a maximum value of m=2 n −1, where M and N are integer variables, and N is greater than 1; and, decrementing the count in response to the first branch not being taken, clamping the count to a minimum value of zero.