# US 2014/0208067 A1 · Vector element rotate and insert under mask instruction

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

- Number: US 2014/0208067 A1
- Document ID: US20140208067A1
- Status: Published application
- Kind: A1
- Application number: 13/748,543
- Filed: 2013-01-23
- Published: 2014-07-24
- Earliest claimed: 2013-01-23
- Assignees: International Business Machines Corporation
- Inventors: Jonathan D. Bradbury; Robert F. Enenkel; Eric M. Schwarz; Timothy J. Slegel
- Web page: https://patentgrep.com/patent/US20140208067A1

## CPC

- G06F 9/30032: {Movement instructions, e.g. MOVE, SHIFT, ROTATE, SHUFFLE}
- G06F 9/30007: {to perform operations on data operands}
- 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/30098: {Register arrangements}
- G06F 9/30145: {Instruction analysis, e.g. decoding, instruction word fields}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A Vector Element Rotate and Insert Under Mask instruction. Each element of a second operand of the instruction is rotated in a specified direction by a specified number of bits. For each bit in a third operand of the instruction that is set to one, the corresponding bit of the rotated elements in the second operand replaces the corresponding bit in a first operand of the instruction.

## Claims

### Claim 1

A computer program product for executing a machine instruction in a central processing unit, the computer program product comprising:
a computer readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
obtaining, by a processor, a machine instruction for execution, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising:
at least one opcode field to provide an opcode, the opcode identifying a Vector Element Rotate And Insert Under Mask operation;
a first register field to be used to designate a first register, the first register comprising a first operand;
a second register field to be used to designate a second register, the second register comprising a second operand;
a third register field to be used to designate a third register, the third register comprising a third operand; and
executing the machine instruction, the executing comprising:
rotating one or more elements of the second operand in a selected direction by a specified amount to rotate;
checking the third operand for one or more data units having a particular value; and
based on the third operand having the one or more data units with the particular value, replacing one or more values of corresponding data units in the first operand with one or more values of corresponding data units in the second operand that has been rotated.

### Claim 2 (depends on 1)

The computer program product of claim 1, wherein the selected direction comprises to the left and the specified amount to be rotated comprises a specified number of bits.

### Claim 3 (depends on 2)

The computer program product of claim 2, wherein the rotating comprises rotating each element of the second operand to the left by the specified number of bits, wherein each bit shifted out of a leftmost bit position of an element reenters in a rightmost bit position of the element.

### Claim 4 (depends on 1)

The computer program product of claim 1, wherein the third operand comprises a plurality of elements, and the plurality of elements comprises a plurality of masks, and wherein a mask of the plurality of masks includes a plurality of bits.

### Claim 5 (depends on 4)

The computer program product of claim 4, wherein the one or more data units comprise one or more bits, the particular value comprises a one, and wherein the replacing comprises for each bit in the third operand that is set to one, replacing a value of the corresponding bit in the first operand with a value of the corresponding bit in the second operand that has been rotated.

### Claim 6 (depends on 1)

The computer program product of claim 1, wherein the second operand comprises a plurality of elements, and the specified amount to rotate is included in a fourth operand of the machine instruction, the fourth operand comprising an unsigned binary integer specifying a number of bits to rotate each element of the second operand, and wherein the method further comprises:
determining whether the unsigned binary integer is greater than a number of bits of an element of a selected operand; and
based on the unsigned binary integer being greater than the number of bits of the element of the selected operand, reducing modulo the unsigned binary integer by the number of bits of the element of the selected operand.

### Claim 7 (depends on 6)

The computer program product of claim 6, wherein the method further comprises determining the number of bits of the element of the selected operand, the determining using a mask field of the machine instruction, the mask field comprising an element size control to indicate a size of elements of one or more operands of the machine instruction.

### Claim 8 (depends on 1)

The computer program product of claim 1, wherein the machine instruction further comprises an extension field to be used in designating one or more registers, and wherein the first register field is combined with a first portion of the extension field to designate the first register, the second register field is combined with a second portion of the extension field to designate the second register, and the third register field is combined with a third portion of the extension field to designate the third register.

### Claim 9 (depends on 1)

The computer program product of claim 1, wherein the second operand comprises one or more second operand elements, the selected direction is to the left, the data unit comprises a bit, the specified amount to rotate comprises a specified number of bits, and the third operand comprises one or more third operand elements, each third operand element comprising a mask having a plurality of bits, and wherein:
the rotating comprising rotating each element of the second operand to the left by the specified number of bits, wherein each bit shifted out of a leftmost bit position of an element reenters in a rightmost bit position of the element; and
the replacing comprises for each bit in the third operand that is set to one, a value of the corresponding bit of the second operand that has been rotated replaces a value of the corresponding bit in the first operand.

### Claim 10 (depends on 1)

The computer program product of claim 1, wherein the machine instruction further comprises a mask field, the mask field comprising an element size control to indicate a size of elements of one or more of the first operand, the second operand and the third operand.

### Claim 11

A computer system for executing a machine instruction in a central processing unit, the computer system comprising:
a memory; and
a processor in communications with the memory, wherein the computer system is configured to perform a method, said method comprising:
obtaining, by a processor, a machine instruction for execution, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising:
at least one opcode field to provide an opcode, the opcode identifying a Vector Element Rotate And Insert Under Mask operation;
a first register field to be used to designate a first register, the first register comprising a first operand;
a second register field to be used to designate a second register, the second register comprising a second operand;
a third register field to be used to designate a third register, the third register comprising a third operand; and
executing the machine instruction, the executing comprising:
rotating one or more elements of the second operand in a selected direction by a specified amount to rotate;
checking the third operand for one or more data units having a particular value; and
based on the third operand having the one or more data units with the particular value, replacing one or more values of corresponding data units in the first operand with one or more values of corresponding data units in the second operand that has been rotated.

### Claim 12 (depends on 11)

The computer system of claim 11, wherein the selected direction comprises to the left and the specified amount to be rotated comprises a specified number of bits, and wherein the rotating comprises rotating each element of the second operand to the left by the specified number of bits, wherein each bit shifted out of a leftmost bit position of an element reenters in a rightmost bit position of the element.

### Claim 13 (depends on 11)

The computer system of claim 11, wherein the third operand comprises a plurality of elements, and the plurality of elements comprises a plurality of masks, and wherein a mask of the plurality of masks includes a plurality of bits, and wherein the one or more data units comprise one or more bits, the particular value comprises a one, and wherein the replacing comprises for each bit in the third operand that is set to one, replacing a value of the corresponding bit in the first operand with a value of the corresponding bit in the second operand that has been rotated.

### Claim 14 (depends on 11)

The computer system of claim 11, wherein the second operand comprises a plurality of elements, and the specified amount to rotate is included in a fourth operand of the machine instruction, the fourth operand comprising an unsigned binary integer specifying a number of bits to rotate each element of the second operand, and wherein the method further comprises:
determining whether the unsigned binary integer is greater than a number of bits of an element of a selected operand; and
based on the unsigned binary integer being greater than the number of bits of the element of the selected operand, reducing modulo the unsigned binary integer by the number of bits of the element of the selected operand.

### Claim 15 (depends on 11)

The computer system of claim 11, wherein the machine instruction further comprises an extension field to be used in designating one or more registers, and wherein the first register field is combined with a first portion of the extension field to designate the first register, the second register field is combined with a second portion of the extension field to designate the second register, and the third register field is combined with a third portion of the extension field to designate the third register.

### Claim 16 (depends on 11)

The computer system of claim 11, wherein the second operand comprises one or more second operand elements, the selected direction is to the left, the data unit comprises a bit, the specified amount to rotate comprises a specified number of bits, and the third operand comprises one or more third operand elements, each third operand element comprising a mask having a plurality of bits, and wherein:
the rotating comprising rotating each element of the second operand to the left by the specified number of bits, wherein each bit shifted out of a leftmost bit position of an element reenters in a rightmost bit position of the element; and
the replacing comprises for each bit in the third operand that is set to one, a value of the corresponding bit of the second operand that has been rotated replaces a value of the corresponding bit in the first operand.

### Claim 17 (depends on 11)

The computer system of claim 11, wherein the machine instruction further comprises a mask field, the mask field comprising an element size control to indicate a size of elements of one or more of the first operand, the second operand and the third operand.

### Claim 18

A method of executing a machine instruction in a central processing unit, the method comprising:
obtaining, by a processor, a machine instruction for execution, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising:
at least one opcode field to provide an opcode, the opcode identifying a Vector Element Rotate And Insert Under Mask operation;
a first register field to be used to designate a first register, the first register comprising a first operand;
a second register field to be used to designate a second register, the second register comprising a second operand;
a third register field to be used to designate a third register, the third register comprising a third operand; and
executing the machine instruction, the executing comprising:
rotating one or more elements of the second operand in a selected direction by a specified amount to rotate;
checking the third operand for one or more data units having a particular value; and
based on the third operand having the one or more data units with the particular value, replacing one or more values of corresponding data units in the first operand with one or more values of corresponding data units in the second operand that has been rotated.

### Claim 19 (depends on 18)

The method of claim 18, wherein the second operand comprises one or more second operand elements, the selected direction is to the left, the data unit comprises a bit, the specified amount to rotate comprises a specified number of bits, and the third operand comprises one or more third operand elements, each third operand element comprising a mask having a plurality of bits, and wherein:
the rotating comprising rotating each element of the second operand to the left by the specified number of bits, wherein each bit shifted out of a leftmost bit position of an element reenters in a rightmost bit position of the element; and
the replacing comprises for each bit in the third operand that is set to one, a value of the corresponding bit of the second operand that has been rotated replaces a value of the corresponding bit in the first operand.

### Claim 20 (depends on 18)

The method of claim 18, wherein the machine instruction further comprises a mask field, the mask field comprising an element size control to indicate a size of elements of one or more of the first operand, the second operand and the third operand.
