vslv
Vector Shift Left Variable
Shifts the contents of vector elements left by a variable amount.
Details
Shifts each element of the source vector left by a variable amount specified in the corresponding element of the shift amount vector. The shift amount for each element is taken from the least significant bits of the corresponding element in VRB. No status flags are affected.
Pseudocode Operation
for i in 0 to 15 do
shamt ← (VRB[i*8:(i+1)*8-1]) & 0x7
VRT[i*8:(i+1)*8-1] ← VRA[i*8:(i+1)*8-1] << shamt
end for
Programming Note
The vslv instruction is used to perform variable left shifts on each byte of a vector register. Ensure that the shift amounts in VSR[VRB+32] are within the valid range (0-7) to avoid unexpected results. This instruction operates at user privilege level and will raise an exception if the Vector Facility is not enabled.
Example
Encoding
Operands
-
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Shift Amount Vector Register