vinsw

Vector Insert Word from GPR using Immediate-specified Index

vinsw VRT,RB,UIM

Inserts the contents of a word from a general-purpose register into a vector register at an immediate-specified index.

Encoding

Binary Layout
4
0:5
VRT
6:10
UIM
11:15
RB
16:31
 
Format VX-form
Opcode 0x100000CF
Extension VMX (AltiVec)

Operands

  • VRT
    Target Vector Register
  • RB
    Source General Purpose Register
  • UIM
    Immediate-specified Index

Example

vinsw v1, r5, uim

Related

More in VMX (AltiVec)

Reference

Description

The contents of bits 32:63 of GPR[RB] are placed into byte elements UIM:UIM+3 of VSR[VRT+32]. All other byte elements of VSR[VRT+32] are not modified. If UIM is greater than 12, the result is undefined.

Operation

if MSR.VEC=0 then
    Vector_Unavailable()
VSR[VRT+32].byte[UIM:UIM+3] ← GPR[RB].bit[32:63]

Programming Note

The vinsw instruction is used to insert the upper 32 bits of a general-purpose register (GPR) into a specific byte range within a vector register. Ensure that the immediate index (UIM) does not exceed 12 to avoid undefined behavior. This instruction operates at user privilege level and will raise an exception if the Vector Facility is unavailable.