RISC-V Evolving to Address Supercomputers and AI
tomshardware.com
tomshardware.com
It is hard to understand how it could have been omitted.
> It is hard to understand how it could have been omitted.
This has not been omitted at all. The spec of the bitmanip extension, which contains the popcount instruction among others, has been around for a long time.
> If it could be evolved to have POPCOUNT
The goal of the HPC group is clearly not to add this type of extension. It focuses on the software and hardware requirements to enable the use of RISC-V for HPC. So it will focus on compilers and libraries used for high performance and possibly some ISA extension like the SIMD one or the crypto acceleration one.
But you'll probably be happy to know that there's actually some movement around the bitmanip extension right now. The spec 1.0 is under review and we can expect a freeze of this extension soon. And this extension is split into 4 sub-extensions that can be taken individually.
Is there a better source of information than the github page to know the development status of an extension?
> But really BitManip has far less room for disagreement than the Vector extension
Yes I've heard lots of criticism about the V extension.
If you start with a word in a GPR and want to compute its popcount into another GPR, you need to move the GPR into a vector register, do the CNT, do the horizontal sum, and move the result back into a GPR.
It's been a while since I did the test, but I think the latency I measured on the Apple M1 perf cores (Firestorm) for that instruction sequence was around 15 cycles. [1] Compare that to POPCNT being 3 cycles on Intel and it really hurts for latency-sensitive uses of word popcount. However, CNT is great for doing large reductions since you can do 32 rounds of CNT + vector add before the bytewise counters can overflow, so you can amortize away the cost of the horizontal reduction. (People end up doing similar things on x86 for large streaming popcount calculations.)
A lot of my micro-optimized code relies on low-latency word popcount, so I selfishly want every processor to have an Intel-style popcount. :)
[1] You can actually beat the latency of that very easily with an L1-resident byte popcount lookup table + sum reduction. This table is only 256B, so it's very practical. You can shave off 1-2 cycles of latency by going to a halfword popcount lookup table, which is 64KB. That kind of cache hogging will perform better in microbenchmarks than in real applications but with the M1's large L1 cache of 128KB per core it might be a net win if you have a tight loop that's heavily affected by popcount latency.
The Zbc BitManip extension contains popcount (and also count leading and trailing zeros) and will be ratified before the end of summer.
It is rare for popcount to complete in one cycle on other systems, and so it is mystifying that you would even bring it up. Other core operations take more than one cycle.
You clearly misunderstand the concept of a modular ISA. RISC-V does not only target high performance. It targets simple scalar microcontrollers, general purpose superscalar machines, and specialized acceleration (Except specific encoding like VLIW for now).
Each of these domains needs a slightly different ISA, and a modular ISA like RISC-V can aggregate all this by providing several ISA extensions. Then, for each domain, we must select an appropriate set of extensions.
And bitmanip is not necessary for all domains.