12 #include "../stdafx.h" 15 #include "../safeguards.h" 18 0, 0, 1, 0, 2, 0, 1, 0,
19 3, 0, 1, 0, 2, 0, 1, 0,
20 4, 0, 1, 0, 2, 0, 1, 0,
21 3, 0, 1, 0, 2, 0, 1, 0,
22 5, 0, 1, 0, 2, 0, 1, 0,
23 3, 0, 1, 0, 2, 0, 1, 0,
24 4, 0, 1, 0, 2, 0, 1, 0,
25 3, 0, 1, 0, 2, 0, 1, 0,
47 if ((x & 0x0000ffff) == 0) { x >>= 16; pos += 16; }
48 if ((x & 0x000000ff) == 0) { x >>= 8; pos += 8; }
49 if ((x & 0x0000000f) == 0) { x >>= 4; pos += 4; }
50 if ((x & 0x00000003) == 0) { x >>= 2; pos += 2; }
51 if ((x & 0x00000001) == 0) { pos += 1; }
73 if ((x & 0xffffffff00000000ULL) != 0) { x >>= 32; pos += 32; }
74 if ((x & 0x00000000ffff0000ULL) != 0) { x >>= 16; pos += 16; }
75 if ((x & 0x000000000000ff00ULL) != 0) { x >>= 8; pos += 8; }
76 if ((x & 0x00000000000000f0ULL) != 0) { x >>= 4; pos += 4; }
77 if ((x & 0x000000000000000cULL) != 0) { x >>= 2; pos += 2; }
78 if ((x & 0x0000000000000002ULL) != 0) { pos += 1; }
Functions related to bit mathematics.
const uint8 _ffb_64[64]
Lookup table to check which bit is set in a 6 bit variable.
uint8 FindLastBit(uint64 x)
Search the last set bit in a 64 bit variable.
uint8 FindFirstBit(uint32 x)
Search the first set bit in a 32 bit variable.