xxinsertw

VSX Vector Insert Word

xxinsertw XT, RB, UIM

Inserts a 32-bit word from a GPR into a specific element of a VSR.

Details

Inserts a 32-bit word from GPR RB into a specified 32-bit element of VSR XT, with the element index selected by UIM[2:0]. This is a VSX instruction that operates on vector data and does not affect condition registers or status fields.

Pseudocode Operation

element_index ← UIM[2:0]
XT[32*element_index : 32*element_index+31] ← RB[32:63]

Programming Note

The xxinsertw instruction is used to insert a word from one vector register into another at a specified byte offset. Ensure that the UIM (Upper Immediate) field does not exceed 12 to avoid undefined behavior. This instruction requires VSX (Vector Scalar Extensions) to be enabled in the MSR.VSX bit; otherwise, it will raise an exception.

Example

xxinsertw vs1, r5, uim

Encoding

Binary Layout
60
0
XT
6
UIM
11
RB
16
181
21
 
Format XX2-form
Opcode 0xF00002D4
Extension VSX
Registers Altered MSR

Operands

  • XT
    Target VSR
  • RB
    Source GPR
  • UIM
    Element Index