
Ask HN: How to add POPCNT to the next RISC-V base or “C” set? - ncmncm
RISC-V is an important development, but its academic roots show in its poor bit-manipulation capabilities. The Bitmanip extension, while an impressive effort, has languished, and in any case will not be implemented in most chips even if ever adopted, as it appears huge, and any particular application needs only a subset of it.<p>A huge part of the value of the Bitmanip extension would be provided by a single, minimal POPCNT instruction. How does one go about getting that into the next release of the base or &quot;C&quot; compressed instruction set? Is there any possibility of getting it into  &quot;C&quot; compressed but not base set? Of Bitmanip claiming any part of the &quot;C&quot; code space?
======
childintime
Agreed on the sentiment.

There is zero chance of getting it into the base, C or even M sets, as they
have existing implementations. But maybe a lone Z (without the usual lowercase
letters) could mean just this instruction.

I found this to be a helpful discussion:
[https://www.embecosm.com/2019/10/22/gcc-risc-v-bit-
manipulat...](https://www.embecosm.com/2019/10/22/gcc-risc-v-bit-manipulation-
extension/)

