# US 10,503,502 B2 · Data element rearrangement, processors, methods, systems, and instructions

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

- Number: US 10,503,502 B2
- Document ID: US10503502B2
- Status: Granted
- Kind: B2
- Application number: 14/865,696
- Filed: 2015-09-25
- Published: 2017-03-30
- Granted: 2019-12-10
- Earliest claimed: 2015-09-25
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Christopher J. Hughes; Jong Soo Park
- Web page: https://patentgrep.com/patent/US10503502B2

## CPC

- G06F 9/30007: {to perform operations on data operands}
- G06F 9/30032: {Movement instructions, e.g. MOVE, SHIFT, ROTATE, SHUFFLE}
- 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/30101: {Special purpose registers}
- G06F 9/3016: {Decoding the operand specifier, e.g. specifier format}
- G06F 9/30192: {according to data descriptor, e.g. dynamic data typing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A processor includes a decode unit to decode an instruction indicating a source packed data operand having source data elements and indicating a destination storage location. Each of the source data elements has a source data element value and a source data element position. An execution unit, in response to the instruction, stores a result packed data operand having result data elements each having a result data element value and a result data element position. Each result data element value is one of: (1) equal to a source data element position of a source data element, closest to one end of the source operand, having a source data element value equal to the result data element position of the result data element; and (2) a replacement value, when no source data element has a source data element value equal to the result data element position of the result data element.

## Claims

### Claim 1

A processor comprising:
a decode unit to decode a data element rearrangement instruction, the instruction to indicate a source packed data operand that is to have a plurality of source data elements that each are to have a plurality of bits and to indicate a destination packed data register, each of the source data elements to have a source data element value and a source data element position relative to a least significant end of the source packed data operand; and
an execution unit coupled with the decode unit, the execution unit, in response to the instruction, to:
determine, for each of a plurality of result data element positions, relative to a least significant end of a result packed data operand, whether any of the source data element values equal the result data element position; and
store the result packed data operand in the destination packed data register, the result packed data operand to have a plurality of result data elements that are each to have a result data element value and a different corresponding one of the result data element positions, wherein the result data element value of each result data element is to be one of:
equal to a source data element position of a source data element, closest to one end of the source packed data operand, that is to have a source data element value equal to the result data element position of the result data element in the destination packed data register; and
a replacement value, when no source data element is to have a source data element value equal to the result data element position of the result data element.

### Claim 2 (depends on 1)

The processor of claim 1, wherein the source packed data operand is to have a plurality of sets of duplicate source data element values, and wherein for each set of duplicate source data element values the result packed data operand is to store a source data element position of only a most significant one of the duplicate source data element values.

### Claim 3 (depends on 1)

The processor of claim 1, wherein the execution unit, in response to the instruction, is to store the result packed data operand in which said one end of the source packed data operand comprises a most significant end of the source packed data operand.

### Claim 4 (depends on 1)

The processor of claim 1, wherein the execution unit, in response to the instruction, is to store the result packed data operand in which said one end of the source packed data operand comprises a least significant end of the source packed data operand.

### Claim 5 (depends on 1)

The processor of claim 1, wherein the execution unit, in response to the instruction, is to store a result mask operand that is to have a plurality of mask elements which are each to correspond to a different one of the result data elements.

### Claim 6 (depends on 5)

The processor of claim 5, wherein the execution unit, in response to the instruction, is to store the result mask operand in which:
each mask element which is to correspond to a result data element value that is to equal a source data element position is to have a first value; and
each mask element which is to correspond to a result data element value that is to be a replacement value is to have a second different value.

### Claim 7 (depends on 5)

The processor of claim 5, wherein each mask element is to comprise only a single bit.

### Claim 8 (depends on 5)

The processor of claim 5, wherein the execution unit, in response to the instruction, is to store the result mask operand in a mask register, and wherein a plurality of other instructions of an instruction set including the data element rearrangement instruction are to specify the mask register for a predicate operand which is to be used to predicate a packed data operation.

### Claim 9 (depends on 1)

The processor of claim 1, wherein the execution unit, in response to the instruction, is to store the result packed data operand which is to have at least one result data element which is to have a result data element value that is to be a replacement value, wherein the replacement value is to be a negative number, and wherein no other result data element values, which are not replacement values, are to be negative numbers.

### Claim 10 (depends on 1)

The processor of claim 1, wherein the execution unit, in response to the instruction, is to store the result packed data operand which is to have at least one result data element which is to have a result data element value that is to be a replacement value, and wherein the replacement value is to comprise a zero value.

### Claim 11 (depends on 1)

The processor of claim 1, wherein the execution unit, in response to the instruction, is to store the result packed data operand which is to have a result data element value that is to be a replacement value, and wherein the replacement value is to comprise a value of a data element stored in a corresponding position in the destination packed data register just prior to execution of the instruction.

### Claim 12 (depends on 1)

The processor of claim 1, wherein the execution unit, in response to the instruction, is to store the result packed data operand which is to have at least four result data elements including at least one result data element that is to have as a result data element value the replacement value.

### Claim 13 (depends on 1)

The processor of claim 1, wherein each of the source data elements comprises an integer index, and wherein each index is represented in a lowest order subset of bits of a least significant byte of each source data element.

### Claim 14 (depends on 1)

The processor of claim 1, wherein the decode unit is also to decode a gather by indices to register instruction, but the decode unit is not able to decode a scatter by indices to register instruction.

### Claim 15 (depends on 1)

The processor of claim 1, wherein the source packed data operand is to have the source data elements arranged in a scatter pattern, and wherein the result packed data operand is to have the result data elements arranged in a gather pattern.

### Claim 16

A method in a processor comprising:
receiving a data element rearrangement instruction, the instruction indicating a source packed data operand having a plurality of source data elements that each have a plurality of bits and indicating a destination packed data register, each of the source data elements having a source data element value and a source data element position relative to a least significant end of the source packed data operand; and
storing a result packed data operand in the destination packed data register in response to the instruction, the result packed data operand having a plurality of result data elements that each have a result data element value and a result data element position relative to a least significant end of the result packed data operand,
wherein the result data element value, of each of at least three of the result data elements, is equal to a source data element position of a source data element, closest to one end of the source packed data operand, that has a source data element value equal to the result data element position of the result data element in the destination packed data register; and
wherein the result data element value, of at least one of the result data elements, is a replacement value, when no source data element has a source data element value equal to the result data element position of the result data element.

### Claim 17 (depends on 16)

The method of claim 16, wherein said storing the result packed data operand comprises storing the result packed data operand in which said one end of the source packed data operand comprises a most significant end of the source packed data operand.

### Claim 18 (depends on 16)

The method of claim 16, further comprising storing a result mask operand in response to the instruction, the result mask operand having a plurality of mask elements which each correspond to a different one of the result data elements.

### Claim 19 (depends on 18)

The method of claim 18, wherein said storing the result mask operand comprises storing-the result mask operand in which:
each mask element that corresponds to a result data element value that is to equal a source data element position has a first value; and
each mask element that corresponds to a result data element value that is a replacement value has a second different value.

### Claim 20 (depends on 16)

The method of claim 16, wherein each of the source data elements comprises an integer index, and wherein each index is represented in a lowest order subset of bits of a least significant byte of each source data element.

### Claim 21 (depends on 16)

The method of claim 16, further comprising performing a gather by indices to register instruction that indicates as a source packed data operand the result packed data operand of the data element rearrangement instruction.

### Claim 22

A computer system comprising:
an interconnect;
a processor coupled with the interconnect, the processor to receive a data element rearrangement instruction, the instruction to indicate a source packed data operand that is to have a plurality of source data elements that each are to have a plurality of bits and to indicate a destination packed data register, each of the source data elements to have a source data element value and a source data element position relative to a least significant end of the source packed data operand, the processor, in response to the instruction, to:
determine, for each of a plurality of result data element positions, relative to a least significant end of a result packed data operand, whether any of the source data element values equal the result data element position; and
store the result packed data operand in the destination packed data register, the result packed data operand to have a plurality of result data elements that are each to have a result data element value and a different corresponding one of the result data element positions, wherein the result data element value of each result data element is to be one of:
equal to a source data element position of a source data element, closest to one end of the source packed data operand, that is to have a source data element value equal to the result data element position of the result data element in the destination packed data register; and
a replacement value, when no source data element is to have a source data element value equal to the result data element position of the result data element; and
a dynamic random access memory (DRAM) coupled with the interconnect, the DRAM storing a set of instructions including a gather by indices to register instruction that is to indicate as a source packed data operand the result packed data operand of the data element rearrangement instruction.

### Claim 23 (depends on 22)

The computer system of claim 22, wherein the processor, in response to the instruction, is to store the result packed data operand in which said one end of the source packed data operand comprises a most significant end of the source packed data operand.

### Claim 24

An article of manufacture comprising a non-transitory machine-readable storage medium, the non-transitory machine-readable storage medium storing a data element rearrangement instruction, the data element rearrangement instruction to indicate a source packed data operand that is to have a plurality of source data elements that each are to have a plurality of bits and to indicate a destination packed data register, each of the source data elements to have a source data element value and a source data element position relative to a least significant end of the source packed data operand, and the data element rearrangement instruction if executed by a machine is to cause the machine to perform operations comprising to:
determine, for each of a plurality of result data element positions, relative to a least significant end of a result packed data operand, whether any of the source data element values equal the result data element position; and
store the result packed data operand in the destination packed data register, the result packed data operand to have a plurality of result data elements that are each to have a result data element value and a different corresponding one of the result data element positions, wherein the result data element value of each result data element is to be one of:
equal to a source data element position of a source data element, closest to one end of the source packed data operand, that is to have a source data element value equal to the result data element position of the result data element in the destination packed data register; and
a replacement value, when no source data element is to have a source data element value equal to the result data element position of the result data element.

### Claim 25 (depends on 24)

The article of manufacture of claim 24, wherein the data element rearrangement instruction if executed by the machine is to cause the machine to perform operations comprising to:
store a mask operand in a mask register, wherein the mask operand is to have a single mask bit for each result data element of the result packed data operand.
