# US 2005/0050309 A1 · Data processor

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

- Number: US 2005/0050309 A1
- Document ID: US20050050309A1
- Status: Published application
- Kind: A1
- Application number: 10/927,199
- Filed: 2004-08-27
- Published: 2005-03-03
- Earliest claimed: 2003-08-29
- Assignees: Renesas Technology Corp.; SuperH, Inc.
- Inventors: Hajime Yamashita; Kiwamu Takada; Takahiro Irita; Toru Hiraoka
- Web page: https://patentgrep.com/patent/US20050050309A1

## CPC

- G06F 9/3804: {for branches, e.g. hedging, branch folding}
- G06F 9/3844: {using dynamic branch prediction, e.g. using branch history tables}
- G06F 9/3861: {Recovery, e.g. branch miss-prediction, exception handling (error detection or correction G06F11/00)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data processor for executing branch prediction comprises a queuing buffer (23) allocated to an instruction queue and to a return destination instruction queue and having address pointers managed for each instruction stream and a control portion (21) for the queuing buffer. The control portion stores a prediction direction instruction stream and a non-prediction direction instruction stream in the queuing buffer and switches an instruction stream as an execution object from the prediction direction instruction stream to the non-prediction direction instruction stream inside the queuing buffer in response to failure of branch prediction. When buffer areas (Qa1, Qb) are used as the instruction queue, the buffer area (Qa2) is used as a return instruction queue and the buffer area (Qa1) is used as a return instruction queue. A return operation of a non-prediction direction instruction string at the time of failure of branch prediction is accomplished by stream management without using fixedly and discretely the instruction queue and the return destination instruction queue.

## Claims

### Claim 1

A data processor for executing branch prediction, comprising:
a queuing buffer allocated to an instruction queue and to a return destination instruction queue and having address pointers managed for each instruction stream; and
a control portion for the queuing buffer;
wherein the control portion stores a prediction direction instruction stream and a non-prediction direction instruction stream in the queuing buffer and switches an instruction stream as an execution object from the prediction direction instruction stream to the non-prediction direction instruction stream inside the queuing buffer in response to failure of branch prediction.

### Claim 2 (depends on 1)

A data processor as defined in claim 1, wherein the queuing buffer includes first and second storage areas to which the same physical address is allocated, and allocation of either one of the first and second storage areas to the instruction queue and the other to the return destination instruction queue is changeable.

### Claim 3 (depends on 2)

A data processor as defined in claim 2, which further includes a third storage area to which a physical address continuing the physical addresses allocated respectively to the first and second storage areas is allocated, and wherein the third storage area is allocated to a part of the instruction queue continuing the first or second storage area allocated to the instruction queue.

### Claim 4 (depends on 1)

A data processor as defined in claim 1, wherein the control portion stores the non-prediction direction instruction stream in the return destination instruction queue when the branch prediction is non-branch.

### Claim 5 (depends on 4)

A data processor as defined in claim 4, wherein the control portion stores the non-prediction direction instruction stream in an empty area of the instruction queue when the branch prediction is branch.

### Claim 6 (depends on 5)

A data processor as defined in claim 5, wherein the control portion switches allocation of the return destination instruction queue to the instruction queue and the instruction queue to the return destination instruction queue in response to the failure of branch prediction when the non-prediction direction instruction stream exists in the return destination instruction queue.

### Claim 7 (depends on 6)

A data processor as defined in claim 6, wherein the control portion uses the non-prediction direction instruction stream of an empty area as the instruction stream to be executed in response to the failure of branch prediction when the non-prediction direction instruction stream exists in the empty area of the instruction queue and stores the prediction direction instruction stream in succession to the non-prediction direction instruction stream.

### Claim 8 (depends on 7)

A data processor as defined in claim 7, which further includes re-writable flag means for representing whether address pointers are address pointers of the instruction queue or address pointers of the return destination instruction queue, as a pair with the address pointer.

### Claim 9 (depends on 7)

A data processor as defined in claim 7, which further includes storage means for storing information for linking the non-prediction direction instruction stream stored in the queuing buffer with branch instruction relating to prediction of the non-prediction direction instruction stream.

### Claim 10 (depends on 9)

A data processor as defined in claim 9, wherein the storage means is a return instruction stream number queue for serially storing identification information of the non-prediction direction instruction stream stored in the queuing buffer in the sequence of execution of branch instruction.

### Claim 11

A data processor for executing branch prediction, comprising:
a queuing buffer allocated to an instruction queue and to a return destination instruction queue and having address pointers managed for each instruction stream; and
a control portion for the queuing buffer;
wherein the control portion stores a prediction direction instruction stream in the instruction queue, stores a non-prediction direction instruction stream in a return destination instruction queue when branch prediction is non-branch and stores the non-prediction direction instruction stream in an empty area of the instruction queue when branch prediction is branch.

### Claim 12 (depends on 11)

A data processor as defined in claim 11, wherein the control portion switches an instruction stream as an execution object from the prediction direction instruction stream inside the queuing buffer to the non-prediction direction instruction stream in response to the failure of branch prediction.

### Claim 13 (depends on 12)

A data processor as defined in claim 12, wherein the control portion switches allocation of the return destination instruction to the instruction queue and the instruction queue to the return destination instruction queue in response to the failure of branch prediction when the non-prediction direction instruction stream exists in the return destination instruction queue.

### Claim 14 (depends on 13)

A data processor as defined in claim 13, wherein the control portion uses the non-prediction direction instruction stream of an empty area as the instruction stream to be executed in response to the failure of branch prediction when the non-prediction direction instruction stream exists in the empty area of the instruction queue and stores the prediction direction instruction stream in succession to the non-prediction direction instruction stream.

### Claim 15 (depends on 14)

A data processor as defined in claim 14, which further includes re-writable flag means for representing whether address pointers are address pointers of the instruction queue or address pointers of the return destination instruction queue, as a pair with the address pointer.

### Claim 16 (depends on 11)

A data processor as defined in claim 11, which further includes storage means for storing information for linking the non-prediction direction instruction stream stored in the queuing buffer with branch instruction relating to prediction of the non-prediction direction instruction stream.

### Claim 17 (depends on 16)

A data processor as defined in claim 16, wherein the storage means is a return instruction stream number queue for serially storing identification information of the non-prediction direction instruction stream stored in the queuing buffer in the sequence of execution of branch instruction.

### Claim 18 (depends on 1)

A data processor as defined in claim 1, wherein an instruction as a starting point of the instruction stream contains an instruction the execution of which is started after resetting and a branch destination instruction, and an instruction as an end point of the instruction stream contains an unconditional branch instruction and a conditional branch instruction of branch prediction.

### Claim 19 (depends on 1)

A data processor as defined in claim 1, wherein the queuing buffer and its control portion are arranged in an instruction control portion of a central processing unit.

### Claim 20 (depends on 19)

A data processor as defined in claim 19, which further includes an instruction cache memory connected to the central processing unit and is formed on a semiconductor chip.
