# US 2003/0078950 A1 · Method and system for performing shift operations

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

- Number: US 2003/0078950 A1
- Document ID: US20030078950A1
- Status: Published application
- Kind: A1
- Application number: 09/981,902
- Filed: 2001-10-18
- Published: 2003-04-24
- Earliest claimed: 2001-10-18
- Assignees: International Business Machines Corporation
- Inventors: Christopher Michael Abernathy; Scott Raymond Cottier; Gilles Gervais
- Web page: https://patentgrep.com/patent/US20030078950A1

## CPC

- G06F 5/01: for shifting, e.g. justifying, scaling, normalising {(digital stores in which the information is moved stepwise, e.g. shift-registers G11C19/00; digital stores in which the information circulates G11C21/00)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and an apparatus for performing a shift operation on an operand. The method and apparatus configures input lines to comprise a first part that includes the bits in order representing various shift amounts in a first direction and a second part that includes bits ordered representing various shift amounts in a second direction. The shift is then performed by selecting the appropriate bits from the input line to create the result.

## Claims

### Claim 1

A method of shifting a first operand, the method comprising the steps of:
for each byte of the first operand, configuring for each bit of each byte a data input line, comprising a first part and a second part, corresponding to successive shift amounts, wherein the first part of the data input line corresponds to a shift in a first direction and the second part of the data input line corresponds to a shift in a second direction; and
selecting from the data input line for each bit the bit corresponding to the value of the shift amount and shift direction, wherein the shift direction is used to select a bit from the first part or the second part.

### Claim 2 (depends on 1)

The method of claim 1, wherein the operand is at least one of a 16-bit operand, a 32-bit operand, a 64-bit operand, 128-bit operand, a 256-bit operand, and a 512-bit operand.

### Claim 3 (depends on 1)

The method of claim 1, wherein at least one of the first part and the second comprises zeros to fill vacated bits with a zero.

### Claim 4

A method of shifting a first operand, the method comprising the steps of:
extracting from an instruction a direction to shift the first operand;
extracting from a second operand an amount to shift the first operand;
configuring a data input line for each bit of each byte of the first operand, each data input line comprising a first part and a second part, wherein the first part comprises bits ordered corresponding to shift amounts in a first direction and the second part comprises bits ordered corresponding to shift amounts in a second direction; and
selecting from each data input line the bit corresponding to the value of the shift amount and shift direction, wherein the shift direction is used to select a bit from the first part or the second part.

### Claim 5 (depends on 4)

The method of claim 4, wherein at least one of the first part and the second part comprises zeros to fill vacated bits with a zero.

### Claim 6 (depends on 4)

The method of claim 4, wherein the second operand is set to zero to provide the second part of the data input lines.

### Claim 7

A method of performing vector permute operations, the method comprising the steps of:
receiving an instruction for a vector permute operation;
decoding the instruction to determine an instruction type, a first operand, and a second operand;
selecting from one or more resources the first operand;
selecting from one or more resources the second operand;
extracting from the instruction a direction to shift the first operand;
extracting from the second operand an amount to shift the first operand;
configuring a third operand to comprise the direction and the amount in one or more bytes;
performing a second function on the first operand and the second operand according to the values in the third operand;
performing a shifter function on the first operand and the second operand according to the values in the third operand;
determining whether the instruction type corresponds to the second function or to the shifter function;
upon a determination that the instruction type corresponds to the second function, setting the result of the vector permute operation to the output of the second function; and
upon a determination that the instruction type corresponds to the shifter function, setting the result of the vector permute operation to the output of the shifter function.

### Claim 8 (depends on 7)

The method of claim 7, wherein at least one of the first part and the second comprises zeros to fill vacated bits with a zero.

### Claim 9 (depends on 7)

The method of claim 7, wherein the second function is a CROSSBAR function.

### Claim 10 (depends on 7)

The method of claim 7, wherein the second operand is set to zero to provide the second part of the data input lines.

### Claim 11

An apparatus for shifting a first operand, the apparatus comprising:
means for configuring for each bit of each byte of the first operand a data input line, comprising a first part and a second part, corresponding to successive shift amounts, wherein the first part of the data input line corresponds to a shift in a first direction and the second part of the data input line corresponds to a shift in a second direction; and
means for selecting from the data input line for each bit the bit corresponding to the value of the shift amount and shift direction, wherein the shift direction is used to select a bit from the first part or the second part.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the operand is at least one of a 16-bit operand, a 32-bit operand, a 64-bit operand, 128-bit operand, a 256-bit operand, and a 512-bit operand.

### Claim 13 (depends on 11)

The apparatus of claim 11, wherein at least one of the first part and the second part comprises zeros to fill vacated bits with a zero.

### Claim 14

An apparatus for shifting a first operand, the apparatus comprising:
means for extracting from an instruction a direction to shift the first operand;
means for extracting from a second operand an amount to shift the first operand;
means for configuring a data input line for each bit of each byte of the first operand, each data input line comprising a first part and a second part, wherein the first part comprises bits ordered corresponding to shift amounts in a first direction and the second part comprises bits ordered corresponding to shift amounts in a second direction; and
means for selecting from each data input line the bit corresponding to the value of the shift amount and shift direction, wherein the shift direction is used to select a bit from the first part or the second part.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein at least one of the first part and the second part comprises zeros to fill vacated bits with a zero.

### Claim 16 (depends on 14)

The apparatus of claim 14, wherein the second operand is set to zero to provide the second part of the data input lines.

### Claim 17

An apparatus for performing vector permute operations, the apparatus comprising:
means for receiving an instruction for a vector permute operation;
means for decoding the instruction to determine an instruction type, a first operand, and a second operand;
means for selecting from one or more resources the first operand;
means for selecting from one or more resources the second operand;
means for extracting from the instruction a direction to shift the first operand;
means for extracting from the second operand an amount to shift the first operand;
means for configuring a third operand to comprise the direction and the amount in one or more bytes;
means for performing a second function on the first operand and the second operand according to the values in the third operand;
means for performing a shifter function on the first operand and the second operand according to the values in the third operand;
means for determining whether the instruction type corresponds to the second function or to the shifter function;
means for, upon a determination that the instruction type corresponds to the second function, setting the result of the vector permute operation to the output of the second function; and
means for, upon a determination that the instruction type corresponds to the shifter function, setting the result of the vector permute operation to the output of the shifter function.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein at least one of the first part and the second comprises zeros to fill vacated bits with a zero.

### Claim 19 (depends on 17)

The apparatus of claim 17, wherein the second function is a CROSSBAR function.

### Claim 20 (depends on 17)

The apparatus of claim 17, wherein the second operand is set to zero to provide the second part of the data input lines.

### Claim 21

A computer program product for shifting a first operand, the computer program product having a medium with a computer program embodied thereon, the computer program comprising:
computer program code for configuring for each bit of each byte of the first operand a data input line, comprising a first part and a second part, corresponding to successive shift amounts, wherein the first part of the data input line corresponds to a shift in a first direction and the second part of the data input line corresponds to a shift in a second direction; and
computer program code for selecting from the data input line for each bit the bit corresponding to the value of the shift amount and shift direction, wherein the shift direction is used to select a bit from the first part or the second part.

### Claim 22 (depends on 21)

The computer program product of claim 21, wherein the operand is at least one of a 16-bit operand, a 32-bit operand, a 64-bit operand, 128-bit operand, a 256-bit operand, and a 512-bit operand.

### Claim 23 (depends on 21)

The computer program product of claim 21, wherein at least one of the first part and the second part comprises zeros to fill vacated bits with a zero.

### Claim 24

A computer program product for shifting a first operand, the computer program product having a medium with a computer program embodied thereon, the computer program comprising:
computer program code for extracting from an instruction a direction to shift the first operand;
computer program code for extracting from a second operand an amount to shift the first operand;
computer program code for configuring a data input line for each bit of each byte of the first operand, each data input line comprising a first part and a second part, wherein the first part comprises bits ordered corresponding to shift amounts in a first direction and the second part comprises bits ordered corresponding to shift amounts in a second direction; and
computer program code for selecting from each data input line the bit corresponding to the value of the shift amount and shift direction, wherein the shift direction is used to select a bit from the first part or the second part.

### Claim 25 (depends on 24)

The computer program product of claim 24, wherein at least one of the first part and the second part comprises zeros to fill vacated bits with a zero.

### Claim 26 (depends on 24)

The computer program product of claim 24, wherein the second operand is set to zero to provide the second part of the data input lines.

### Claim 27

A computer program product for performing vector permute operations, the computer program product having a medium with a computer program embodied thereon, the computer program comprising:
computer program code for receiving an instruction for a vector permute operation;
computer program code for decoding the instruction to determine an instruction type, a first operand, and a second operand;
computer program code for selecting from one or more resources the first operand;
computer program code for selecting from one or more resources the second operand;
computer program code for extracting from the instruction a direction to shift the first operand;
computer program code for extracting from the second operand an amount to shift the first operand;
computer program code for configuring a third operand to comprise the direction and the amount in one or more bytes;
computer program code for performing a second function on the first operand and the second operand according to the values in the third operand;
computer program code for performing a shifter function on the first operand and the second operand according to the values in the third operand;
computer program code for determining whether the instruction type corresponds to the second function or to the shifter function;
computer program code for, upon a determination that the instruction type corresponds to the second function, setting the result of the vector permute operation to the output of the second function; and
computer program code for, upon a determination that the instruction type corresponds to the shifter function, setting the result of the vector permute operation to the output of the shifter function.

### Claim 28 (depends on 27)

The computer program product of claim 27, wherein at least one of the first part and the second comprises zeros to fill vacated bits with a zero.

### Claim 29 (depends on 27)

The computer program product of claim 27, wherein the second function is a CROSSBAR function.

### Claim 30 (depends on 27)

The computer program product of claim 27, wherein the second operand is set to zero to provide the second part of the data input lines.
