vrlw
Vector Rotate Left Word
Rotates each word element of the source vector left by a specified number of bits.
Details
For vrlw, each word element in VSR[VRA+32] is rotated left by the number of bits specified in the low-order 5 bits of the corresponding word element in VSR[VRB+32]. The result is placed into the corresponding word element in VSR[VRT+32].
Pseudocode Operation
Programming Note
The vrlw instruction is commonly used for performing bitwise rotations on vector elements. Ensure that the Vector Facility (VEC) bit in the Machine State Register (MSR) is set to 1; otherwise, a Vector_Unavailable exception will be raised. The shift amount is determined by the low-order 5 bits of each word element in the second source vector register (VRB). Be cautious with alignment as unaligned access can lead to performance penalties or exceptions depending on the system configuration.
Example
Encoding
Operands
-
vD
Target -
vA
Data -
vB
Rotate Count -
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Source Vector Register