vinshvlx

Vector Insert Halfword from VSR using GPR - specified Left-Index VX-form

vinshvlx VRT,RA,VRB

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

Details

The instruction inserts the contents of bits 48:63 of VSR[VRB+32] into byte elements index:index+1 of VSR[VRT+32], where index is the contents of bits 60:63 of GPR[RA].

Pseudocode Operation

if MSR.VEC=0 then
    Vector_Unavailable()
index ← GPR[RA].bit[60:63]
src.byte[0:15] ← 0
VSR[VRT+32].byte[index:index+1] ← VSR[VRB+32].bit[48:63]

Programming Note

This instruction is used to insert the upper halfword of a vector register into specific byte elements of another vector register, based on an index derived from a general-purpose register. Ensure that the Vector Facility (MSR.VEC) is enabled; otherwise, a Vector_Unavailable exception will be raised. The index must be within the valid range for vector operations to avoid undefined behavior.

Example

vinshvlx v1, r4, v3

Encoding

Binary Layout
0
4
VRT
6
RA
11
VRB
16
 
Format VX-form
Opcode 0x1000004F
Extension VMX (AltiVec)
Registers Altered MSR

Operands

  • VRT
    Target Vector Register
  • RA
    Source General Purpose Register
  • VRB
    Source Vector Register
  • VSRT
    Target Vector Register
  • VSRC1
    Source Vector Register
  • VSRC2
    Source Vector Register