# US 2015/0178087 A1 · Predicated Vector Hazard Check Instruction

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

- Number: US 2015/0178087 A1
- Document ID: US20150178087A1
- Status: Published application
- Kind: A1
- Application number: 14/137,232
- Filed: 2013-12-20
- Published: 2015-06-25
- Earliest claimed: 2013-12-20
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Jeffry E. Gonion
- Web page: https://patentgrep.com/patent/US20150178087A1

## CPC

- G06F 9/3838: {Dependency mechanisms, e.g. register scoreboarding}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/30038: {using a mask}
- G06F 9/30076: {to perform miscellaneous control operations, e.g. NOP}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A hazard check instruction has operands that specify addresses of vector elements to be read by first and second vector memory operations. The hazard check instruction outputs a dependency vector identifying, for each element position of the first vector corresponding to the first vector memory operation, which element position of the second vector that the element of the first vector depends on (if any). In an embodiment, the addresses of the vector memory operations are specified using a base address for each vector memory operation and a vector that is shared by both vector memory operations. In an embodiment, the operands may include predicates for one or both of the vector memory operations, indicating which vector elements are active. The dependency vector may be qualified by the predicates, indicating dependencies only for active elements.

## Claims

### Claim 1

A processor comprising:
an execution core configured to execute an instruction having a plurality of operands including a first base address, a second base address, and a vector, wherein the plurality of operands specify addresses corresponding to a first vector memory operation and a second vector memory operation, wherein the execution unit is configured to detect whether or not a dependency exists between addresses of the first vector memory operation and addresses of the second vector memory operation.

### Claim 2 (depends on 1)

The processor as recited in claim 1 wherein a first plurality of addresses corresponding to the first memory operation are determined responsive to the first base address and elements of the vector, and wherein a second plurality of addresses corresponding to the second memory operation are determined responsive to the second base address and elements of the vector.

### Claim 3 (depends on 2)

The processor as recited in claim 2 wherein the vector comprises offsets to the first base address and the second base address.

### Claim 4 (depends on 3)

The processor as recited in claim 3 wherein the execution core is configured to scale the offsets by a first data size corresponding to the first vector memory operation to determine the first plurality of addresses, and wherein the execution core is configured to scale the offsets by a second data size corresponding to the second vector memory operation to determine the second plurality of addresses.

### Claim 5 (depends on 4)

The processor as recited in claim 4 wherein the execution core is configured to add the scaled offsets to the first base address to generate the first plurality of addresses, and wherein the execution core is configured to add the scaled offsets to the second base address to generate the second plurality of addresses.

### Claim 6 (depends on 1)

The processor as recited in claim 1 wherein the instruction further includes a first predicate corresponding to the second vector memory operation, wherein the execution core is configured to detect dependencies between elements of the first vector memory operation and elements of the second memory operation for which corresponding elements of the first predicate are active.

### Claim 7 (depends on 6)

The processor as recited in claim 6 wherein the instruction further includes a second predicate corresponding to the first vector memory operation, wherein the execution core is configured to detect dependencies between elements of the first memory operation for which corresponding elements of the second predicate are active and elements of the second memory operation for which corresponding elements of the first predicate are active.

### Claim 8 (depends on 7)

The processor as recited in claim 7 wherein the execution core is configured to detect no dependency for a first element of the first memory operation and a second element of the second memory operation responsive to either the first element or the second element being inactive as indicated by the respective second predicate or first predicate.

### Claim 9 (depends on 8)

The processor as recited in claim 8 wherein the execution core is configured to detect a dependency responsive to both the first element and the second element being active as indicated by the respective second predicate and first predicate and further responsive to an overlap in the addresses of the first element and the second element.

### Claim 10 (depends on 1)

The processor as recited in claim 1 wherein the execution core is configured to generate a dependency vector that indicates, for each first element of the first vector memory operation that depends on a second element of the second vector memory operation, the element number of the second memory operation on which the first element depends.

### Claim 11 (depends on 10)

The processor as recited in claim 10 wherein the dependency vector includes an indicator of no dependency for first elements that do not depend on second elements.

### Claim 12 (depends on 11)

The processor as recited in claim 11 wherein the indicator is a value of zero.

### Claim 13

A method comprising:
executing, in a processor, an instruction having a plurality of operands including a first base address, a second base address, and a vector, wherein the plurality of operands specify addresses corresponding to a first vector memory operation and a second vector memory operation; and
during the executing, the processor detecting whether or not a dependency exists between addresses of the first vector memory operation and addresses of the second vector memory operation.

### Claim 14 (depends on 13)

The method as recited in claim 13 wherein a first plurality of addresses corresponding to the first memory operation are determined responsive to the first base address and elements of the vector, and wherein a second plurality of addresses corresponding to the second memory operation are determined responsive to the second base address and elements of the vector.

### Claim 15 (depends on 14)

The method as recited in claim 14 wherein the vector comprises offsets to the first base address and the second base address, and the executing further comprising:
scaling the offsets by a first data size corresponding to the first vector memory operation to determine the first plurality of addresses;
scaling the offsets by a second data size corresponding to the second vector memory operation to determine the second plurality of addresses;
adding the scaled offsets to the first base address to generate the first plurality of addresses; and
adding the scaled offsets to the second base address to generate the second plurality of addresses.

### Claim 16 (depends on 13)

The method as recited in claim 13 wherein the instruction further includes a first predicate corresponding to the second vector memory operation, wherein the detecting comprises detecting dependencies between elements of the first vector memory operation and elements of the second vector memory operation for which corresponding elements of the first predicate are active.

### Claim 17 (depends on 16)

The method as recited in claim 16 wherein the instruction further includes a second predicate corresponding to the first vector memory operation, wherein the detecting comprises detecting dependencies between elements of the first vector memory operation for which corresponding elements of the second predicate are active and elements of the second vector memory operation for which corresponding elements of the second predicate are active.

### Claim 18 (depends on 17)

The method as recited in claim 17 wherein the detecting is responsive to both the first element and the second element being active as indicated by the respective second predicate and first predicate and further responsive to an overlap in the addresses of the first element and the second element.

### Claim 19 (depends on 13)

The method as recited in claim 13 further comprising generating a dependency vector that indicates, for each first element of the first vector memory operation that depends on a second element of the second vector memory operation, the element number of the second memory operation on which the first element depends.

### Claim 20 (depends on 19)

The method as recited in claim 19 wherein the dependency vector includes an indicator of no dependency for first elements that do not depend on second elements.
