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

The effective address is computed by adding the contents of general-purpose register RA (or 0 if RA=0) and general-purpose register RB, then truncating to a halfword-aligned boundary. A halfword is loaded from that effective address into the element of vector register VRT that contains the addressed halfword, while all other bytes of the target vector register are undefined.

Pseudocode Operation

Not available in specification

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