Hacker News new | ask | show | jobs
by magicalhippo 2241 days ago
> it just intuitively seems like moving a bunch of bits over by 1 should be faster than dealing with xor and carries

Yes, a fixed shift-by-one unit would be much simpler than an adder. But many (most?) CPUs that supports shifting have generic shift units, where the number of bits to shift varies, and that makes them much more complex.

1 comments

Barrel shifters are still frequently omitted from microcontrollers. Primarily because of their size.
Right, I was thinking mostly of "application-level" CPUs capable of running Android.