vspltw

Vector Splat Word

vspltw vD, vB, UIM

Copies a single word element from the source vector into all four word elements of the destination.

Details

The vspltw instruction takes the contents of a specified word element in VSR[VRB+32] and replicates it into each word element of VSR[VRT+32].

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
end
b ←UIM || 0b00000
do i = 0 to 3
    VSR[VRT+32].word[i] ←VSR[VRB+32].bit[b:b+31]
end

Programming Note

The vspltw instruction is used to replicate a selected word from one vector register into all words of another vector register. Ensure that the Vector Facility (MSR.VEC) is enabled; otherwise, a Vector_Unavailable exception will be raised. The index 'b' is derived by concatenating the UIM field with four zeros, and it specifies which 32-bit word to replicate. This instruction operates at the user privilege level.

Example

vspltw v1, v2, 0

Encoding

Binary Layout
4
0
vD
6
UIM
11
vB
16
652
 
Format VX-form
Opcode 0x1000028C
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • vD
    Target
  • vB
    Source
  • UIM
    Element Index (0-3)
  • VRT
    Target Vector Register
  • VRB
    Source Vector Register