cpop

Counts the number of 1's (i.e., set bits) in the source register. .Software Hint [NOTE] ---- This operations is known as population count, popcount, sideways sum, bit summation, or Hamming weight. The GCC builtin function `__builtin_popcount (unsigned int x)` is implemented by cpop on RV32 and by cpopw on RV64. The GCC builtin function `__builtin_popcountl (unsigned long x)` for LP64 is implemented by cpop on RV64. ----

Synopsis

cpop xd, xs1

Encoding

Type:

067111214151920310010011xd001xs1011000000010
funct7: 0110000
funct3: 001
opcode: 0010011

RISC-V Instruction Encoder/Decoder

open cpop in rvcodecjs

Availability