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

◆ LeadingZeroCount() [1/2]

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

Definition at line 131 of file BitOperations.cs.

132 {
133 if (Lzcnt.IsSupported)
134 {
135 return (int)Lzcnt.LeadingZeroCount(value);
136 }
138 {
139 }
140 if (value == 0)
141 {
142 return 32;
143 }
145 {
146 return (int)(0x1F ^ X86Base.BitScanReverse(value));
147 }
148 return 0x1F ^ Log2SoftwareFallback(value);
149 }
static int Log2SoftwareFallback(uint value)
static uint LeadingZeroCount(uint value)
Definition Lzcnt.cs:22
static uint BitScanReverse(uint value)
Definition X86Base.cs:35

References System.Runtime.Intrinsics.X86.X86Base.BitScanReverse(), System.Runtime.Intrinsics.Arm.ArmBase.IsSupported, System.Runtime.Intrinsics.X86.Lzcnt.IsSupported, System.Runtime.Intrinsics.X86.X86Base.IsSupported, System.Runtime.Intrinsics.X86.Lzcnt.LeadingZeroCount(), System.Numerics.BitOperations.Log2SoftwareFallback(), and System.value.

Referenced by System.Number.BigInteger.CountSignificantBits(), System.Number.BigInteger.CountSignificantBits(), System.Number.BigInteger.DivRem(), System.Numerics.BigInteger.GetBitLength(), System.Byte.LeadingZeroCount(), System.Char.LeadingZeroCount(), System.Int32.LeadingZeroCount(), System.Int64.LeadingZeroCount(), System.IntPtr.LeadingZeroCount(), System.UIntPtr.LeadingZeroCount(), System.SByte.LeadingZeroCount(), System.Int16.LeadingZeroCount(), System.UInt32.LeadingZeroCount(), System.Numerics.BitOperations.LeadingZeroCount(), System.UInt64.LeadingZeroCount(), System.UInt16.LeadingZeroCount(), System.Number.DiyFp.Normalize(), System.Net.Http.QPack.QPackDecoder.OnByte(), System.Net.Http.HPack.HPackDecoder.Parse(), System.Numerics.BitOperations.RoundUpToPowerOf2(), System.Numerics.BitOperations.RoundUpToPowerOf2(), System.Decimal.DecCalc.ScaleResult(), System.Net.Http.HPack.IntegerDecoder.TryDecode(), System.Decimal.DecCalc.VarDecDiv(), and System.Decimal.DecCalc.VarDecModFull().