Day 11 of Advent of Compiler Optimisations!

A clever loop that counts set bits using the "clear bottom bit" trick: value &= value - 1. Works great, generates tight assembly. But change one compiler flag to target a slightly newer CPU and something extraordinary happens to your loop. The compiler spots a pattern you didn't even know was there. What replaces your careful bit manipulation?

Read more: https://xania.org/202512/11-pop-goes-the-weasel-er-count
Watch: https://youtu.be/Hu0vu1tpZnc

#AoCO2025

@mattgodbolt i'm banned off your website for some reason

@tauon same.

@mattgodbolt are you blocking Hetzner IP ranges or something broke?

@mo @tauon sorry I typod something in my deploy scripts...

@mattgodbolt last picture[1] still returns AccessDenied, but other parts of the page loads fine, tnx

[1] https://xania.org/202512/11-popcount-clang-opt.png

@tauon

@mo @tauon thanks! On it! I tested this stuff haha but until you go live it's always a crapshoot
@mo @tauon oops
@mo @tauon fixed now. And my release scripts updated