vinshlx
Vector Insert Halfword from GPR using GPR-specified Left-Index VX-form
vinshlx VRT,RA,RB
Inserts the high halfword of a general-purpose register into a vector register at a position specified by another general-purpose register.
Encoding
Binary Layout
4
0:5
VRT
6:10
RA
11:15
RB
16:31
Operands
-
VRT
Target Vector Register -
RA
Source General Purpose Register (index) -
RB
Source General Purpose Register (data)
Example
vinshlx v1, r4, r5
Related
More in VMX (AltiVec)
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
The contents of bits 48:63 of GPR[RB] are placed into byte elements index:index+1 of VSR[VRT+32], where index is the contents of bits 60:63 of GPR[RA].
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] ← GPR[RB].bit[48:63]
Programming Note
The vinshlx instruction is used to insert the upper halfword of a general-purpose register (GPR) into specific byte elements of a vector register. Ensure that the index specified in bits 60-63 of RA is within valid bounds to avoid undefined behavior. This instruction requires the Vector Facility to be enabled; otherwise, it will raise an exception.