Skip to content

Comment on Reversing Bits in C

Comments

That’s one mathematical operation, but a large number of CPU instructions. CPU instructions are what matter here, though, as we see, not as much as cache coherency.

I thought it was also a single CPU instruction, but multiple clock cycles.

It's not a single hardware instruction on a 32-bit CPU, I believe is the point.

A lot of CPUs don't have a division instruction at all, let alone 64 bit division.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.