It is a familiar fact that when dividing integers by a power of two, a good compiler will strength-reduce this to bit shift.
For example:
int main(int argc, char **argv) {
return argc/2;
}
Clang -O2 compiles this to:
movl %ecx, %eax
shrl $31, %eax
addl %ecx, %eax
sarl %eax
retq
It is worth noting that while this sequence of instructions is much faster than an actual divide instruction, it is not just a single bit shift as one would hope. Presumably that is because typical CPUs, along with C, ended up settling on truncating division (quotient rounds towards zero), and this happens not to exactly match arithmetic right shift (and the strength reduction is required to exactly preserve the semantics).
Which flavor of signed integer division would exactly match arithmetic right shift?