钱老师曾经讲过的:
https://bbs.pediy.com/thread-116974.htm
除法转乘法:
除以2的情况:
Release
libnative_lib.so:F3504F10 00 EB D0 70 ADD.W R0, R0, R0,LSR#31 //r0右移31位得到1 r0=r0+1 libnative_lib.so:F3504F14 40 10 ASRS R0, R0, #1 //算术右移1位,效果等同于 /2 libnative_lib.so:F3504F16 70 47 BX LR
imul rsi, uNum, 613566757 //除以7的情况 shr rsi, 20h. //2^32 /613566757 = 6.99 =7所以这里是除以7