vspltb
Vector Splat Byte
vspltb vD, vB, UIM
Splat a byte from one vector element into all elements of another vector.
Details
Splats (replicates) a single byte element from vB across all 16 byte elements of vD. The byte element selected is determined by the 4-bit unsigned immediate UIM (where UIM=0 selects byte 0, UIM=15 selects byte 15 in big-endian order). No status flags are affected. This is a VMX/AltiVec instruction.
Pseudocode Operation
index ← UIM
vD ← replicate(vB[index*8:index*8+7] to all 16 byte positions)
Programming Note
The Vector Splat instructions can be used in preparation for performing arithmetic for which one source vector is to consist of elements that all have the same value (e.g., multiplying all elements of a VSR by a constant).
Example
vspltb vd, vb, uim
Encoding
Binary Layout
1001010
0
VRT
6
UIM
11
VRB
16
Operands
-
vD
Target -
vB
Source -
UIM
Index -
VRT
Target Vector Register -
VRB
Source Vector Register