主权项 |
1. A computer program product for providing sign extension in a computing environment, said computer program product comprising:
a non-transitory computer readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing the following comprising:
obtaining, by a rotator, an address of a data element in memory and a data size of the data element;storing, by the rotator, based on the address and the data size, the data element in a register having a defined number of byte positions, wherein the data element includes one or more bytes of data and the one or more bytes of data are aligned correctly in one or more positions of the register based on a predefined position in the register to receive a selected byte of data of the one or more bytes of data, the rotator using decode logic to store the data element in the register; andreplicating, by the rotator, a value of a chosen byte of data of the one or more bytes of data to one or more other positions of the register, the rotator using the decode logic used to store the data element in the register to replicate the value of the chosen byte of data, wherein based on using the decode logic of the rotator, the value of the chosen byte of data is stored in each position of the register, except for the one or more positions of the register loaded with the one or more bytes of data, the decode logic comprising:
For i=1 to the data size:
storing within position (X−i) of the register, a value of a byte of data of the one or more bytes of data obtained from memory at a determined address, the determined address specified by (the data size−i+the address), where X is the number of positions within the register and the register includes position 0 to position X−1; andFor i=(the data size+1) to the number of positions:
storing within position (X−i) of the register, a value of a byte of data of the one or more bytes of data obtained from memory at the address, where X is the number of positions within the register and the register includes position 0 to position X−1. |