vinserth

Vector Insert Halfword

vinserth vD, vB, UIM

Inserts a halfword from a GPR into a vector.

Details

The Vector Insert Halfword instruction (vinserth) inserts a halfword from one vector register into another vector register at an index specified by an immediate value. The remaining byte elements of the destination vector register are not modified.

Pseudocode Operation

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

Programming Note

The vinserth instruction is used to insert a halfword from one vector register into another at a specified index. Ensure that the Vector Facility (MSR.VEC) is enabled; otherwise, a Vector_Unavailable exception will be raised. The destination vector's remaining byte elements remain unchanged after the insertion.

Example

vinserth vd, vb, uim

Encoding

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

Operands

  • vD
    Target Vector
  • vB
    Source GPR
  • UIM
    Index