lvehx

Load Vector Element Halfword Indexed X-form

lvehx VX,RA,RB

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

lvehx v1, r4, r5

Encoding

Binary Layout
31
0
VRT
6
RA
11
RB
16
39
21
/
31
 
Format X-form
Opcode 0x7C00004E
Extension VMX (AltiVec)

Operands

  • VX
    Target VSX Register
  • RA
    Base Address General Purpose Register
  • RB
    Index General Purpose Register