cpopw

Counts the number of 1's (i.e., set bits) in the least-significant word of 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

cpopw xd, xs1

Encoding

Type:

067111214151920310011011xd001xs1011000000010
funct7: 0110000
funct3: 001
opcode: 0011011

RISC-V Instruction Encoder/Decoder

open cpopw in rvcodecjs

Availability