# US 2017/0371669 A1 · Branch target predictor

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

- Number: US 2017/0371669 A1
- Document ID: US20170371669A1
- Status: Published application
- Kind: A1
- Application number: 15/192,794
- Filed: 2016-06-24
- Published: 2017-12-28
- Earliest claimed: 2016-06-24
- Assignees: QUALCOMM Incorporated
- Applicants: QUALCOMM Incorporated
- Inventors: Anil Krishna; Gregory Wright
- Web page: https://patentgrep.com/patent/US20170371669A1

## CPC

- G06F 9/3806: {using address prediction, e.g. return stack, branch history buffer}
- G06F 9/323: {for indirect branch instructions}
- G06F 9/3844: {using dynamic branch prediction, e.g. using branch history tables}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for predicting a fetch address of a next instruction to be fetched includes selecting, at a processor, a first way identifier or a second way identifier as a way pointer based on an active fetch address and historical prediction data. A first predictor table includes a first entry having the first way identifier and a second predictor table includes a second entry having the second way identifier. The method also includes selecting a first or second fetch address as a predicted fetch address based on the way pointer. A target table includes a first way storing the first fetch address and a second way storing the second fetch address. The first way and the second way are associated with the active fetch address. The first fetch address is associated with the first way identifier and the second fetch address is associated with the second way identifier.

## Claims

### Claim 1

An apparatus for predicting a fetch address of a next instruction to be fetched, the apparatus comprising:
a memory system storing:
a plurality of predictor tables including a first predictor table and a second predictor table, the first predictor table including a first entry having a first way identifier and the second predictor table including a second entry having a second way identifier; and
a target table comprising:
a first way storing a first fetch address associated with the first way identifier; and
a second way storing a second fetch address associated with the second way identifier, the first way and the second way associated with an active fetch address;
first selection logic coupled to select the first way identifier or the second way identifier as a way pointer based on the active fetch address and historical prediction data; and
second selection logic configured to select the first fetch address or the second fetch address as a predicted fetch address based on the way pointer.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the first selection logic comprises a first multiplexer, and wherein the second selection logic comprises a second multiplexer.

### Claim 3 (depends on 1)

The apparatus of claim 1, wherein the memory system further comprises a global history table storing the historical prediction data.

### Claim 4 (depends on 3)

The apparatus of claim 3, wherein the historical prediction data comprises one or more fetch addresses for one or more previous indirect branches.

### Claim 5 (depends on 4)

The apparatus of claim 4, wherein the global history table stores at least a portion of bits of each fetch address of the one or more fetch addresses or a hashed version of the portion of bits.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the first entry is generated based on a first amount of the historical prediction data, and wherein the second entry is generated based on a second amount of the historical prediction data that is greater than the first amount of the historical prediction data.

### Claim 7 (depends on 6)

The apparatus of claim 6, wherein the first selection logic selects the second way identifier as the way pointer if the second entry matches the active fetch address.

### Claim 8 (depends on 6)

The apparatus of claim 6, wherein the first selection logic selects the first way identifier as the way pointer if the second entry fails to match the active fetch address and the first entry matches the active fetch address.

### Claim 9 (depends on 1)

The apparatus of claim 1, wherein the first predictor table includes a first number of entries, and wherein the second predictor table includes a second number of entries that is different than the first number of entries.

### Claim 10 (depends on 1)

The apparatus of claim 1, wherein each way in the target table corresponds to a way identifier in the plurality of predictor tables.

### Claim 11

A method for predicting a fetch address of a next instruction to be fetched, the method comprising:
selecting, at a processor, a first way identifier or a second way identifier as a way pointer based on an active fetch address and historical prediction data, wherein a first predictor table includes a first entry having the first way identifier and a second predictor table includes a second entry having the second way identifier; and
selecting a first fetch address or a second fetch address as a predicted fetch address based on the way pointer, wherein a target table includes a first way storing the first fetch address and a second way storing the second fetch address, the first way and the second way associated with the active fetch address;
wherein the first fetch address is associated with the first way identifier and the second fetch address is associated with the second way identifier.

### Claim 12 (depends on 11)

The method of claim 11, wherein a first multiplexer of the processor selects the first way identifier or the second way identifier, and wherein a second multiplexer of the processor selects the first fetch address or the second fetch address.

### Claim 13 (depends on 11)

The method of claim 11, further comprising storing the historical prediction data at a global history table accessible to the processor.

### Claim 14 (depends on 13)

The method of claim 13, wherein the historical prediction data comprises one or more fetch addresses for one or more previous indirect branches.

### Claim 15 (depends on 14)

The method of claim 14, further comprising storing most significant bits of each fetch address of the one or more fetch addresses at the global history table.

### Claim 16 (depends on 11)

The method of claim 11, further comprising:
generating the first entry based on a first amount of the historical prediction data; and
generating the second entry based on a second amount of the historical prediction data that is greater than the first amount of the historical prediction data.

### Claim 17 (depends on 16)

The method of claim 16, further comprising selecting the second way identifier as the way pointer if the second entry matches the active fetch address.

### Claim 18 (depends on 16)

The method of claim 16, further comprising selecting the first way identifier as the way pointer if the second entry fails to match the active fetch address and the first entry matches the active fetch address.

### Claim 19 (depends on 11)

The method of claim 11, wherein the first predictor table includes a first number of entries, and wherein the second predictor table includes a second number of entries that is different than the first number of entries.

### Claim 20 (depends on 11)

The method of claim 11, wherein each way in the target table corresponds to a way identifier in the plurality of predictor tables.

### Claim 21

A non-transitory computer-readable medium comprising commands for predicting a fetch address of a next instruction to be fetched, the commands, when executed by a processor, cause the processor to perform operations comprising:
selecting a first way identifier or a second way identifier as a way pointer based on an active fetch address and historical prediction data, wherein a first predictor table includes a first entry having the first way identifier and a second predictor table includes a second entry having the second way identifier; and
selecting a first fetch address or a second fetch address as a predicted fetch address based on the way pointer, wherein a target table includes a first way storing the first fetch address and a second way storing the second fetch address, the first way and the second way associated with the active fetch address;
wherein the first fetch address is associated with the first way identifier and the second fetch address is associated with the second way identifier.

### Claim 22 (depends on 21)

The non-transitory computer-readable medium of claim 21, wherein the operations further comprise storing the historical prediction data at a global history table accessible to the processor.

### Claim 23 (depends on 22)

The non-transitory computer-readable medium of claim 22, wherein the historical prediction data comprises one or more fetch addresses for one or more previous indirect branches.

### Claim 24 (depends on 23)

The non-transitory computer-readable medium of claim 23, wherein the operations further comprise storing most significant bits of each fetch address of the one or more fetch addresses at the global history table.

### Claim 25 (depends on 21)

The non-transitory computer-readable medium of claim 21, wherein the operations further comprise:
generating the first entry based on a first amount of the historical prediction data; and
generating the second entry based on a second amount of the historical prediction data that is greater than the first amount of the historical prediction data.

### Claim 26 (depends on 25)

The non-transitory computer-readable medium of claim 25, wherein the operations further comprise selecting the second way identifier as the way pointer if the second entry matches the active fetch address.

### Claim 27 (depends on 25)

The non-transitory computer-readable medium of claim 25, wherein the operations further comprise selecting the first way identifier as the way pointer if the second entry fails to match the active fetch address and the first entry matches the active fetch address.

### Claim 28

An apparatus for predicting a fetch address of a next instruction to be fetched, the apparatus comprising:
means for storing data comprising:
a plurality of predictor tables including a first predictor table and a second predictor table, the first predictor table including a first entry having a first way identifier and the second predictor table including a second entry having a second way identifier; and
a target table comprising:
a first way storing a first fetch address associated with the first way identifier; and
a second way storing a second fetch address associated with the second way identifier, the first way and the second way associated with an active fetch address;
means for selecting the first way identifier or the second way identifier as a way pointer based on the active fetch address and historical prediction data; and
means for selecting the first fetch address or the second fetch address as a predicted fetch address based on the way pointer.

### Claim 29 (depends on 28)

The apparatus of claim 28, further comprising means for storing the historical prediction data.

### Claim 30 (depends on 28)

The apparatus of claim 28, wherein the means for selecting the first way identifier or the second way identifier comprises a first multiplexer, and wherein the means for selecting the first fetch address or the second fetch address comprises a second multiplexer.
