xxpermr
VSX Vector Permute Right
Little-endian optimized permute.
Details
The VSX Vector Permute Right instruction (xxpermr) permutes bytes from two source vectors based on a control vector. It places the first 16 bytes of the first source vector into the lower half of the target vector and uses the control vector to determine how to place the remaining 16 bytes from the second source vector into the upper half of the target vector, with an additional right-indexed twist.
Pseudocode Operation
Programming Note
The xxpermr instruction is useful for complex byte-level data manipulation, especially when merging and reordering bytes from two source vectors. Ensure that the control vector (second source) correctly specifies the desired permutation indices to avoid unexpected results. This instruction operates at a privilege level that allows it in user mode, but developers should be cautious of potential performance overhead due to its complexity.
Example
Encoding
Operands
-
XT
Target -
XA
Src A -
XB
Src B -
XC
Control