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

◆ PopCount() [1/2]

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

Definition at line 256 of file BitOperations.cs.

257 {
259 {
260 return (int)Popcnt.PopCount(value);
261 }
263 {
264 }
265 return SoftwareFallback(value);
266 static int SoftwareFallback(uint value)
267 {
268 value -= (value >> 1) & 0x55555555;
269 value = (value & 0x33333333) + ((value >> 2) & 0x33333333);
270 value = ((value + (value >> 4)) & 0xF0F0F0F) * 16843009 >> 24;
271 return (int)value;
272 }
273 }
static uint PopCount(uint value)
Definition Popcnt.cs:22

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

Referenced by System.Collections.Specialized.BitVector32.CreateSectionHelper(), System.Text.Unicode.Utf16Utility.GetPointerToFirstInvalidChar(), System.Diagnostics.Tracing.EventProvider.GetSessionInfoCallback(), System.Numerics.BitOperations.Log2Ceiling(), System.Numerics.BitOperations.Log2Ceiling(), System.Byte.PopCount(), System.Char.PopCount(), System.Int32.PopCount(), System.Int64.PopCount(), System.IntPtr.PopCount(), System.UIntPtr.PopCount(), System.SByte.PopCount(), System.Int16.PopCount(), System.UInt32.PopCount(), System.UInt64.PopCount(), and System.UInt16.PopCount().