vinsertw

Vector Insert Word from VSR using Immediate-specified Index

vinsertw vD, vB, UIM

Inserts a word element from one vector register into another vector register at an immediate-specified index.

Details

The contents of word element 1 of VSR[VRB+32] are placed into byte elements UIM:UIM+3 of VSR[VRT+32]. The contents of the remaining byte elements of VSR[VRT+32] are not modified. If the value of UIM is greater than 12, the results are undefined.

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
VSR[VRT+32].byte[UIM:UIM+3] ← VSR[VRB+32].word[1]

Programming Note

This instruction is used to insert a word from one vector register into another, with the destination index specified by an immediate value. Ensure that the immediate index (UIM) does not exceed 12 to avoid undefined behavior. This operation requires the Vector Facility to be enabled in the Machine State Register (MSR).

Example

vinsertw vd, vb, uim

Encoding

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

Operands

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