vmrglb
Vector Merge Low Byte
Interleaves low-order bytes.
Details
The Vector Merge Low Byte instruction (vmrglb) merges the low bytes of two vector registers into a single vector register. It takes three operands: VRT (target), VRA, and VRB. For each byte position from 0 to 7, it copies the byte from VRA into the corresponding halfword in VRT if the byte index is even, and from VRB if the byte index is odd.
Pseudocode Operation
Programming Note
The vmrglb instruction is useful for merging data from two vectors by alternating bytes into a third vector. Ensure that the target and source registers are properly aligned to avoid unexpected behavior. This instruction requires the Vector Facility to be enabled in the MSR register; otherwise, it will raise an exception. Performance may vary based on the specific implementation and alignment of the data.
Example
Encoding
Operands
-
vD
Target -
vA
Src A -
vB
Src B