But otherwise, yes.
I spent quite a while optimizing GCC's bitmap operations years ago, including implementing some new sparse bitmap types, and the sparse bitmap types i implemented ended up dependent on the speed of popcnt and friends, so yes.
Your algorithm will report a match at "bccd" since the "a" wasn't removed from the bitmask.
Unfortunately few other computers have included it before Cray 1, which made it well known, under the current name.
It is probably just a legend though.
The legend you're probably misremembering is the one where the NSA approached Seymor Cray at CDC while he was designing the 6600 super and 'suggested' that if he included a popcnt instruction in the ISA, the NSA would certainly look favorably on purchasing some. He did and they did (quite a few). This story is also possibly apocryphal.
Ok. Why??????????????
@gpderetta is correct at least in quoting hacker's delight where it was also said to be rumoured the NSA wanted popcount but it was unclear to HD's author why they wanted it.
Cryptography has advanced since then - and I'm not an expert - but there may still be statistical weaknesses that could be found by counting bits?
It accelerates the calculation of the Hamming weight of a vector or string. Hamming weight is useful lots of places in crypto, like helping frequency analysis, or observed power consumption attacks against crypto systems. It's useful in many other disciplines as well.
I would do it by storing the product of the counts; divide by the outgoing count before decrementing, multiply by the incoming count after incrementing. If the product is one they're all unique. Scaling should be comparable to POPCNT.
Doesn't B have a POPCNT?
B is mandatory in RVA22.
https://github.com/riscv/riscv-bitmanip/blob/main/bitmanip/i...
https://www.sifive.com/cores/performance-p650
Heres another:
https://www.andestech.com/en/2022/12/08/andes-technology-unv...
I expect all future Linux cores to have it
All RVA22 profile cores will, as RVA22 requires B extension.
>Sifive p650 will have it
Current versions of U74 also have it. And a U74 with B is already shipping in VisionFive 2.