Patent ID: 6978361

Claim:
A method for predicting whether a branch will be taken when a computational circuit executes a conditional branch instruction, comprising the steps of: a. associating a branch prediction field with the conditional branch instruction, the branch prediction field including at least a first state and a different second state; b. upon accessing the conditional branch instruction, preparing to execute the conditional branch instruction as though the branch will result if the branch prediction field is in the first state and preparing to execute the conditional branch instruction as though the branch will not result if the branch prediction field is in the second state, thereby generating a branch prediction; c. determining an actual branch result, based on the conditional branch instruction; d. comparing the branch prediction to the actual branch result; e. if the branch prediction is different from the actual branch result, modifying the branch prediction field in a first way; f modifying the branch prediction field in a second way, different from the first way, if the branch prediction identical to the actual branch result; and g. modifying a change bit in a cache directory when the branch prediction field has been modified, wherein the conditional branch instruction is resident in a lower-order memory, the method further comprising the step of modifying the branch prediction field in a corresponding higher-order memory when the branch instruction resident in the lower-order memory is written over and when the change bit has been modified.