Skip to content
Unverified Commit 55ca8d7a authored by Xiao Wang's avatar Xiao Wang Committed by Palmer Dabbelt
Browse files

riscv: Optimize hweight API with Zbb extension



The Hamming Weight of a number is the total number of bits set in it, so
the cpop/cpopw instruction from Zbb extension can be used to accelerate
hweight() API.

Signed-off-by: default avatarXiao Wang <xiao.w.wang@intel.com>
Reviewed-by: default avatarCharlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231112095244.4015351-1-xiao.w.wang@intel.com
Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent c4db7ff7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment