23 return mask | (1ULL << bit);
32 return mask & (1ULL << bit);
41 return mask | (1 << bit);
50 return mask & (1 << bit);
59 return mask | (1 << bit);
68 return mask & (1 << bit);
77 return mask | (1LL << bit);
86 return mask & (1LL << bit);
95 return mask | (1 << bit);
104 return mask & (1 << bit);
113 return mask | (1 << bit);
122 return mask & (1 << bit);
131 i = i - ((i >> 1) & 0x55555555);
132 i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
133 return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
144 s ^= h(v) + 0x9e3779b9 + (s << 6) + (s >> 2);
153 return _mm_popcnt_u32(value);
162 return _mm_popcnt_u64(value);
173 _BitScanForward(&count, value);
175 int count = __builtin_ctz(value);
188 _BitScanForward64(&count, value);
190 int count = __builtin_ctz(value);
203 _BitScanReverse(&count, value);
205 int count = __builtin_clz(value);
218 _BitScanReverse64(&count, value);
220 int count = __builtin_clz(value);
231 uint mask = value & ~((1 << bit) - 1);
234 _BitScanForward(&count, mask);
236 int count = __builtin_ctz(mask);
238 return mask ? count : 0xFFFFFFFF;
248 uint usageFlags = mask;
250 while (usageFlags != 0x0 && flagIndex < numEntries)
252 if (usageFlags & (1 << flagIndex))
254 ret |= table[flagIndex];
256 usageFlags &= ~(1 << flagIndex);
A pinned array is an array which manages its own virtual memory.
Definition String.cs:6
uint LastOne(uint value)
Definition bit.h:199
constexpr uint64 SetBit(uint64 mask, uint8 bit)
Definition bit.h:21
constexpr bool HasBit(uint64 mask, uint8 bit)
Definition bit.h:30
uint BitmaskConvert(uint mask, const uint *table, const uint numEntries=0xFFFFFFFF)
Definition bit.h:245
uint Lsb(uint value, byte bit)
Definition bit.h:229
uint FirstOne(uint value)
Definition bit.h:169
uint PopCnt(uint value)
Definition bit.h:151
constexpr uint32 CountBits(uint32 i)
Definition bit.h:129
void HashCombine(uint32_t &s, const T &v)
Combine hashes.
Definition bit.h:141
uint8_t uint8
Definition types.h:42
int64_t int64
Definition types.h:37
unsigned int uint
Definition types.h:31
int16_t int16
Definition types.h:41
int32_t int32
Definition types.h:39
uint64_t uint64
Definition types.h:36
uint16_t uint16
Definition types.h:40
uint32_t uint32
Definition types.h:38