3 ms·
ARM NEON includes it as VCNT: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489h/CIHCFDBJ.html http://infocenter.arm.com/help/index.jsp?topic=
by vaibhavsagar 7y ago
ARM NEON includes it as VCNT: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489h/CIHCFDBJ.html http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc....
- saagarjha 7y agoHuh, it looks like that only works on 1-byte values? That’s an interesting choice.
- m0zg 7y agoWorse, it's a fertile ground for "interesting" bugs, because VADDV (which sum-reduces the result) reduces into an 8 bit uint. So if you e.g. accumulate two or more quadword VCNTs into a uint8x16_t and then VADDV it, you could end up with something other than the actual overall bit count (because 2 quadwords can have _256_ bits set). Same with accumulating 8 or more VADDVs, except now individual bytes could wrap around if you don't widen in between.