vinshvrx

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

vinshvrx

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

Details

Extracts a halfword element from a source vector register (VSR) and inserts it into a target vector register at a byte position determined by a general-purpose register using right-indexing. The right-index specifies the byte offset from the right (least significant) end of the 16-byte vector. The remaining elements of the target vector register are unchanged.

Pseudocode Operation

Not available in specification

Programming Note

The vinshvrx instruction is useful for selectively updating a halfword within a vector register based on a dynamic index provided by a general-purpose register. Ensure that the right-index specified in the GPR does not exceed the bounds of the 16-byte vector to avoid undefined behavior. This instruction operates at user privilege level and does not generate exceptions under normal circumstances, but incorrect indexing can lead to data corruption.

Example

vinshvrx

Encoding

Binary Layout
00101 001111
0
 
Format VX-form
Opcode 0x24F00000
Extension VMX (AltiVec)

Operands