lswx
Load String Word Indexed
Loads N bytes from memory (N in XER).
Details
The lswx instruction loads a string of bytes from memory into general-purpose registers (GPRs). The effective address is calculated by adding the contents of register RA and RB. The number of bytes to load is determined by bits 57-63 of the XER register. Data are loaded into the low-order four bytes of each GPR, with the high-order four bytes set to zero. If the last register is only partially filled, the unfilled low-order byte(s) are set to zero.
Pseudocode Operation
Programming Note
String instructions are not pipelined on most implementations and can be very slow for large counts. Consider using byte loops or vector instructions for performance-critical paths. NB: these instructions are optional in Power ISA 3.0+ and may trap on some implementations.
Example
Encoding
Operands
-
RT
Start Reg -
RA
Base -
RB
Index