Patent ID: 7490229

Claim:
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.