lvehx
Load Vector Element Halfword Indexed X-form
Loads a halfword element from memory into the corresponding halfword element of a vector register, with the address computed as the sum of RA and RB, aligned to a halfword boundary.
Details
Loads a halfword (16-bit) element from memory at the address formed by RA + RB into the corresponding halfword element of vector register VRT. The effective address is aligned to a halfword boundary. This is a VMX/AltiVec instruction with no effect on condition or status registers.
Pseudocode Operation
EA ← (RA) + (RB)
VRT[element] ← MEM(EA, 2)
Programming Note
The lvehx instruction loads a halfword from memory into a specific element of a vector register. Ensure the effective address is halfword-aligned to avoid alignment faults. The operation does not require any special privileges, but it may raise an exception if the access violates memory protection rules.
Example
Encoding
Operands
-
VX
Target VSX Register -
RA
Base Address General Purpose Register -
RB
Index General Purpose Register