REV8
Byte Reverse
REV8 rd, rs1
Reverses the order of bytes in a register (Endian swap).
Encoding
Binary Layout
011010111000
31:20
rs1
19:15
101
14:12
rd
11:7
0010011
6:0
Operands
-
rd
Destination register (integer) -
rs1
Source
Example
REV8 x10, x11
// Converts Big-Endian to Little-Endian.
Related
Across architectures
Byte Swap (Endianness Reversal) : how x86, ARM, RISC-V, and PowerISA each do this.
More in Zbb
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
REV8 reverses the byte order of rs1 (byte-swap / endianness conversion), writing the result to rd.
Operation
R[rd] = Byteswap(R[rs1]);