asm ("bsrl %1, %0" : "=r" (position) : "r" (number));One way you could implement the same operation in C is using this loop:
long i; for (i = (number >> 1), position = 0; i != 0; ++position) i >>= 1;
$ gcc -O2 -o bit-pos-loop bit-pos-loop.c $ gcc -O2 -o bit-pos-asm bit-pos-asm.c $ time ./bit-pos-loop 250000000 $ time ./bit-pos-asm 250000000