lxvrhx
Load VSX Vector Rightmost Halfword Indexed
Loads a halfword from memory into the rightmost element of a VSX vector register.
Details
Loads a 16-bit halfword from memory and places it in the rightmost (least significant) halfword position of a VSX register, with all other bits set to 0. The effective address is computed as RA|0 + RB. No status fields are modified by this instruction.
Pseudocode Operation
EA ← (RA=0 ? 0 : GPR[RA]) + GPR[RB]
VSR[XT] ← (0x000000000000000000000000 || MEM(EA, 2))
Programming Note
The lxvrhx instruction is used to load a halfword from memory into the rightmost element of a VSX vector register. Ensure that the VSX facility is enabled in the MSR register; otherwise, an exception will be raised. The address calculation uses two general-purpose registers, RA and RB, where RA can be zero. The loaded halfword is placed in the rightmost halfword element (element 7) of the specified VSX vector register, with all other elements set to zero. Endianness affects how the halfword is stored in the vector register; ensure proper handling for both big-endian and little-endian systems.
Example
Encoding
Operands
-
XT
Target Vector-Scalar Register -
RA
Source General Purpose Register (Base Address) -
RB
Source General Purpose Register (Index)