lvewx
Load Vector Element Word Indexed
Loads a word from memory into a vector register element.
Details
The lvewx instruction loads a word from memory into a vector register element. The effective address (EA) is calculated by adding the contents of general-purpose registers RA and RB, with the result ANDed with 0xFFFF_FFFF_FFFF_FFFC to ensure it is aligned to a 4-byte boundary. The byte at the calculated EA is placed into the specified position in VSR[VRT+32], depending on the endianness.
Pseudocode Operation
Programming Note
The lvewx instruction loads a word from memory into a vector register element. Ensure the effective address is aligned to a 4-byte boundary by ANDing with 0xFFFF_FFFF_FFFF_FFFC. This instruction requires the VEC bit in the MSR to be set; otherwise, it raises a Vector_Unavailable exception. Be aware of endianness when placing the byte into the vector register.
Example
Encoding
Operands
-
VRT
Target Vector Register -
RA
Source General Purpose Register -
RB
Source General Purpose Register