# US 2012/0239911 A1 · Value check instruction for processing vectors

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

- Number: US 2012/0239911 A1
- Document ID: US20120239911A1
- Status: Published application
- Kind: A1
- Application number: 13/484,709
- Filed: 2012-05-31
- Published: 2012-09-20
- Earliest claimed: 2008-08-15
- Assignees: Apple Inc.
- Inventors: Jeffry E. Gonion
- Web page: https://patentgrep.com/patent/US20120239911A1

## CPC

- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 8/41: Compilation
- G06F 8/456: {Parallelism detection}
- G06F 9/30021: {Compare instructions, e.g. Greater-Than, Equal-To, MINMAX}
- 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/30072: {to perform conditional operations, e.g. using predicates or guards}
- G06F 9/3838: {Dependency mechanisms, e.g. register scoreboarding}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The described embodiments include a processor that executes a ValueCheck instruction. In the described embodiments, the processor receives an input vector and a predicate vector, each including N elements. The processor then executes a ValueCheck instruction, which causes the processor to generate a result vector. When generating the result vector, for each element in a set of elements in the input vector for which a corresponding element of the predicate vector is active, the processor determines if at least one of the elements in the set of elements precedes the element in the input vector and contains a different value than the element in the input vector. If so, the processor writes an identifier for a closest preceding active element that contains the different value into a corresponding element of a result vector. Otherwise, the processor writes a zero in the corresponding element of the result vector.

## Claims

### Claim 1

A method for generating a result vector, comprising:
receiving an input vector and a predicate vector, each including N elements; and
generating the result vector, wherein generating the result vector comprises, for each element in a set of elements in the input vector for which a corresponding element of the predicate vector is active,
determining if at least one of the elements in the set of elements precedes the element in the input vector and contains a different value than the element in the input vector; and
if so, writing an identifier for a closest preceding active element that contains the different value into a corresponding element of a result vector; and
if not, writing a zero in the corresponding element of the result vector.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining if at least one of the elements in the set of elements precedes the element in the input vector and contains a different value than the element in the input vector comprises making the determination for only a closest preceding element from the set of elements.

### Claim 3 (depends on 1)

The method of claim 1, wherein the elements of the input vector contain pointers to locations in memory, and when an element that precedes the element in the input vector contains a different value than the element in the input vector, the corresponding pointers indicate different locations in memory.

### Claim 4 (depends on 3)

The method of claim 3, wherein each location in the memory is a location where program code for a corresponding function begins.

### Claim 5 (depends on 1)

The method of claim 1, wherein the identifier comprises a numeric value representative of the closest preceding element that contains the different value.

### Claim 6 (depends on 1)

The method of claim 1, wherein the method further comprises:
for each element of the result vector for which a corresponding element of the predicate vector is not active, setting the element in the result vector equal to zero.

### Claim 7 (depends on 1)

The method of claim 1, wherein an element of the predicate vector is active when the element contains a predetermined value.

### Claim 8

A processor that generates a result vector, comprising:
the processor;
wherein the processor is configured to:
receive an input vector and a predicate vector, each including N elements; and
generate the result vector, wherein generating the result vector comprises, for each element in a set of elements in the input vector for which a corresponding element of the predicate vector is active,
determining if at least one of the elements in the set of elements precedes the element in the input vector and contains a different value than the element in the input vector; and
if so, writing an identifier for a closest preceding active element that contains the different value into a corresponding element of a result vector; and
if not, writing a zero in the corresponding element of the result vector.

### Claim 9 (depends on 8)

The processor of claim 8, wherein, when determining if at least one of the elements in the set of elements precedes the element in the input vector and contains a different value than the element in the input vector, the processor is configured to make the determination for only a closest preceding element from the set of elements.

### Claim 10 (depends on 8)

The processor of claim 8, wherein the elements of the input vector contain pointers to locations in memory, and when an element that precedes the element in the input vector contains a different value than the element in the input vector, the corresponding pointers indicate different locations in memory.

### Claim 11 (depends on 10)

The processor of claim 10, wherein each location in the memory is a location where program code for a corresponding function begins.

### Claim 12 (depends on 8)

The processor of claim 8, wherein the identifier comprises a numeric value representative of the closest preceding element that contains the different value.

### Claim 13 (depends on 8)

The processor of claim 8, wherein, for each element of the result vector for which a corresponding element of the predicate vector is not active, the processor is configured to set the element in the result vector equal to zero.

### Claim 14 (depends on 8)

The processor of claim 8, wherein an element of the predicate vector is active when the element contains a predetermined value.

### Claim 15

A computer system that generates a result vector, comprising:
the processor;
a memory coupled to the processor, wherein the memory stores instructions and data for the processor;
wherein the processor is configured to:
receive an input vector and a predicate vector, each including N elements; and
generate the result vector, wherein generating the result vector comprises, for each element in a set of elements in the input vector for which a corresponding element of the predicate vector is active,
determining if at least one of the elements in the set of elements precedes the element in the input vector and contains a different value than the element in the input vector; and
if so, writing an identifier for a closest preceding active element that contains the different value into a corresponding element of a result vector; and
if not, writing a zero in the corresponding element of the result vector.

### Claim 16 (depends on 15)

The computer system of claim 15, wherein, when determining if at least one of the elements in the set of elements precedes the element in the input vector and contains a different value than the element in the input vector, the processor is configured to make the determination for only a closest preceding element from the set of elements.

### Claim 17 (depends on 15)

The computer system of claim 15, wherein the elements of the input vector contain pointers to locations in memory, and when an element that precedes the element in the input vector contains a different value than the element in the input vector, the corresponding pointers indicate different locations in memory.

### Claim 18 (depends on 17)

The computer system of claim 17, wherein each location in the memory is a location where program code for a corresponding function begins.

### Claim 19 (depends on 15)

The computer system of claim 15, wherein the identifier comprises a numeric value representative of the closest preceding element that contains the different value.

### Claim 20 (depends on 15)

The computer system of claim 15, wherein, for each element of the result vector for which a corresponding element of the predicate vector is not active, the processor is configured to set the element in the result vector equal to zero.

### Claim 21 (depends on 15)

The computer system of claim 15, wherein an element of the predicate vector is active when the element contains a predetermined value.
