# US 2022/0012057 A1 · Systems, Apparatuses, And Methods For Fused Multiply Add

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

- Number: US 2022/0012057 A1
- Document ID: US20220012057A1
- Status: Published application
- Kind: A1
- Application number: 17/487,628
- Filed: 2021-09-28
- Published: 2022-01-13
- Earliest claimed: 2019-03-29
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Robert Valentine; Galina Ryvchin; Piotr Majcher; Mark J. Charney; Elmoustapha Ould-Ahmed-Vall; Jesus Corbal; Milind B. Girkar; Zeev Sperber; Simon Rubanovich; Amit Gradstein
- Web page: https://patentgrep.com/patent/US20220012057A1

## CPC

- G06F 9/30014: {with variable precision}
- G06F 15/76: Architectures of general purpose stored program computers (with program plugboard G06F15/08; multicomputers G06F15/16)
- G06F 7/5443: {Sum of products (for applications thereof, see the relevant places, e.g. G06F17/10, H03H17/00)}
- G06F 9/30018: {Bit or string instructions}
- 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/30105: {Register structure}
- G06F 9/3818: {Decoding for concurrent execution}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of systems, apparatuses, and methods for fused multiple add. In some embodiments, a decoder decodes a single instruction having an opcode, a destination field representing a destination operand, and fields for a first, second, and third packed data source operand, wherein packed data elements of the first and second packed data source operand are of a first, different size than a second size of packed data elements of the third packed data operand. Execution circuitry then executes the decoded single instruction to perform, for each packed data element position of the destination operand, a multiplication of a M N-sized packed data elements from the first and second packed data sources that correspond to a packed data element position of the third packed data source, add of results from these multiplications to a full-sized packed data element of a packed data element position of the third packed data source, and storage of the addition result in a packed data element position destination corresponding to the packed data element position of the third packed data source, wherein M is equal to the full-sized packed data element divided by N.

## Claims

### Claim 1

An apparatus comprising:
decoder circuitry configured to decode a single instruction having an opcode, a first field to represent a packed data source/destination operand, a second field to represent a first packed data source operand, and a third field to represent a second packed data source operand, wherein packed data elements of the first and second packed data source operands are of a first size and packed data elements of the packed data source/destination operand are of a second size;
a register file having a plurality of packed data registers to store one or more of the packed data source/destination operand, the first packed data source operand, and the second packed data source operand; and
execution circuitry coupled to the decoder and the register file, wherein in response to the decoded single instruction, the execution circuitry, according to the opcode of the single instruction, for each packed data element position of the packed data source/destination operand, is configured to:
sign extend a plurality of packed signed data words from a corresponding packed data element position of the first packed data source operand;
sign extend a plurality of packed signed data words from a corresponding packed data element position of the second packed data source operand;
multiply each of the plurality of sign extended packed signed data words from a corresponding packed data element position of the first packed data source operand with a corresponding one of the plurality of sign extended packed signed data words from a corresponding packed data element position of the second packed data source operand to result in a plurality of results;
add the plurality of results with a packed data element of the second size of a corresponding packed data element position of the packed data source/destination operand to result in an addition result, and saturate the addition result to result in a saturated addition result if a width of the addition result exceeds a width of the second size; and
store the addition result or the saturated addition result in the corresponding packed data element position of the packed data source/destination operand.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the execution circuitry is configured to suppress a memory fault.

### Claim 3 (depends on 1)

The apparatus of claim 1, wherein when the single instruction further includes another field for a write mask, the execution circuitry is configured to perform a merging operation.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the execution circuitry, when a width of the packed data source/destination operand is 128 bits, is configured to perform 4 iterations of the multiply, the add, and the store.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the execution circuitry, when a width of the packed data source/destination operand is 256 bits, is configured to perform 8 iterations of the multiply, the add, and the store.

### Claim 6

A method comprising:
decoding, in a decoder of a processor, a single instruction having an opcode, a first field to represent a packed data source/destination operand, a second field to represent a first packed data source operand, and a third field to represent a second packed data source operand, wherein packed data elements of the first and second packed data source operands are of a first size and packed data elements of the packed data source/destination operand are of a second size; and
executing, in execution circuitry of the processor coupled to the decoder, according to the opcode of the single instruction to, for each packed data element position of the packed data source/destination operand:
sign extend a plurality of packed signed data words from a corresponding packed data element position of the first packed data source operand;
sign extend a plurality of packed signed data words from a corresponding packed data element position of the second packed data source operand;
multiply each of the plurality of sign extended packed signed data words from a corresponding packed data element position of the first packed data source operand with a corresponding one of the plurality of sign extended packed signed data words from a corresponding packed data element position of the second packed data source operand to result in a plurality of results;
add the plurality of results with a packed data element of the second size of a corresponding packed data element position of the packed data source/destination operand to result in an addition result, and saturate the addition result to result in a saturated addition result if a width of the addition result exceeds a width of the second size; and
store the addition result or the saturate addition result in the corresponding packed data element position of the packed data source/destination operand.

### Claim 7 (depends on 6)

The method of claim 6, wherein the executing further comprises suppressing a memory fault.

### Claim 8 (depends on 6)

The method of claim 6, wherein the executing further comprises performing a merging operation when the single instruction further includes another field for a write mask.

### Claim 9 (depends on 6)

The method of claim 6, wherein the executing further comprises, when a width of the packed data source/destination operand is 128 bits, performing 4 iterations of the multiply, the add, and the store.

### Claim 10 (depends on 6)

The method of claim 6, wherein the executing further comprises, when a width of the packed data source/destination operand is 256 bits, performing 8 iterations of the multiply, the add, and the store.

### Claim 11

A non-transitory machine-readable medium comprising an instruction, which when executed by a processor, causes the processor to:
decode, in a decoder of the processor, the instruction having an opcode, a first field to represent a packed data source/destination operand, a second field to represent a first packed data source operand, and a third field to represent a second packed data source operand, wherein packed data elements of the first and second packed data source operands are of a first size and packed data elements of the packed data source/destination operand are of a second size; and
execute, in execution circuitry of the processor coupled to the decoder, according to the opcode of the instruction to, for each packed data element position of the packed data source/destination operand:
sign extend a plurality of packed signed data words from a corresponding packed data element position of the first packed data source operand;
sign extend a plurality of packed signed data words from a corresponding packed data element position of the second packed data source operand;
multiply each of the plurality of sign extended packed signed data words from a corresponding packed data element position of the first packed data source operand with a corresponding one of the plurality of sign extended packed signed data words from a corresponding packed data element position of the second packed data source operand to result in a plurality of results;
add the plurality of results with a packed data element of the second size of a corresponding packed data element position of the packed data source/destination operand to result in an addition result, and saturate the addition result to result in a saturated addition result if a width of the addition result exceeds a width of the second size; and
store the addition result or the saturated addition result in the corresponding packed data element position of the packed data source/destination operand.

### Claim 12 (depends on 11)

The non-transitory storage machine-readable medium of claim 11, wherein the instruction, when executed by the processor, causes the processor to suppress a memory fault.

### Claim 13 (depends on 11)

The non-transitory storage machine-readable medium of claim 11, wherein the instruction, when executed by the processor, causes the processor to perform a merging operation when the instruction further includes another field for a write mask.

### Claim 14 (depends on 11)

The non-transitory storage machine-readable medium of claim 11, wherein the instruction, when executed by the processor, causes the processor to, when a width of the packed data source/destination operand is 128 bits, perform 4 iterations of the multiply, the add, and the store.

### Claim 15 (depends on 11)

The non-transitory storage machine-readable medium of claim 11, wherein the instruction, when executed by the processor, causes the processor to, when a width of the packed data source/destination operand is 256 bits, perform 8 iterations of the multiply, the add, and the store.

### Claim 16

A system comprising:
a processor comprising:
a decoder to decode a single instruction having an opcode, a first field to represent a packed data source/destination operand, a second field to represent a first packed data source operand, and a third field to represent a second packed data source operand, wherein packed data elements of the first and second packed data source operands are of a first size and packed data elements of the packed data source/destination operand are of a second size;
a register file having a plurality of packed data registers to store one or more of the packed data source/destination operand, the first packed data source operand, and the second packed data source operand; and
execution circuitry coupled to the decoder and the register file, wherein in response to the decoded single instruction, the execution circuitry, according to the opcode of the single instruction, for each packed data element position of the packed data source/destination operand, is to:
sign extend a plurality of packed signed data words from a corresponding packed data element position of the first packed data source operand;
sign extend a plurality of packed signed data words from a corresponding packed data element position of the second packed data source operand;
multiply each of the plurality of sign extended packed signed data words from a corresponding packed data element position of the first packed data source operand with a corresponding one of the plurality of sign extended packed signed data words from a corresponding packed data element position of the second packed data source operand to result in a plurality of results;
add the plurality of results with a packed data element of the second size of a corresponding packed data element position of the packed data source/destination operand to result in an addition result, and saturate the addition result to result in a saturated addition result if a width of the addition result exceeds a width of the second size; and
store the addition result or the saturated addition result in the corresponding packed data element position of the packed data source/destination operand; and
a dynamic random access memory coupled to the processor.

### Claim 17 (depends on 16)

The system of claim 16, wherein the execution circuitry is to suppress a memory fault.

### Claim 18 (depends on 16)

The system of claim 16, wherein when the single instruction further includes another field for a write mask, the execution circuitry is to perform a merging operation.

### Claim 19 (depends on 16)

The system of claim 16, wherein the execution circuitry, when a width of the packed data source/destination operand is 128 bits, is to perform 4 iterations of the multiply, the add, and the store.

### Claim 20 (depends on 16)

The system of claim 16, wherein the execution circuitry, when a width of the packed data source/destination operand is 256 bits, is to perform 8 iterations of the multiply, the add, and the store.
