vspltb

Vector Splat Byte

vspltb vD, vB, UIM

Splat a byte from one vector element into all elements of another vector.

Encoding

Binary Layout
1001010
0:5
VRT
6:10
UIM
11:15
VRB
16:31
 
Format VX-form
Opcode 0x1000020C
Extension VMX (AltiVec)

Operands

  • vD
    Target
  • vB
    Source
  • UIM
    Index
  • VRT
    Target Vector Register
  • VRB
    Source Vector Register

Example

vspltb vd, vb, uim

Registers Altered

MSR

Related

More in VMX (AltiVec)

Reference

Description

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.

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).