Finds the least significant non-zero bit in n.
| 919 | #if defined(__AVX2__) |
| 920 | // Finds the least significant non-zero bit in n. |
| 921 | static int FindLSBSet(uint32_t n) { |
| 922 | DCHECK_NE(n, 0); |
| 923 | #if defined(__GNUC__) |
| 924 | return __builtin_ctz(n); |
| 925 | #elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) |
| 926 | unsigned long c; |
| 927 | _BitScanForward(&c, n); |
| 928 | return static_cast<int>(c); |
| 929 | #else |
| 930 | int c = 31; |
| 931 | for (int shift = 1 << 4; shift != 0; shift >>= 1) { |
| 932 | uint32_t word = n << shift; |
| 933 | if (word != 0) { |
| 934 | n = word; |
| 935 | c -= shift; |
| 936 | } |
| 937 | } |
| 938 | return c; |
| 939 | #endif |
| 940 | } |
| 941 | #endif |
| 942 | |
| 943 | const void* Prog::PrefixAccel_FrontAndBack(const void* data, size_t size) { |
no outgoing calls
no test coverage detected