# US 10,956,166 B2 · Instruction ordering

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

- Number: US 10,956,166 B2
- Document ID: US10956166B2
- Status: Granted
- Kind: B2
- Application number: 16/296,507
- Filed: 2019-03-08
- Published: 2020-09-10
- Granted: 2021-03-23
- Earliest claimed: 2019-03-08
- Assignees: Arm Limited; The Regents of the University of Michigan
- Applicants: Arm Limited; The Regents of The University of Michigan
- Inventors: Vaibhav Gogte; Wei Wang; Stephan Diestelhorst; Peter M Chen; Satish Narayanasamy; Thomas Friedrich Wenisch
- Web page: https://patentgrep.com/patent/US10956166B2

## CPC

- G06F 9/30087: {Synchronisation or serialisation instructions}
- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F 9/3834: {Maintaining memory consistency}
- G06F 9/3838: {Dependency mechanisms, e.g. register scoreboarding}
- G06F 9/3856: {Reordering of instructions, e.g. using queues or age tags}
- G06F 9/522: {Barrier synchronisation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data processing apparatus includes obtain circuitry that obtains a stream of instructions. The stream of instructions includes a barrier creation instruction and a barrier inhibition instruction. Track circuitry orders sending each instruction in the stream of instructions to processing circuitry based on one or more dependencies. The track circuitry is responsive to the barrier creation instruction to cause the one or more dependencies to include one or more barrier dependencies in which pre-barrier instructions, occurring before the barrier creation instruction in the stream, are sent before post-barrier instructions, occurring after the barrier creation instruction in the stream, are sent. The track circuitry is also responsive to the barrier inhibition instruction to relax the barrier dependencies to permit post-inhibition instructions, occurring after the barrier inhibition instruction in the stream, to be sent before the pre-barrier instructions.

## Claims

### Claim 1

A data processing apparatus comprising:
obtain circuitry to obtain a stream of instructions, the stream of instructions comprising a barrier creation instruction and a barrier inhibition instruction; and
track circuitry to order sending each instruction in the stream of instructions to processing circuitry based on one or more dependencies, wherein
the track circuitry is responsive to the barrier creation instruction to cause the one or more dependencies to include one or more barrier dependencies in which pre-barrier instructions, occurring before the barrier creation instruction in the stream, are sent before post-barrier instructions, occurring after the barrier creation instruction in the stream, are sent; and
the track circuitry is responsive to the barrier inhibition instruction to relax the barrier dependencies to permit post-inhibition instructions, occurring after the barrier inhibition instruction in the stream, to be sent before the pre-barrier instructions.

### Claim 2 (depends on 1)

The data processing apparatus according to claim 1, wherein
the pre-barrier instructions, the post-barrier instructions, and the post-inhibition instructions comprise memory access instructions.

### Claim 3 (depends on 2)

The data processing apparatus according to claim 2, wherein
the memory access instructions are made to a persistent memory.

### Claim 4 (depends on 1)

The data processing apparatus according to claim 1, wherein
the one or more dependencies comprise one or more data dependencies between the instructions.

### Claim 5 (depends on 1)

The data processing apparatus according to claim 1, wherein
the track circuitry comprises queue circuitry comprising one or more entries, each of the entries corresponding to one of the instructions; and
the track circuitry comprises storage circuitry to store a dependency matrix to represent the one or more dependencies.

### Claim 6 (depends on 5)

The data processing apparatus according to claim 5, wherein
the track circuitry is adapted, in response to receiving a new instruction, to search the queue circuitry for an earlier barrier creation instruction and an earlier barrier inhibition instruction;
when the earlier barrier creation instruction is found and the earlier barrier inhibition instruction is unfound, the barrier dependencies are added to inhibit the new instruction from being sent until the pre-barrier instructions are sent; and
when the earlier barrier creation instruction is found and the earlier barrier inhibition instruction is found, the track circuitry inhibits adding the barrier dependencies.

### Claim 7 (depends on 1)

The data processing apparatus according to claim 1, wherein
the track circuitry is a load store queue.

### Claim 8 (depends on 1)

The data processing apparatus according to claim 1, comprising:
transaction circuitry to store a transaction of at least some of the instructions; and
rollback circuitry to restore a previous state of the processing circuitry corresponding to before execution of the instructions, based on the transaction.

### Claim 9 (depends on 7)

The data processing apparatus according to claim 7, wherein
the track circuitry is adapted to send at least some of the instructions between the barrier creation instruction and the barrier inhibition instruction to the processing circuitry out of order.

### Claim 10 (depends on 7)

The data processing apparatus according to claim 7, wherein
the processing circuitry comprises a plurality of processing circuits; and
the track circuitry is adapted to send at least some of the instructions between the barrier creation instruction and the barrier inhibition instruction to different ones of the processing circuits.

### Claim 11 (depends on 1)

The data processing apparatus according to claim 1, wherein
the one or more barrier dependencies are dependencies of instructions of a predetermined type.

### Claim 12 (depends on 11)

The data processing apparatus according to claim 11, wherein
the predetermined type comprises memory access instructions made to a persistent memory.

### Claim 13 (depends on 1)

The data processing apparatus according to claim 1, wherein
the data processing apparatus is adapted to perform speculative execution of at least some of the instructions in the stream of instructions; and
the track circuitry is adapted to send an instruction that is to be speculatively executed to the processing circuitry, regardless of the one or more barrier dependencies of the instruction that is to be speculatively executed.

### Claim 14

A data processing method, comprising:
obtaining a stream of instructions, the stream of instructions comprising a barrier creation instruction and a barrier inhibition instruction; and
sending each instruction in the stream of instructions to processing circuitry in order based on one or more dependencies, wherein
in response to the barrier creation instruction, the one or more dependencies are amended to include one or more barrier dependencies in which pre-barrier instructions, occurring before the barrier creation instruction in the stream, are sent before post-barrier instructions, occurring after the barrier creation instruction in the stream, are sent; and
in response to the barrier inhibition instruction, the barrier dependencies are relaxed to permit post-inhibition instructions, occurring after the barrier inhibition instruction in the stream, to be sent before the pre-barrier instructions.

### Claim 15

A computer program product stored on a non-transitory, computer-readable medium for controlling a host data processing apparatus to provide an instruction execution environment for execution of instructions, the computer program product comprising:
obtaining logic to obtain a stream of instructions, the stream of instructions comprising a barrier creation instruction and a barrier inhibition instruction; and
sending logic to send each instruction in the stream of instructions to processing circuitry in order based on one or more dependencies, wherein
in response to the barrier creation instruction, the one or more dependencies are amended to include one or more barrier dependencies in which pre-barrier instructions, occurring before the barrier creation instruction in the stream, are sent before post-barrier instructions, occurring after the barrier creation instruction in the stream, are sent; and
in response to the barrier inhibition instruction, to relax the barrier dependencies are relaxed to permit post-inhibition instructions, occurring after the barrier inhibition instruction in the stream, to be sent before the pre-barrier instructions.

### Claim 16

A data processing apparatus comprising:
input circuitry to receive a plurality of input instructions comprising an atomic region;
output circuitry to provide output instructions corresponding to the input instructions; and
transformation circuitry to transform the input instructions into the output instructions, wherein
the atomic region defines a subset of the input instructions in which, during execution, if one of the instructions in the subset fails to execute, then the subset of the input instructions are rewound; and
the transformation circuitry generates, for an atomic instruction in the atomic region:
a log instruction to log a state change caused by the atomic instruction,
a barrier creation instruction,
a corresponding instruction that corresponds with the atomic instruction, and
a barrier inhibition instruction.

### Claim 17 (depends on 16)

The data processing apparatus according to claim 16, wherein
the atomic instruction changes a previous state of a part of the data processing apparatus to a new state; and
the log instruction is an undo log instruction that stores the previous state of the part of the data processing apparatus.

### Claim 18 (depends on 17)

The data processing apparatus according to claim 17, wherein
the atomic instruction is a memory access instruction.

### Claim 19 (depends on 18)

The data processing apparatus according to claim 18, wherein
the memory access instruction is made to a persistent memory.

### Claim 20

A data processing method comprising:
receiving a plurality of input instructions comprising an atomic region;
providing output instructions corresponding to the input instructions; and
transforming the input instructions into the output instructions, wherein
the atomic region defines a subset of the input instructions in which, during execution, if one of the instructions in the subset fails to execute, then the subset of the input instructions are rewound; and
the step of transforming generates, for an atomic instruction in the atomic region:
a log instruction corresponding with the atomic instruction,
a barrier creation instruction,
a corresponding instruction that corresponds with the atomic instruction, and
a barrier inhibition instruction.
