We really need to get POPCOUNT into the base (at least) 64-bit core set.
We really need to get POPCOUNT into the base (at least) 64-bit core set.
Of course popcount will have an opcode allocated and binutils and gcc will (already do) know how to use it if it is present, so anyone who wants/needs it can implement it.
Ignorance, or corruption?
it's honestly pretty baffling that RISC-V doesnt have it (perils of design-by-academia)
I get that there are a lot of narrow-use instructions but popcount is a pretty well-known and common operation.
(edit: also it seems that ARM has just cnt.v8 for counting 8-bit lanes in NEON and no 64-bit scalar instruction version, interesting. Being part of NEON also means it's an optional part on ARM)
Because it provides order-of magnitude speed improvements for numerous algorithms. Because it is the basis for integer log-base-2.
If you don't know what popcount is good for, or badly miss it where it is lacking, your education has suffered. That is remediable.