The present invention, in various embodiments, provides techniques for retiring
instructions that typically complete early as compared to most instructions. In
a first embodiment, at each stage of the various processing stages, each instruction
capable of early retirement is processed in accordance with that stage. At a particular
stage, if the instruction meets the criteria for early retirement, then the instruction
is terminated, e.g., "retired," and the system is updated to reflect that the instruction
has been terminated. However, if, at that particular stage, the instruction does
not meet the criteria for early retirement, then the instruction is processed to
the next stage, and it is determined again whether the instruction meets the criteria
for early retirement. If the instruction meets the criteria, then the instruction
is terminated, or if the instruction does not meet the criteria, then the instruction
is processed to the next stage, and so on, until the instruction is retired. In
a second embodiment, it is predetermined that early-completion instructions are
to be retired at a particular stage. Consequently, all instructions are processed
normally and early-completion instructions are retired when they reach that particular
stage. For example, early-completion instructions are retired out-of-order after
they reach a particular stage in an instruction queue, even though they meet the
early-retirement criteria prior to entering the queue. In a third embodiment, early-completion
instructions are retired out-of-order when an instruction queue is full. As a result,
all instructions are processed normally until the instruction queue is full. At
that time, the system is frozen, e.g., all units stop processing instructions.
For each instruction in the instruction queue, if the instruction meets the criteria
for early retirement, then the instruction is terminated and the system is updated
to reflect that the instruction has been terminated. The system is then unfrozen,
and all units resume their functions.