Speculative execution of both paths of a weakly predicted branch instruction
AssigneeInternational Business Machines Corporation
InventorsKenneth L. WARD, Dung Q. NGUYEN, Susan E. EISEN, Hung LE
Life of this patent
Estimating the term…
Abstract
Systems, methods, and computer-readable media are described for performing speculative execution of both paths/branches of a weakly predicted branch instruction. A branch instruction may be fetched from an instruction queue and determined to be a weakly predicted branch instruction, in which case, both paths of the branch instruction may be dispatched and speculatively executed. When the actual path taken becomes known, instructions corresponding to the path not taken may be flushed. Instructions from both paths of a weakly predicted branch instruction that are speculatively executed may be dispatch and executed in an interleaved manner.
Claims20
A computer-implemented method for speculative execution of a branch instruction, the method comprising:
- fetching the branch instruction;
- determining that the branch instruction is weakly predicted;
- dispatching a first path and a second path of the branch instruction;
- executing a first set of instructions in the first path of the branch instruction;
- executing a second set of instructions in the second path of the branch instruction;
- determining that the first path of the branch instruction is the path taken;
- and
- flushing the second set of instructions in the second path of the branch instruction.
A system for speculative execution of a branch instruction, the system comprising:
- at least one memory storing computer-executable instructions;
- and
- at least one processor, wherein the at least one processor is configured to access the at least one memory and execute the computer-executable instructions to:
- fetch the branch instruction;
- determine that the branch instruction is weakly predicted;
- dispatch a first path and a second path of the branch instruction;
- execute a first set of instructions in the first path of the branch instruction;
- execute a second set of instructions in the second path of the branch instruction;
- determine that the first path of the branch instruction is the path taken;
- and
- flush the second set of instructions in the second path of the branch instruction.
A computer program product for speculative execution of a branch instruction, the computer program product comprising a storage medium readable by a processing circuit, the storage medium storing instructions executable by the processing circuit to cause a method to be performed, the method comprising:
- fetching the branch instruction;
- determining that the branch instruction is weakly predicted;
- dispatching a first path and a second path of the branch instruction;
- executing a first set of instructions in the first path of the branch instruction;
- executing a second set of instructions in the second path of the branch instruction;
- determining that the first path of the branch instruction is the path taken;
- and
- flushing the second set of instructions in the second path of the branch instruction.
Dependencies are inferred from the claim text.