# US 12,008,369 B1 · Load instruction fusion

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

- Number: US 12,008,369 B1
- Document ID: US12008369B1
- Status: Granted
- Kind: B1
- Application number: 17/652,501
- Filed: 2022-02-25
- Granted: 2024-06-11
- Earliest claimed: 2021-08-31
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: John D. Pape; Skanda K. Srinivasa; Francesco Spadini; Brian T. Mokrzycki
- Web page: https://patentgrep.com/patent/US12008369B1

## CPC

- G06F 9/30043: {LOAD or STORE instructions; Clear instruction}
- G06F 9/3001: {Arithmetic instructions}
- G06F 9/30058: {Conditional branch instructions}
- G06F 9/3016: {Decoding the operand specifier, e.g. specifier format}
- G06F 9/30185: {according to one or more bits in the instruction, e.g. prefix, sub-opcode}
- G06F 9/3838: {Dependency mechanisms, e.g. register scoreboarding}
- G06F 9/3858: {Result writeback, i.e. updating the architectural state or memory}
- 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

Techniques are disclosed that relate to executing fused instructions. A processor may include a decoder circuit and a load/store circuit. The decoder circuit may detect a load/store instruction to load a value from a memory and detect a non-load/store instruction that depends on the value to be loaded. The decoder circuit may fuse the load/store instruction and the non-load/store instruction such that one or more operations that the non-load/store instruction is defined to perform are to be executed within the load/store circuit. The load/store circuit may receive an indication of the fused load/store and non-load/store instructions and then execute one or more operations of the load/store instruction and the one or more operations of the non-load/store instruction using a circuit included in the load/store circuit.

## Claims

### Claim 1

A hardware processor, comprising:
a load/store circuit;
a branch execution circuit coupled to the load/store circuit; and
a decoder circuit coupled to the load/store circuit and configured to:
detect a first instruction to load a first value from a memory;
detect a conditional branch instruction that depends on the first value to be loaded by the first instruction; and
fuse the first instruction and the conditional branch instruction such that one or more operations that the conditional branch instruction is defined to perform are to be executed within the load/store circuit;
wherein the load/store circuit is configured to:
receive a first indication of the fused first instruction and conditional branch instruction; and
load the first value from the memory;
detect whether the first value satisfies a condition of the conditional branch instruction; and
provide a second indication to the branch execution circuit on whether the condition has been satisfied; and
wherein the branch execution circuit is configured to:
access information about the conditional branch instruction;
determine the condition of the conditional branch instruction; and
provide a third indication of the condition to the load/store circuit to enable the load/store circuit to detect whether the first value satisfies the condition.

### Claim 2 (depends on 1)

The hardware processor of claim 1, further comprising:
a fusion table circuit that is coupled to the decoder circuit, wherein the decoder circuit is configured to:
store, in an entry in the fusion table circuit, information that describes the fused first instruction and conditional branch instruction; and
provide, to the load/store circuit, the first indication of the fused first instruction and conditional branch instruction, wherein the first indication includes an index value that identifies the entry in the fusion table circuit.

### Claim 3 (depends on 2)

The hardware processor of claim 2 wherein the load/store circuit is configured to provide the index value to the branch execution circuit, and wherein the branch execution circuit is configured to:
use the index value to access the information from the fusion table circuit;
based on the information:
generate a target address for the conditional branch instruction; and
identify a type of the conditional branch instruction, wherein the third indication indicates the type of the conditional branch instruction.

### Claim 4 (depends on 1)

The hardware processor of claim 1, wherein the decoder circuit is configured to detect a second instruction to load a second value from the memory and an arithmetic instruction, wherein the load/store circuit includes an arithmetic logic circuit, and wherein the load/store circuit is configured to:
load the second value from the memory/store instruction; and
execute, at the arithmetic logic circuit, one or more operations of the arithmetic instruction on the second value.

### Claim 5 (depends on 4)

The hardware processor of claim 4, wherein the second instruction identifies a first destination and the arithmetic instruction identifies a second destination, wherein the load/store circuit is configured to:
forward the second value to the first destination and a result of the arithmetic instruction to the second destination.

### Claim 6 (depends on 4)

The hardware processor of claim 4, wherein the second instruction and the arithmetic instruction identify a same destination, wherein the load/store circuit is configured to:
forward, to the same destination, a result of the arithmetic instruction but not the second value.

### Claim 7 (depends on 1)

The hardware processor of claim 1, further comprising:
a fusion table circuit that is coupled to the decoder circuit, wherein the decoder circuit is configured to:
detect two instructions that are fusible; and
prevent fusion of the two instructions based on a detection that the fusion table circuit includes less than a threshold number of available entries.

### Claim 8 (depends on 1)

The hardware processor of claim 1, wherein the load/store circuit is configured to:
based on a detection that the fused first instruction and conditional branch instruction cannot be completed in a fused state, cause the first instruction and the conditional branch instruction to be executed as separate instructions.

### Claim 9

A method, comprising:
detecting, by a processor of a computer system, a first instruction to load a value of a memory of the computer system;
detecting, by the processor, a conditional branch instruction that depends on the value to be loaded by the first instruction;
fusing, by the processor, the first instruction with the conditional branch instruction such that at least a comparison operation that is defined by the conditional branch instruction is to be executed in a load/store circuit of the processor;
loading, by the load/store circuit, the value from the memory;
providing, by the load/store circuit to a branch execution circuit of the processor, a pointer to an entry in a table circuit, wherein the entry stores information about the conditional branch instruction;
receiving, by the load/store circuit from the branch execution circuit, an indication of a type of the conditional branch instruction;
executing, by the load/store circuit, the comparison operation on the loaded value, wherein the indication enables the load/store circuit to execute the comparison operation; and
providing, by the processor, a result of the comparison operation to the branch execution circuit.

### Claim 10 (depends on 9)

The method of claim 9, further comprising:
constructing, by the load/store circuit, a mask based on the indication received from the branch execution circuit, wherein the mask indicates one or more portions of the loaded value on which to perform the comparison operation.

### Claim 11 (depends on 9)

The method of claim 9, further comprising:
in response to determining that the comparison operation is to be performed within the load/store circuit, the load/store circuit communicating with the branch execution circuit to cause the branch execution circuit to not perform the comparison operation.

### Claim 12 (depends on 9)

The method of claim 9, further comprising:
detecting, by the processor, a second instruction and an arithmetic instruction that depends on the second instruction;
fusing, by the processor, the second instruction and the arithmetic instruction such that one or more operations that the arithmetic instruction is defined to perform are to be executed in the load/store circuit; and
executing, by the load/store circuit of the processor, the one or more operations on a value associated with the second instruction.

### Claim 13 (depends on 12)

The method of claim 12, wherein the second instruction identifies a first destination and the arithmetic instruction identifies a second destination, and wherein the method further comprises:
forwarding, by the load/store circuit, the value associated with the second instruction to the first destination and a result of the arithmetic instruction to the second destination.

### Claim 14

A system, comprising:
a memory; and
a hardware processor that is coupled to the memory, includes a fusion table circuit, and is configured to:
detect a first instruction to load a value of the memory;
detect a non-load/non-store instruction that depends on the value to be loaded by the first instruction;
fuse the first instruction and the non-load/non-store instruction such that one or more operations that the non-load/non-store instruction is defined to perform are to be executed in a load/store circuit of the hardware processor;
store, in an entry in the fusion table circuit, information that describes the fused first instruction and the non-load/non-store instruction;
provide, to the load/store circuit, an indication of the fused first instruction and the non-load/non-store instruction, wherein the indication includes an index value that identifies the entry in the fusion table circuit;
load, in the load/store circuit, the value from the memory; and
execute, in the load/store circuit, the one or more operations on the value.

### Claim 15 (depends on 14)

The system of claim 14, wherein different destinations are identified by the non-load/non-store instruction and the first instruction, and wherein the hardware processor is configured to:
forward, within a same clock cycle, the loaded value and a result of the one or more operations to the different destinations.

### Claim 16 (depends on 14)

The system of claim 14, wherein a same destination is identified by the non-load/non-store instruction and the first instruction, and wherein the hardware processor is configured to forward, to the same destination, a result of the one or more operations but not the loaded value.

### Claim 17 (depends on 14)

The system of claim 14, wherein the load/store circuit includes an arithmetic logic circuit that is configured to execute the one or more operations, and wherein the non-load/non-store instruction is a shift instruction.

### Claim 18 (depends on 14)

The system of claim 14, wherein the hardware processor is configured to:
detect a second instruction and a conditional branch instruction that depends on the second instruction;
fuse the second instruction and the conditional branch instruction such that at least a comparison operation defined by the conditional branch instruction is to be executed in the load/store circuit;
execute, in the load/store circuit, the comparison operation to generate a result; and
provide the result to a branch execution circuit of the hardware processor.

### Claim 19 (depends on 18)

The system of claim 18, wherein the branch execution circuit is configured to:
receive, from the load/store circuit, a pointer to a different entry in the fusion table circuit, wherein the different entry stores information about the conditional branch instruction; and
provide, to the load/store circuit, an indication of a type of the conditional branch instruction.

### Claim 20 (depends on 18)

The system of claim 18, wherein the non-load/non-store instruction is an arithmetic instruction.
