Is a logical right shift by a power of 2 faster in AVR?
Let’s look at the datasheet: http://atmel.com/dyn/resources/prod_documents/8271S.pdf As far as I can see, the ASR (arithmetic shift right) always shifts by one bit and cannot take the number of bits to shift; it takes one cycle to execute. Therefore, shifting right by n bits will take n cycles. Powers of two behave just the same as … Read more