ldbrx
Load Doubleword Byte-Reverse Indexed
ldbrx RT, RA, RB
Loads a doubleword from memory, byte-reversing it before storing in the target register.
Encoding
Binary Layout
31
0:5
RT
6:10
RA
11:15
RB
16:20
532
21:30
/
31
Operands
-
RT
Target -
RA
Base -
RB
Index
Example
ldbrx r3, r4, r5
Related
More in Base
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
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.
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.