49 references to LeadingZeroCount
ILCompiler.Compiler (4)
Compiler\ObjectWriter\Eabi\EabiUnwindConverter.cs (4)
262int leadingZeros = BitOperations.LeadingZeroCount(mask); 263int bitRunLength = BitOperations.LeadingZeroCount(~(mask << leadingZeros)); 275int leadingZeros = BitOperations.LeadingZeroCount(mask); 276int bitRunLength = BitOperations.LeadingZeroCount(~(mask << leadingZeros));
ILCompiler.MetadataTransform (1)
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.cs (1)
1923return (sizeof(uint) * 8) - BitOperations.LeadingZeroCount(x);
ILCompiler.ReadyToRun (3)
Compiler\DependencyAnalysis\ReadyToRun\DebugInfoTableNode.cs (2)
161int bitWidthForNativeDelta = Math.Max(1, 32 - System.Numerics.BitOperations.LeadingZeroCount(maxNativeDelta)); 162int bitWidthForILOffset = Math.Max(1, 32 - System.Numerics.BitOperations.LeadingZeroCount(maxILValue));
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.cs (1)
1923return (sizeof(uint) * 8) - BitOperations.LeadingZeroCount(x);
Microsoft.AspNetCore.Antiforgery (1)
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (1)
17return ((31 - System.Numerics.BitOperations.LeadingZeroCount(value | 1)) / 7) + 1;
Microsoft.AspNetCore.DataProtection (1)
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (1)
17return ((31 - System.Numerics.BitOperations.LeadingZeroCount(value | 1)) / 7) + 1;
Microsoft.AspNetCore.Server.Kestrel.Core (3)
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
319switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\aspnetcore\src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackDecoder.cs (1)
434switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
System.Net.Http (3)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (1)
319switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (1)
434switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
System.Private.CoreLib (28)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
276public static byte LeadingZeroCount(byte value) => (byte)(BitOperations.LeadingZeroCount(value) - 24);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1230static char IBinaryInteger<char>.LeadingZeroCount(char value) => (char)(BitOperations.LeadingZeroCount(value) - 16);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (3)
613newScale -= BitOperations.LeadingZeroCount(result[hiRes]); 2010curScale = BitOperations.LeadingZeroCount(tmp); 2298int shift = BitOperations.LeadingZeroCount(tmp);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (1)
1138int shiftDist = BitOperations.LeadingZeroCount(sig) - 16 - 5;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
279public static short LeadingZeroCount(short value) => (short)(BitOperations.LeadingZeroCount((ushort)value) - 16);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
295public static int LeadingZeroCount(int value) => BitOperations.LeadingZeroCount((uint)value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MathF.cs (1)
211return float.MinExponent - (BitOperations.LeadingZeroCount(x.TrailingSignificand) - float.BiasedExponentLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BitOperations.cs (3)
102return (uint)(0x1_0000_0000ul >> LeadingZeroCount(value - 1)); 246return 32 + LeadingZeroCount((uint)value); 249return LeadingZeroCount(hi);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (1)
4381return 31 - BitOperations.LeadingZeroCount(vector.ExtractMostSignificantBits());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (1)
4290return 31 - BitOperations.LeadingZeroCount(vector.ExtractMostSignificantBits());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
4500return (Vector64<T>.Count - 1) - AdvSimdFixupBitCount<T>(BitOperations.LeadingZeroCount(AdvSimdExtractBitMask(vector))); 4504return 31 - BitOperations.LeadingZeroCount(vector.ExtractMostSignificantBits());
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
282public static sbyte LeadingZeroCount(sbyte value) => (sbyte)(BitOperations.LeadingZeroCount((byte)value) - 24);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMap.cs (2)
891index = 31 - BitOperations.LeadingZeroCount(mask); 913index = 31 - BitOperations.LeadingZeroCount(mask);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Byte.cs (2)
372int highestSetBitIndex = 31 - BitOperations.LeadingZeroCount(mask); 421int highestSetBitIndex = 31 - BitOperations.LeadingZeroCount(mask);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Char.cs (2)
392int bitPos = 30 - BitOperations.LeadingZeroCount(mask); 442int bitPos = 30 - BitOperations.LeadingZeroCount(mask);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (2)
3741int index = 31 - BitOperations.LeadingZeroCount(notEqualsElements); // 31 = 32 (bits in Int32) - 1 (indexing from zero) 3749int index = 31 - BitOperations.LeadingZeroCount(notEqualsElements); // 31 = 32 (bits in Int32) - 1 (indexing from zero)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
273public static ushort LeadingZeroCount(ushort value) => (ushort)(BitOperations.LeadingZeroCount(value) - 16);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (2)
290public static uint LeadingZeroCount(uint value) => (uint)BitOperations.LeadingZeroCount(value); 437int IBinaryInteger<uint>.GetShortestBitLength() => (sizeof(uint) * 8) - BitOperations.LeadingZeroCount(m_value);
System.Runtime.Numerics (5)
System\Numerics\BigInteger.cs (4)
1030c = BitOperations.LeadingZeroCount((uint)h); 2122int z = BitOperations.LeadingZeroCount((uint)h); 3796return value >= 0 ? 32 - BitOperations.LeadingZeroCount((uint)value) : 33 - BitOperations.LeadingZeroCount(~(uint)value);
System\Numerics\BigIntegerCalculator.GcdInv.cs (1)
332int z = BitOperations.LeadingZeroCount((uint)xh);