Patent ID: 7822954

Claim:
A computer implemented method for recovering from branch prediction latency for a surprise-guessed-taken (SGT) branch, the method comprising: delivering instructions along a predicted path comprising a plurality of branches each having a predicted branch target from which one or more instructions are fetched; receiving a surprise branch without an indication of the surprise branch being dynamically predicted; identifying, by a processor, the surprise branch as a branch that should be guessed taken; signaling the surprise branch as an SGT branch by generating an SGT branch detected signal indicating that the delivery of instructions along the predicted path should cease and a refetch should be initiated; detecting an SGT branch latency by determining that the SGT branch is predicted as taken, but the prediction is generated too late relative to a fetch of the branch to alter a sequence of fetched instructions along the predicted path; in response to detecting the SGT branch latency, blocking the SGT branch detected signal; and continuing the delivering of instructions along the predicted path.