mov edx, edi shr edx or edx, edi mov eax, edx shr eax, 2 or eax, edx mov edx, eax shr edx, 4 or edx, eax mov eax, edx shr eax, 8 or eax, edx mov edx, eax shr edx, 16 or edx, eax ;上面的代码将ed的最高有效位复制到后面所有低位,即形成1111111之类的数字 imul eax, edx, 79355661 ; 0x4badf0d shr eax, 26 mov eax, DWORD PTR v[0+rax*4] ret
int v[64]= { -1,31, 8,30, -1, 7,-1,-1, 29,-1,26, 6, -1,-1, 2,-1, -1,28,-1,-1, -1,19,25,-1, 5,-1,17,-1, 23,14, 1,-1, 9,-1,-1,-1, 27,-1, 3,-1, -1,-1,20,-1, 18,24,15,10, -1,-1, 4,-1, 21,-1,16,11, -1,22,-1,12, 13,-1, 0,-1 };
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!
foolishx https://yurichev.com/blog/de_bruijn/ 看看这个你就懂了。不用谢,我是雷锋