RISC-V ISA Explorer · Bit Manipulation (Zb*)

Zbb: Basic Bitmanip

Ratified 2021-06 · version 1.0.0

Common bit and word operations such as count leading zeros, population count, min/max, rotate and sign extend.

Typical use: Bit counting, min/max and byte swapping

Specification

Open Zbb in the explorer

Dependencies

Required by

Instructions (25)

MnemonicNameEncodingMatchMask
ANDNAND with inverted operand0100000----------111-----01100110x400070330xfe00707f
CLZCount leading zero bits011000000000-----001-----00100110x600010130xfff0707f
CLZWCount leading zero bits in word011000000000-----001-----00110110x6000101b0xfff0707f
CPOPCount set bits011000000010-----001-----00100110x602010130xfff0707f
CPOPWCount set bits in word011000000010-----001-----00110110x6020101b0xfff0707f
CTZCount trailing zero bits011000000001-----001-----00100110x601010130xfff0707f
CTZWCount trailing zero bits in word011000000001-----001-----00110110x6010101b0xfff0707f
MAXMaximum0000101----------110-----01100110xa0060330xfe00707f
MAXUUnsigned maximum0000101----------111-----01100110xa0070330xfe00707f
MINMinimum0000101----------100-----01100110xa0040330xfe00707f
MINUUnsigned minimum0000101----------101-----01100110xa0050330xfe00707f
ORC.BBitware OR-combine, byte granule001010000111-----101-----00100110x287050130xfff0707f
ORNOR with inverted operand0100000----------110-----01100110x400060330xfe00707f
REV8Byte-reverse register (RV64 encoding)011010111000-----101-----00100110x6b8050130xfff0707f
ROLRotate left (Register)0110000----------001-----01100110x600010330xfe00707f
ROLWRotate left word (Register)0110000----------001-----01110110x6000103b0xfe00707f
RORRotate right (Register)0110000----------101-----01100110x600050330xfe00707f
RORIRotate right (Immediate)011000-----------101-----00100110x600050130xfc00707f
RORIWRotate right word (Immediate)0110000----------101-----00110110x6000501b0xfe00707f
RORWRotate right word (Register)0110000----------101-----01110110x6000503b0xfe00707f
SEXT.BSign-extend byte011000000100-----001-----00100110x604010130xfff0707f
SEXT.HSign-extend halfword011000000101-----001-----00100110x605010130xfff0707f
XNORExclusive NOR0100000----------100-----01100110x400040330xfe00707f
ZEXT.HZero-extend halfword000010000000-----100-----01110110x800403b0xfff0707f
ZEXT.H.RV32000010000000-----100-----01100110x80040330xfff0707f