Method and system for performing shift operations
AssigneeInternational Business Machines Corporation
InventorsChristopher Michael Abernathy, Scott Raymond Cottier, Gilles Gervais
Life of this patent
Estimating the term…
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.
Claims30
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.
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.
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.
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.
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.
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.
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.
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.
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.
Dependencies are inferred from the claim text.