vinsdlx

Vector Insert Doubleword from GPR using GPR-specified Left-Index VX-form

vinsdlx VRT,RA,RB

Inserts a doubleword from a general-purpose register into a vector register at a position specified by another general-purpose register.

Details

The contents of GPR[RB] are placed into byte elements index:index+7 of VSR[VRT+32], where index is the contents of bits 60:63 of GPR[RA]. All other byte elements of VSR[VRT+32] remain unchanged.

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
index ← GPR[RA].bit[60:63]
VSR[VRT+32].byte[index:index+7] ← GPR[RB]

Programming Note

The vinsdlx instruction is used to insert the contents of a general-purpose register (GPR) into a specific byte range within a vector register. Ensure that the index specified in bits 60:63 of the RA register is within the valid range (0-15) to avoid undefined behavior. This instruction requires the Vector Facility to be enabled; otherwise, it will raise an exception.

Example

vinsdlx v1, r4, r5

Encoding

Binary Layout
0
4
VRT
6
RA
11
RB
16
 
Format VX-form
Opcode 0x100002CF
Extension VMX (AltiVec)

Operands

  • VRT
    Target Vector Register
  • RA
    Source General Purpose Register (contains index)
  • RB
    Source General Purpose Register (contains data to insert)