vrlb
Vector Rotate Left Byte
vrlb vD, vA, vB
Rotates each byte of the source vector left by a specified number of bits.
Details
For vrlb, each byte in VSR[VRA+32] is rotated left by the number of bits specified in the low-order 3 bits of the corresponding byte in VSR[VRB+32]. The result is stored in VSR[VRT+32].
Pseudocode Operation
Programming Note
The vrlb instruction rotates each byte in the source vector left by a specified number of bits determined by another vector. Ensure that the Vector Facility is enabled (MSR.VEC=1) to avoid exceptions. The shift amount is derived from the high-order 3 bits of each byte in the second vector, so be cautious with bit manipulation to achieve the desired rotation.
Example
vrlb vd, va, vb
Encoding
Binary Layout
4
0
vD
6
vA
11
vB
16
4
Operands
-
vD
Target -
vA
Data -
vB
Rotate Count -
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Shift Control Vector Register