4 ms·
Compilers won't do multiplication by power of two to bit shift for you ? I remember reading in ~2000: the only thing writing a<<2 instead of a/4 will do is make
by makapuf 7mo ago
Compilers won't do multiplication by power of two to bit shift for you ? I remember reading in ~2000: the only thing writing a<<2 instead of a/4 will do is make your compiler yawn
- zekica 7mo agoEven gcc's -O0 will do the bitshift, but even dividing with 5 on x86_64 will not do idiv: imul rdx, rdx, 1717986919 shr rdx, 32 sar edx sar eax, 31 sub edx, eax mov eax, edx