US 7,490,229 B2
Storing results of resolvable branches during speculative execution to predict branches during non-speculative execution
Marc Tremblay, Menlo Park, Calif. (US); Shailender Chaudhry, San Francisco, Calif. (US); and Quinn A. Jacobson, Sunnyvale, Calif. (US)
Assigned to Sun Microsystems, Inc., Santa Clara, Calif. (US)
Filed on Mar. 29, 2005, as Appl. No. 11/93,197.
Claims priority of provisional application 60/558056, filed on Mar. 30, 2004.
Prior Publication US 2005/0223200 A1, Oct. 06, 2005
Int. Cl. G06F 9/00 (2006.01)
U.S. Cl. 712—239 15 Claims
OG exemplary drawing
 
1. A method for storing the results of resolvable branches while speculatively executing code to facilitate faster non-speculative execution of the code, the method comprising:
executing code non-speculatively within a processor;
upon encountering a stall condition that causes the non-speculative execution of the code to stop during execution of the code, speculatively executing the code from the point of the stall without committing results of the speculative execution to the architectural state of the processor;
upon encountering a branch instruction during the speculative execution of the code, if the branch can be resolved, storing the result of the resolved branch in a first-in-first-out (FIFO) branch queue, otherwise, if the branch cannot be resolved, retrieving a prediction for the branch from a branch predictor and storing the prediction into the FIFO branch queue;
when the stall condition is resolved, resuming non-speculative execution of the code from the point of the stall; and
upon encountering a branch instruction during the non-speculative execution of the code, retrieving a next branch resolution or prediction in order from the FIFO branch queue and using the next branch resolution or prediction to make a branch prediction for the branch.