摘要 |
PROBLEM TO BE SOLVED: To realize, with a small quantity of hardware, a branch predicting device which correctly predicts a pattern in which branch-establishment and failure continue alternately. SOLUTION: This device is provided with a branch predictive table 100 which holds a 1-bit history bit and a 2-bit counter in every branch instruction, a prediction outputting part 101 which outputs the value of a history bit when the value of its counter is 0 or 2 and inverts the value of a history bit and outputs it when the value of its counter is 1 or 3, and a counter controlling part 102 which compares a branch result with the value of a history bit, defines the value of its counter as 0 when they coincide and increases the value of the counter by 1 in the case the counter value is other than 3 when they do not coincide. It is made possible to correctly predict a pattern in which branch- establishment and failure continue alternately while predictive performance to a branch pattern that is partial to either branch establishment or failure is maintained almost at the made level as that of a conventional branch predicting device by adding a small piece of hardware such as to add only 1 bit to a conventional 2-bit counter.
|