ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

rev8

T1 riscv bitmanip insn
Byte-reverse register (RV64 encoding)
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Zbb, Zbkb, Zkt-DIT
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsZbb, Zbkb, Zkt-DIT

Summary

Reverses the order of the bytes in xs1.

Syntax / Encoding

rev8 xd, xs1 | 011010011000xxxxx101xxxxx0010011 (mask=0xfff0707f match=0x69805013)

Binary Encodings (2)

WidthFormatBit PatternMask / Match
32RV32011010011000xxxxx101xxxxx00100110xfff0707f / 0x69805013
32RV64011010111000xxxxx101xxxxx00100110xfff0707f / 0x6b805013

Operands

NameDescription
xs1bits [19:15]
xdbits [11:7]

Reference Notes

Reverses the order of the bytes in xs1.

[NOTE]
The rev8 mnemonic corresponds to different instruction encodings in RV32 and RV64.

[NOTE]
The byte-reverse operation is only available for the full register width. To emulate word-sized
and halfword-sized byte-reversal, perform a `rev8 xd,xs1` followed by a `srai xd,xd,K`, where K
is XLEN-32 and XLEN-16, respectively.