<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>DannyBee</author><text>Well, actually, in this case, no, POPCNT is unnecessary here, since you don&amp;#x27;t actually have to count anything.  you only need to know if the bitmask changed when you added a new character ;)&lt;p&gt;But otherwise, yes.&lt;p&gt;I spent quite a while optimizing GCC&amp;#x27;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.</text><parent_chain><item><author>moloch-hai</author><text>The moral is that POPCNT is critical to zillions of massive optimizations, and omitting it from base instruction sets, as has been done over and over and then later corrected, each time at great expense, is extremely foolish. The latest offender was RISC-V, but the overwhelming majority of x86 code is still compiled to a target version lacking it.</text></item></parent_chain></comment><story><title>A neat XOR trick</title><url>https://www.mattkeeter.com/blog/2022-12-10-xor/</url></story>
<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>gpderetta</author><text>legend say that popcnt was the &amp;quot;NSA&amp;quot; instruction, was heavily used for cryptographic analysis and that was kept out of common instruction sets for a long time to give NSA an advantage.&lt;p&gt;It is probably just a legend though.</text><parent_chain><item><author>moloch-hai</author><text>The moral is that POPCNT is critical to zillions of massive optimizations, and omitting it from base instruction sets, as has been done over and over and then later corrected, each time at great expense, is extremely foolish. The latest offender was RISC-V, but the overwhelming majority of x86 code is still compiled to a target version lacking it.</text></item></parent_chain></comment><story><title>A neat XOR trick</title><url>https://www.mattkeeter.com/blog/2022-12-10-xor/</url></story>