ldbrx
Load Doubleword Byte-Reverse Indexed
Loads a doubleword from memory, byte-reversing it before storing in the target register.
Details
Loads a doubleword (64-bit value) from memory at address (RA|0) + RB, byte-reverses it, and stores the result in RT. No status flags are affected. This is used for converting doubleword data between big-endian and little-endian byte orders.
Pseudocode Operation
EA ← (RA|0) + RB
RT ← byte_reverse_64([EA])
Programming Note
The ldbrx instruction is commonly used for loading and reversing the byte order of a doubleword from memory into a register. Ensure that the base address in RA (or 0 if using an absolute address) and the offset in RB are correctly set to avoid accessing invalid memory locations. This instruction operates at user privilege level, but care must be taken to handle potential exceptions such as alignment errors or access violations. Performance may vary depending on memory alignment; optimal performance is achieved when the effective address is 8-byte aligned.
Example
Encoding
Operands
-
RT
Target -
RA
Base -
RB
Index