# US 2024/0004662 A1 · Instructions and support for horizontal reductions

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

- Number: US 2024/0004662 A1
- Document ID: US20240004662A1
- Status: Published application
- Kind: A1
- Application number: 17/856,978
- Filed: 2022-07-02
- Published: 2024-01-04
- Earliest claimed: 2022-07-02
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Menachem ADELMAN; Amit GRADSTEIN; Regev SHEMY; Chitra NATARAJAN; Leonardo BORGES; Chytra SHIVASWAMY; Igor ERMOLAEV; Michael ESPIG; Or BEIT AHARON; Jeff WIEDEMEIER
- Web page: https://patentgrep.com/patent/US20240004662A1

## CPC

- G06F 9/30185: {according to one or more bits in the instruction, e.g. prefix, sub-opcode}
- G06F 9/30018: {Bit or string instructions}
- G06F 9/30021: {Compare instructions, e.g. Greater-Than, Equal-To, MINMAX}
- G06F 9/30025: {Format conversion instructions, e.g. Floating-Point to Integer, decimal conversion}
- G06F 9/30029: {Logical and Boolean instructions, e.g. XOR, NOT}
- G06F 9/30036: {Instructions to perform operations on packed data, e.g. vector, tile or matrix operations}
- G06F 9/30038: {using a mask}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for performing horizontal reductions are described. In some examples, an instance of a horizontal instruction is to include at least one field for an opcode, one or more fields to reference a first source operand, and one or more fields to reference a destination operand, wherein the opcode is to indicate that execution circuitry is, in response to a decoded instance of the single instruction, to at least perform a horizontal reduction using at least one data element of a non-masked data element position of at least the first source operand and store a result of the horizontal reduction in the destination operand.

## Claims

### Claim 1

An apparatus comprising:
decoder circuitry to decode an instance of a single instruction, the instance of the single instruction to include at least one field for an opcode, one or more fields to reference a first source operand, and one or more fields to reference a destination operand, wherein the opcode is to indicate that execution circuitry is, in response to a decoded instance of the single instruction, to at least perform a horizontal reduction using at least one data element of a non-masked data element position of at least the first source operand and store a result of the horizontal reduction in a single data element position of the destination operand; and
execution circuitry configured to execute the decoded instruction according to the opcode.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the horizontal reduction is one of addition, logical, or min/max.

### Claim 3 (depends on 1)

The apparatus of claim 1, wherein the one or more fields to reference the first source operand identify a vector register.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the one or more fields to reference the first source operand identify a memory location.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the instance of the single instruction further includes one or more fields to reference a second source operand.

### Claim 6 (depends on 5)

The apparatus of claim 5, wherein a single data element of the second source operand is used in the horizontal reduction operation.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the instance of the single instruction further includes a field for a mask operand wherein a mask of the mask operand is to mask data element positions.

### Claim 8 (depends on 7)

The apparatus of claim 7, wherein the execution circuitry is to use the mask operand to determine which data element positions of the first source operand to zero or replace with an identity value.

### Claim 9 (depends on 1)

The apparatus of claim 1, wherein data elements of the first source operand are sign extended.

### Claim 10 (depends on 1)

The apparatus of claim 1, wherein data elements of the first source operand are zero extended.

### Claim 11 (depends on 1)

The apparatus of claim 1, wherein data elements of the first source operand are a size of 8-bit, 16-bit, 32-bit, 64-bit, 128-bt, or 256-bit.

### Claim 12 (depends on 1)

The apparatus of claim 1, wherein data elements of the first source operand are integers.

### Claim 13 (depends on 1)

The apparatus of claim 1, wherein data elements of the first source operand are floating points.

### Claim 14 (depends on 1)

The apparatus of claim 1, wherein the instance of the single instruction includes a field for an immediate to determine a min/max operation to perform.

### Claim 15

A method comprising:
translating an instance of single instruction of a first instruction set architecture into one or more instructions of a second instruction set architecture, the instance of the single instruction of the first instruction set architecture to include at least one field for an opcode, one or more fields to reference a first source operand, and one or more fields to reference a destination operand, wherein the opcode is to indicate that execution circuitry is, in response to a decoded instance of the single instruction, to at least perform a horizontal reduction using at least one data element of a non-masked data element position of at least the first source operand and store a result of the horizontal reduction in a single data element position of the destination operand;
decoding the one or more instructions of the second instruction set architecture; and
executing the decoded one or more instructions of the second instruction set architecture according to the opcode of the instance of the single instruction of the first instruction set architecture.

### Claim 16 (depends on 15)

The method of claim 15, wherein the horizontal reduction is one of addition, logical, or min/max.

### Claim 17 (depends on 15)

The method of claim 15, wherein the one or more fields to reference the first source operand identify a vector register.

### Claim 18 (depends on 15)

The method of claim 15, wherein the one or more fields to reference the first source operand identify a memory location.

### Claim 19 (depends on 15)

The method of claim 15, wherein the instance of the single instruction further includes one or more fields to reference a second source operand.

### Claim 20 (depends on 19)

The method of claim 19, wherein a single data element of the second source operand is used in the horizontal reduction operation.

### Claim 21 (depends on 15)

The method of claim 15, wherein the instance of the single instruction further includes a field for a mask operand wherein a mask of the mask operand is to mask data element positions.

### Claim 22 (depends on 21)

The method of claim 21, wherein the execution circuitry is to use the mask operand to determine which data element positions of the first source operand to zero or replace with an identity value.

### Claim 23 (depends on 21)

The method of claim 21, the execution circuitry is to use the mask operand to determine which data element positions of the second source to unmask.

### Claim 24 (depends on 15)

The method of claim 15, wherein data elements of the first source operand are a size of 8-bit, 16-bit, 32-bit, 64-bit, 128-bt, or 256-bit.

### Claim 25

A system comprising:
memory to store an instance of a single instruction; and
a processor core comprising:
decoder circuitry to decode an instance of a single instruction, the instance of the single instruction to include at least one field for an opcode, one or more fields to reference a first source operand, and one or more fields to reference a destination operand, wherein the opcode is to indicate that execution circuitry is, in response to a decoded instance of the single instruction, to at least perform a horizontal reduction using at least one data element of a non-masked data element position of at least the first source operand and store a result of the horizontal reduction in a single data element position of the destination operand; and
execution circuitry configured to execute the decoded instruction according to the opcode.
