vinsertb
Vector Insert Byte from VSR using Immediate-specified Index
vinsertb vD, vB, UIM
Inserts a byte element from one vector register into another at an immediate-specified index.
Details
The contents of byte element 7 of VSR[VRB+32] are placed into byte element UIM of VSR[VRT+32]. The remaining byte elements of VSR[VRT+32] are not modified.
Pseudocode Operation
if MSR.VEC=0 then
Vector_Unavailable()
VRT[32].byte[UIM] ← VRB[32].byte[7]
Programming Note
This instruction is used to insert a byte 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 and source registers must be in the range of 32-63. Be cautious with alignment as it affects performance and correctness.
Example
vinsertb vd, vb, uim
Encoding
Binary Layout
4
0
vD
6
UIM
11
vB
16
781
Operands
-
vD
Target Vector -
vB
Source GPR -
UIM
Index -
VRT
Target Vector Register -
VRB
Source Vector Register -
VX
Target Vector Register -
VS
Source Vector Register -
VI
Immediate Value -
IMM8
8-bit Immediate Index