lxvwsx

Load VSX Vector Word and Splat Indexed

lxvwsx XT, RA, RB

Loads a 32-bit word and replicates it across the vector.

Details

The lxvwsx instruction loads a word from memory into the VSX vector register, then splats this word across all elements of the vector.

Pseudocode Operation

if TX=0 & MSR.VSX=0 then VSX_Unavailable()
if TX=1 & MSR.VEC=0 then Vector_Unavailable()
EA ←((RA=0) ? 0 : GPR[RA]) + GPR[RB]
load_data ←MEM(EA,4)
do i = 0 to 3
   VSR[32×TX+T].word[i] ←load_data

Programming Note

The lxvwsx instruction is commonly used for loading a word from memory and replicating it across all elements of a VSX vector register. Ensure that the appropriate privilege levels (MSR.VSX or MSR.VEC) are enabled to avoid exceptions. The instruction requires 4-byte alignment for the memory address; unaligned accesses may result in performance penalties or exceptions depending on the system configuration.

Example

lxvwsx vs1, r4, r5

Encoding

Binary Layout
31
0
XT
6
RA
11
RB
16
364
21
 
Format XX1-form
Opcode 0x7C00016C
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target
  • RA
    Base
  • RB
    Index