Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PopCount() [2/2]

static int System.Numerics.BitOperations.PopCount ( ulong value)
inlinestatic

Definition at line 278 of file BitOperations.cs.

279 {
281 {
282 return (int)Popcnt.X64.PopCount(value);
283 }
285 {
286 }
287 return SoftwareFallback(value);
288 static int SoftwareFallback(ulong value)
289 {
290 value -= (value >> 1) & 0x5555555555555555L;
291 value = (value & 0x3333333333333333L) + ((value >> 2) & 0x3333333333333333L);
292 value = ((value + (value >> 4)) & 0xF0F0F0F0F0F0F0FL) * 72340172838076673L >> 56;
293 return (int)value;
294 }
295 }
static ulong PopCount(ulong value)
Definition Popcnt.cs:14

References System.Runtime.Intrinsics.Arm.AdvSimd.Arm64.IsSupported, System.Runtime.Intrinsics.X86.Popcnt.X64.IsSupported, System.L, System.Runtime.Intrinsics.X86.Popcnt.X64.PopCount(), and System.value.