# US 2010/0169622 A1 · Processor register recovery after flush operation

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2010/0169622 A1
- Document ID: US20100169622A1
- Status: Published application
- Kind: A1
- Application number: 12/347,924
- Filed: 2008-12-31
- Published: 2010-07-01
- Earliest claimed: 2008-12-31
- Assignees: International Business Machines Corporation; IBM Corporation
- Inventors: Dung Quoc Nguyen
- Web page: https://patentgrep.com/patent/US20100169622A1

## CPC

- G06F 9/3844: {using dynamic branch prediction, e.g. using branch history tables}
- G06F 9/3838: {Dependency mechanisms, e.g. register scoreboarding}
- G06F 9/3863: {using multiple copies of the architectural state, e.g. shadow registers}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An information handling system includes a processor that may perform general purpose register recovery operations after an instruction flush operation that an exception, such as a branch misprediction causes. The processor receives an instruction stream that may include multiple instructions that operate on a particular target register that stores instruction result information. The general purpose register may temporarily store instruction opcode and register bits information for use during dispatch, execution and other operations. The processor includes a recovery buffer unit for use during flush recovery operations. The processor may use recovery valid and recovery pending bits that correspond with each instruction during the register recovery from flush operation.

## Claims

### Claim 1

A method of processing instructions, comprising
fetching, by a fetch unit, a plurality of instructions from an instruction source;
decoding the plurality of instructions, by a decoder/dispatcher, the plurality of instructions including instructions that reference a target register of a general purpose register for storage of results thereof, the instructions that reference the target register including a current instruction and previous instructions;
dispatching, by the decoder/dispatcher, the plurality of instructions to an issue queue,
issuing, by the issue queue, the plurality of instructions that reference the particular target register out-of-order to execution units;
storing a respective entry in a recovery buffer unit for each of the previous instructions and the current instruction, the previous instructions and the current instruction referencing the same target register;
speculatively executing, by the execution units, the previous instructions and the current instruction;
determining, by a branch execution unit, if an exception occurred for one of the previous instructions that requires an issue queue flush;
performing an issue queue flush if an exception occurred in the determining step;
performing, in response to the exception, a recovery buffer unit recovery to determine an oldest valid entry of the recovery buffer unit; and
restoring the general purpose register to a known good state using a result of a target register corresponding to the oldest valid entry of the recovery buffer unit determined in the recovery buffer unit recovery.

### Claim 2 (depends on 1)

The method of claim 1, wherein the performing of the recovery buffer unit recovery is in response to flushing of speculatively executed instructions after a branch misprediction.

### Claim 3 (depends on 1)

The method of claim 1, wherein each recovery buffer unit entry includes a first pointer to a first instruction and a second pointer to a second instruction immediately following the first instruction.

### Claim 4 (depends on 3)

The method of claim 3, wherein the first pointer is a previous instruction and the second pointer is a current instruction.

### Claim 5 (depends on 4)

The method of claim 4, wherein the first pointer is a PITAG address and the second pointer is an ITAG address.

### Claim 6 (depends on 4)

The method of claim 4, further comprising storing a respective recovery valid bit per entry in the recovery buffer unit.

### Claim 7 (depends on 6)

The method of claim 6, further comprising determining, by the recovery buffer unit, from the first and second pointers and recovery bits of the entries of the recovery buffer unit an oldest entry of the recovery buffer unit that does not require recovery in response to the exception.

### Claim 8 (depends on 7)

The method of claim 7, further comprising writing to the general purpose register with information from the oldest entry of the recovery buffer unit that does not require recovery in response to the exception, thus restoring the general purpose register to a known good state.

### Claim 9

A processor, comprising:
a fetch unit that fetches a plurality of instructions from an instruction source; a decoder/dispatcher that decodes the plurality of instructions, the plurality of instructions including instructions that reference a target register of a general purpose register for storage of results thereof, the instructions that reference the target register including a current instruction and previous instructions, wherein the decoder/dispatcher dispatches the plurality of instructions to an issue queue that is coupled to the dispatcher;
a general purpose register, coupled to the dispatcher, that stores a state of the processor;
a plurality of execution units, coupled to the issue queue, wherein the issue queue issues the plurality of instructions that reference the particular target register out-of-order to the execution units;
a recovery buffer unit, coupled to the general purpose register, that stores a respective entry for each of the previous instructions and the current instruction, the previous instructions and the current instruction referencing the same target register, wherein the execution units speculatively execute the previous instructions and the current instruction;
a branch execution unit, coupled to the issue queue, that determines if an exception occurred for one of the previous instructions that requires an issue queue flush, wherein the issue queue performs an issue queue flush if the exception occurred; and
wherein the recovery buffer unit, in response to the issue queue flush, performs a recovery buffer unit recovery to determine an oldest valid entry of the recovery buffer unit, the recovery buffer unit restoring the general purpose register to a known good state using the result of a target register corresponding to the oldest valid entry of the recovery buffer unit.

### Claim 10 (depends on 9)

The processor of claim 9, wherein the processor performs a recovery buffer unit recovery is in response to the flushing of speculatively executed instructions after a branch misprediction.

### Claim 11 (depends on 9)

The processor of claim 9, wherein each recovery buffer unit entry includes a first pointer to a first instruction and a second pointer to a second instruction immediately following the first instruction.

### Claim 12 (depends on 11)

The processor of claim 11, wherein the first pointer is a previous instruction and the second pointer is a current instruction.

### Claim 13 (depends on 12)

The processor of claim 12, wherein the first pointer is a PITAG address and the second pointer is an ITAG address.

### Claim 14 (depends on 12)

The processor of claim 12, wherein the processor stores a respective recovery valid bit per entry in the recovery buffer unit.

### Claim 15 (depends on 14)

The processor of claim 14, further comprising determining, by the recovery buffer unit, from the first and second pointers and recovery bits of the entries of the recovery buffer unit an oldest entry of the recovery buffer unit that does not require recovery in response to the exception.

### Claim 16 (depends on 15)

The processor of claim 15, wherein the recovery buffer unit writes into the general purpose register information from the oldest entry of the recovery buffer unit that does not require recovery in response to the exception, thus restoring the general purpose register to a known good state.

### Claim 17

An information handling system (IHS), comprising:
a memory;
a processor, coupled to the memory, the processor including:
a fetch unit that fetches a plurality of instructions from an instruction source;
a decoder/dispatcher that decodes the plurality of instructions, the plurality of instructions including instructions that reference a target register of a general purpose register for storage of results thereof, the instructions that reference the target register including a current instruction and previous instructions, wherein the decoder/dispatcher dispatches the plurality of instructions to an issue queue that is coupled to the dispatcher;
a general purpose register, coupled to the dispatcher, that stores a state of the processor;
a plurality of execution units, coupled to the issue queue, wherein the issue queue issues the plurality of instructions that reference the particular target register out-of-order to the execution units;
a recovery buffer unit, coupled to the general purpose register, that stores a respective entry for each of the previous instructions and the current instruction, the previous instructions and the current instruction referencing the same target register, wherein the execution units speculatively execute the previous instructions and the current instruction;
a branch execution unit, coupled to the issue queue, that determines if an exception occurred for one of the previous instructions that requires an issue queue flush, wherein the issue queue performs an issue queue flush if the exception occurred; and
wherein the recovery buffer unit, in response to the issue queue flush, performs a recovery buffer unit recovery to determine an oldest valid entry of the recovery buffer unit, the recovery buffer unit restoring the general purpose register to a known good state using the result of a target register corresponding to the oldest valid entry of the recovery buffer unit.

### Claim 18 (depends on 17)

The IHS of claim 17, wherein the IHS performs a recovery buffer unit recovery is in response to the flushing of speculatively executed instructions after a branch misprediction.

### Claim 19 (depends on 17)

The IHS of claim 17, wherein each recovery buffer unit entry includes a first pointer to a first instruction and a second pointer to a second instruction immediately following the first instruction.

### Claim 20 (depends on 19)

The IHS of claim 19, wherein the first pointer is a previous instruction and the second pointer is a current instruction.

### Claim 21 (depends on 20)

The IHS of claim 20, wherein the first pointer is a PITAG address and the second pointer is an ITAG address.

### Claim 22 (depends on 20)

The IHS of claim 20, wherein the processor stores a respective recovery valid bit per entry in the recovery buffer unit.

### Claim 23 (depends on 22)

The IHS of claim 22, further comprising determining, by the recovery buffer unit, from the first and second pointers and recovery bits of the entries of the recovery buffer unit an oldest entry of the recovery buffer unit that does not require recovery in response to the exception.

### Claim 24 (depends on 23)

The IHS of claim 23, wherein the recovery buffer unit writes into the general purpose register information from the oldest entry of the recovery buffer unit that does not require recovery in response to the exception, thus restoring the general purpose register to a known good state.
