brd
Byte-Reverse Doubleword
Reverses the bytes in a doubleword.
Details
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.
Pseudocode 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.
Example
Encoding
Operands
-
RT
Target General Purpose Register -
RA
Source General Purpose Register