3 ms·
Was your problem perhaps because of the hardware bug where popcount unnecessarily stalled on the output as if it were an input? Later compilers added an explic
by o11c 3y ago
Was your problem perhaps because of the hardware bug where popcount unnecessarily stalled on the output as if it were an input?
Later compilers added an explicit zero of the output to work around this issue.
- Tommah 3y agoInteresting... I hadn't heard about that bug. Here's my current theory about what was happening. Back then, I was using an Intel Atom notebook, and some research tells me that the early Atom processors don't have the popcount instruction. This would make GCC fall back to its implementation. I looked at GCC's current implementation, and it's using a 256-entry lookup table. My implementation was faster... so either (1) I was using a larger lookup table than I remembered, maybe 65536-entry, or (2) GCC was doing something different back then.