4 ms·
It's tragic that all these chips are coming out with no POPCOUNT instruction, held hostage by the unfinished B extension. We really need to get POPCOUNT into t
by ncmncm 6y ago
It's tragic that all these chips are coming out with no POPCOUNT instruction, held hostage by the unfinished B extension.
We really need to get POPCOUNT into the base (at least) 64-bit core set.
- brucehoult 6y agoA number of companies have asked for popcount to NOT be included in the base spec for B (certainly Zbb for embedded), because of the expense of implementing it vs the relatively small speedup it givesfor quite specialized use-cases. 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.
- ncmncm 6y agoA "number of companies" have asked to have the instruction set degraded because they have code that fails to use it? Ignorance, or corruption?
- fulafel 6y agoWhy popcount?
- PeCaN 6y agopopcount is extremely useful in a lot of algorithms, from RSA to chess engines to sparse arrays and tries it's honestly pretty baffling that RISC-V doesnt have it (perils of design-by-academia)
- fulafel 6y agoThe RISC way is to prove the exception is worth it. There are a lot of possible specialized instructions that are useful for some workloads.
- PeCaN 6y agoARM has it. DEC Alpha had it (before x86, even). I get that there are a lot of narrow-use instructions but popcount is a pretty well-known and common operation.
- fulafel 6y agoIn the Alpha case it was a very late addition, in the last widely shipping version of the chip and IIRC was speculated to be part of some supercomputer/classified use case. ARM has a history of having quirky un-RISCy instructions. (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)
- ncmncm 6y agoLate addition is more indicative of value than appearing in first releases. People guess about the base instruction set, but additions happen only in response to high demand.
- ncmncm 6y agoSeriously? 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.