brd
Byte-Reverse Doubleword
brd RT,RA
Reverses the bytes in a doubleword.
Encoding
Binary Layout
18
0:5
LI
6:29
AA
30
LK
31
Operands
-
RT
Target General Purpose Register -
RA
Source General Purpose Register
Example
brd r3, r4
Related
More in Base
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Reverses the byte order of a 64-bit doubleword from the source register and places the result in the target register. This instruction operates at the architectural level to perform a complete byte reversal (byte 0 ↔ byte 7, byte 1 ↔ byte 6, etc.). No status fields are affected. This is a Base category instruction with no privilege requirements.
Operation
RT ← BYTESWAP64(RA)
Programming Note
The brd instruction is useful for reversing the byte order of a doubleword in a register, which can be necessary for data format conversion between big-endian and little-endian systems. Ensure that the source register (RA) contains a valid doubleword value to avoid undefined behavior. This operation does not require any special privileges or alignment considerations.