vperm
Vector Permute
vperm vD, vA, vB, vC
The signature AltiVec instruction. Constructs a new vector by selecting bytes from two source vectors based on a permute control vector.
Details
The Vector Permute instruction allows any byte in two source VSRs to be copied to any byte in the target VSR. The bytes in a third source VSR specify from which byte in the first two source VSRs the corresponding target byte is to be copied.
Pseudocode Operation
Programming Note
See the Programming Notes with the Load Vector for Shift Left and Load Vector for Shift Right instructions on page 266 for examples of uses of vperm.
Example
vperm v1, v2, v3, v4
Encoding
Binary Layout
4
0
vD
6
vA
11
vB
16
vC
21
43
Operands
-
vD
Target -
vA
Source 1 (Bytes 0-15) -
vB
Source 2 (Bytes 16-31) -
vC
Control Vector -
VRT
Target Vector Register -
VRA
Source Vector Register -
VRB
Source Vector Register -
VRC
Permute Control Vector Register