# US 2012/0254592 A1 · Systems, apparatuses, and methods for expanding a memory source into a destination register and compressing a source register into a destination memory location

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

- Number: US 2012/0254592 A1
- Document ID: US20120254592A1
- Status: Published application
- Kind: A1
- Application number: 13/078,896
- Filed: 2011-04-01
- Published: 2012-10-04
- Earliest claimed: 2011-04-01
- Inventors: Jesus Corbal San Adrian; Roger Espasa Sans; Robert C. Valentine; Santiago Galan Duran; Jeffrey G. Wiedemeier; Sridhar Samudrala; Milind Baburao Girkar; Andrew Thomas Forsyth; Victor W. Lee
- Web page: https://patentgrep.com/patent/US20120254592A1

## CPC

- G06F 9/30018: {Bit or string instructions}
- 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/30043: {LOAD or STORE instructions; Clear instruction}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of systems, apparatuses, and methods for performing an expand and/or compress instruction in a computer processor are described. In some embodiments, the execution of an expand instruction causes the selection of elements from a source that are to be sparsely stored in a destination based on values of the writemask and store each selected data element of the source as a sparse data element into a destination location, wherein the destination locations correspond to each writemask bit position that indicates that the corresponding data element of the source is to be stored.

## Claims

### Claim 1

A method of performing a compress instruction in a computer processor, comprising:
fetching the compress instruction, wherein the compress instruction includes a destination operand, a source operand, and a writemask operand;
decoding the fetched compress instruction;
executing the decoded compress instruction to select which data elements from the source are to be stored in the destination based on values of the writemask; and
storing the selected data elements of the source as sequentially packed data elements into the destination.

### Claim 2 (depends on 1)

The method of claim 1, wherein the destination operand is memory and the source operand is a register.

### Claim 3 (depends on 1)

The method of claim 1, wherein the source and destination operand are registers.

### Claim 4 (depends on 1)

The method of claim 1, wherein the executing further comprises:
determining that a first bit position value of the writemask indicates that the corresponding first source data element should be stored into a location of the destination; and
storing the corresponding first source data element into the location of the destination.

### Claim 5 (depends on 1)

The method of claim 1, wherein the executing further comprises:
determining that a first bit position value of the writemask indicates that the corresponding first source data element should not be stored into a location of the destination; and
evaluating a second bit position value of the writemask without storing the first source data element into a location of the destination.

### Claim 6 (depends on 1)

The method of claim 1, wherein each source data element to be stored into the destination is first placed into a stream and the stream is stored into the destination.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
downconverting the data elements to be stored into the destination prior to storing them into the destination.

### Claim 8 (depends on 7)

The method of claim 7, wherein the data elements are downconverted from 32-bit values to 16-bit values.

### Claim 9

A method of performing an expand instruction in a computer processor, comprising:
fetching the expand instruction, wherein the expand instruction includes a destination operand, a source operand, and a writemask operand;
decoding the expand compress instruction;
executing the expand compress instruction to select which elements from the source are to be sparsely stored in the destination based on values of the writemask; and
storing each selected data element of the source as a sparse data element into a destination location, wherein the destination locations correspond to each writemask bit position that indicates that the corresponding data element of the source is to be stored.

### Claim 10 (depends on 9)

The method of claim 9, wherein the destination operand is a register and the source operand is memory.

### Claim 11 (depends on 9)

The method of claim 9, wherein the source and destination operand are registers.

### Claim 12 (depends on 9)

The method of claim 9, wherein the executing further comprises:
determining that a first bit position value of the writemask indicates that the corresponding first source data element should be stored into a corresponding location of the destination; and
storing the corresponding first source data element into the corresponding location of the destination.

### Claim 13 (depends on 9)

The method of claim 9, wherein the executing further comprises:
determining that a first bit position value of the writemask indicates that the corresponding first source data element should not be stored into a corresponding location of the destination; and
evaluating a second bit position value of the writemask without storing the first source data element into a corresponding location of the destination.

### Claim 14 (depends on 1)

The method of claim 1, wherein each source data element to be stored into the destination is first placed into a stream and the stream is stored into the destination.

### Claim 15 (depends on 1)

The method of claim 1, further comprising:
upconverting the data elements to be stored into the destination prior to storing them into the destination.

### Claim 16 (depends on 7)

The method of claim 7, wherein the data elements are upconverted from 16-bit values to 32-bit values.

### Claim 17

An apparatus comprising;
a hardware decoder to decode an expand instruction and/or a compress instruction, wherein the expand instruction includes a first writemask operand, a first destination operand, a first source operand and the compress instruction includes a second writemask operand, a second destination operand, a second source operand; and
execution logic to
execute a decoded expand instruction to select which elements from the source are to be sparsely stored in the destination based on values of the writemask and store each selected data element of the source as a sparse data element into a destination location, wherein the destination locations correspond to each writemask bit position that indicates that the corresponding data element of the source is to be stored, and
execute a decoded compress instruction to select which data elements from the source are to be stored in the destination based on values of the writemask and store the selected data elements of the source as sequentially packed data elements into the destination.

### Claim 18 (depends on 17)

The apparatus of claim 17, further comprising:
a 16-bit writemask register to store the first or second writemask; and
a first 512-bit register to store the selected data elements.

### Claim 19 (depends on 18)

The apparatus of claim 18, further comprising:
a second 512-bit register to act as a source for the expand and compress instructions.

### Claim 20 (depends on 17)

The apparatus of claim 17, wherein the data elements are upconverted from 16-bit values to 32-bit values during the execution of an expand instruction.
