News for hackers. Stuff that matters.
Re:The NSA Instruction (2019) by ynik on Monday June 14, 2021 @06:41AM (#27501106)
C++20 added std::popcount() in the new header <bit>

If you haven't told it that the target ISA has the POPCNT instruction, std::popcount() on MSVC will use runtime feature detection: https://godbolt.org/z/qab4Mjv1v

Re:The NSA Instruction (2019) by ncmncm on Monday June 14, 2021 @06:21PM (#27509085)
Curiously, for std::bitset<32>(i).count(), MSVC (VS 16.9) still generates a loop, regardless.