452 references to BitOperations
http2cat (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
IIS.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
IIS.LongTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
IIS.NewHandler.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
IIS.NewShim.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
IISExpress.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
Microsoft.AspNetCore.HttpLogging (17)
W3CLoggingMiddleware.cs (17)
25internal static readonly int _dateIndex = BitOperations.Log2((int)W3CLoggingFields.Date); 26internal static readonly int _timeIndex = BitOperations.Log2((int)W3CLoggingFields.Time); 27internal static readonly int _clientIpIndex = BitOperations.Log2((int)W3CLoggingFields.ClientIpAddress); 28internal static readonly int _userNameIndex = BitOperations.Log2((int)W3CLoggingFields.UserName); 29internal static readonly int _serverNameIndex = BitOperations.Log2((int)W3CLoggingFields.ServerName); 30internal static readonly int _serverIpIndex = BitOperations.Log2((int)W3CLoggingFields.ServerIpAddress); 31internal static readonly int _serverPortIndex = BitOperations.Log2((int)W3CLoggingFields.ServerPort); 32internal static readonly int _methodIndex = BitOperations.Log2((int)W3CLoggingFields.Method); 33internal static readonly int _uriStemIndex = BitOperations.Log2((int)W3CLoggingFields.UriStem); 34internal static readonly int _uriQueryIndex = BitOperations.Log2((int)W3CLoggingFields.UriQuery); 35internal static readonly int _protocolStatusIndex = BitOperations.Log2((int)W3CLoggingFields.ProtocolStatus); 36internal static readonly int _timeTakenIndex = BitOperations.Log2((int)W3CLoggingFields.TimeTaken); 37internal static readonly int _protocolVersionIndex = BitOperations.Log2((int)W3CLoggingFields.ProtocolVersion); 38internal static readonly int _hostIndex = BitOperations.Log2((int)W3CLoggingFields.Host); 39internal static readonly int _userAgentIndex = BitOperations.Log2((int)W3CLoggingFields.UserAgent); 40internal static readonly int _cookieIndex = BitOperations.Log2((int)W3CLoggingFields.Cookie); 41internal static readonly int _refererIndex = BitOperations.Log2((int)W3CLoggingFields.Referer);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
Microsoft.AspNetCore.Server.Kestrel.Core (22)
Internal\Http\HttpHeaders.Generated.cs (17)
2586return (_contentLength.HasValue ? 1 : 0 ) + BitOperations.PopCount((ulong)_bits) + (MaybeUnknown?.Count ?? 0); 8664_next = BitOperations.TrailingZeroCount(_currentBits); 8678? BitOperations.TrailingZeroCount(bits) 10872return (_contentLength.HasValue ? 1 : 0 ) + BitOperations.PopCount((ulong)_bits) + (MaybeUnknown?.Count ?? 0); 14053if(BitOperations.PopCount((ulong)tempBits) > 12) 14813var next = BitOperations.TrailingZeroCount(tempBits); 14840next = BitOperations.TrailingZeroCount(tempBits); 14866next = BitOperations.TrailingZeroCount(tempBits); 14885next = BitOperations.TrailingZeroCount(tempBits); 14967next = BitOperations.TrailingZeroCount(tempBits); 15112next = BitOperations.TrailingZeroCount(tempBits); 15192next = BitOperations.TrailingZeroCount(tempBits); 15500_next = BitOperations.TrailingZeroCount(_currentBits); 15514? BitOperations.TrailingZeroCount(bits) 17169return (_contentLength.HasValue ? 1 : 0 ) + BitOperations.PopCount((ulong)_bits) + (MaybeUnknown?.Count ?? 0); 17486if(BitOperations.PopCount((ulong)tempBits) > 12) 17621_next = BitOperations.TrailingZeroCount(_currentBits);
Internal\Http\HttpResponseTrailers.cs (2)
63_next = _currentBits != 0 ? BitOperations.TrailingZeroCount(_currentBits) : -1; 85_next = _currentBits != 0 ? BitOperations.TrailingZeroCount(_currentBits) : -1;
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
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.
Microsoft.AspNetCore.Shared.Tests (3)
src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
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.Collections (1)
System\Collections\Generic\SortedSet.cs (1)
2014private static int Log2(int value) => BitOperations.Log2((uint)value);
System.Collections.Immutable (22)
System\Collections\Frozen\String\Hashing.cs (22)
34hash2 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ src[0]; 38hash2 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ src[0]; 39hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ src[1]; 43hash2 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ src[0]; 44hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ src[1]; 45hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ src[2]; 49hash1 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ ((uint*)src)[0]; 50hash2 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ ((uint*)src)[1]; 60hash1 = (BitOperations.RotateLeft(hash1, 5) + hash1) ^ ptrUInt32[0]; 61hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ ptrUInt32[1]; 69hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ *ptrChar++; 98hash2 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ (src[0] | LowercaseChar); 102hash2 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ (src[0] | LowercaseChar); 103hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ (src[1] | LowercaseChar); 107hash2 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ (src[0] | LowercaseChar); 108hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ (src[1] | LowercaseChar); 109hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ (src[2] | LowercaseChar); 113hash1 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ (((uint*)src)[0] | LowercaseUInt32); 114hash2 = (BitOperations.RotateLeft(Hash1Start, 5) + Hash1Start) ^ (((uint*)src)[1] | LowercaseUInt32); 124hash1 = (BitOperations.RotateLeft(hash1, 5) + hash1) ^ (ptrUInt32[0] | LowercaseUInt32); 125hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ (ptrUInt32[1] | LowercaseUInt32); 133hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ (*ptrChar | LowercaseUInt32);
System.Collections.Specialized (2)
System\Collections\Specialized\BitVector32.cs (2)
141short offset = (short)(priorOffset + BitOperations.PopCount((uint)(ushort)priorMask)); 147short mask = (short)(BitOperations.RoundUpToPowerOf2((uint)(ushort)maxValue + 1) - 1);
System.IO.Hashing (18)
System\IO\Hashing\XxHash128.cs (1)
263uint combinedh = BitOperations.RotateLeft(BinaryPrimitives.ReverseEndianness(combinedl), 13);
System\IO\Hashing\XxHash32.State.cs (7)
54BitOperations.RotateLeft(_acc1, 1) + 55BitOperations.RotateLeft(_acc2, 7) + 56BitOperations.RotateLeft(_acc3, 12) + 57BitOperations.RotateLeft(_acc4, 18); 63acc = BitOperations.RotateLeft(acc, 13); 79acc = BitOperations.RotateLeft(acc, 17); 89acc = BitOperations.RotateLeft(acc, 11);
System\IO\Hashing\XxHash64.State.cs (8)
73BitOperations.RotateLeft(_acc1, 1) + 74BitOperations.RotateLeft(_acc2, 7) + 75BitOperations.RotateLeft(_acc3, 12) + 76BitOperations.RotateLeft(_acc4, 18); 94acc = BitOperations.RotateLeft(acc, 31); 114acc = BitOperations.RotateLeft(acc, 27); 126acc = BitOperations.RotateLeft(acc, 23); 137acc = BitOperations.RotateLeft(acc, 11);
System\IO\Hashing\XxHashShared.cs (2)
195hash ^= BitOperations.RotateLeft(hash, 49) ^ BitOperations.RotateLeft(hash, 24);
System.Linq.Expressions (1)
System\Dynamic\Utils\CacheDict.cs (1)
44int alignedSize = (int)BitOperations.RoundUpToPowerOf2((uint)size);
System.Net.Http (3)
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (1)
314switch (BitOperations.LeadingZeroCount(b) - 24) // byte 'b' is extended to uint, so will have 24 extra 0s.
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs (1)
71if (BitOperations.LeadingZeroCount((uint)b) <= _m)
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.Net.Security (3)
src\libraries\Common\src\System\Net\Security\MD4.cs (3)
156a = BitOperations.RotateLeft(a, s); 162a = BitOperations.RotateLeft(a, s); 168a = BitOperations.RotateLeft(a, s);
System.Net.WebSockets (2)
System\Net\WebSockets\ManagedWebSocket.cs (2)
1499(int)BitOperations.RotateRight((uint)mask, maskIndex * 8) : 1500(int)BitOperations.RotateLeft((uint)mask, maskIndex * 8);
System.Numerics.Tensors (3)
System\Numerics\Tensors\netcore\TensorPrimitives.IndexOfMax.cs (3)
446BitOperations.TrailingZeroCount(mask.ExtractMostSignificantBits()); 449BitOperations.TrailingZeroCount(mask.ExtractMostSignificantBits()); 452BitOperations.TrailingZeroCount(mask.ExtractMostSignificantBits());
System.Private.CoreLib (300)
src\libraries\Common\src\System\Sha1ForNonSecretPurposes.cs (9)
112_w[i] = BitOperations.RotateLeft(_w[i - 3] ^ _w[i - 8] ^ _w[i - 14] ^ _w[i - 16], 1); 125uint temp = BitOperations.RotateLeft(a, 5) + f + e + k + _w[i]; e = d; d = c; c = BitOperations.RotateLeft(b, 30); b = a; a = temp; 132uint temp = BitOperations.RotateLeft(a, 5) + f + e + k + _w[i]; e = d; d = c; c = BitOperations.RotateLeft(b, 30); b = a; a = temp; 139uint temp = BitOperations.RotateLeft(a, 5) + f + e + k + _w[i]; e = d; d = c; c = BitOperations.RotateLeft(b, 30); b = a; a = temp; 146uint temp = BitOperations.RotateLeft(a, 5) + f + e + k + _w[i]; e = d; d = c; c = BitOperations.RotateLeft(b, 30); b = a; a = temp;
src\libraries\System.Private.CoreLib\src\System\Array.cs (2)
2319IntroSort(left, length + left - 1, 2 * (BitOperations.Log2((uint)length) + 1)); 2536IntroSort(left, length + left - 1, 2 * (BitOperations.Log2((uint)length) + 1));
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (2)
150return BitOperations.RotateRight(value & 0x00FF00FFu, 8) // xx zz 151+ BitOperations.RotateLeft(value & 0xFF00FF00u, 8); // ww yy
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (2)
28uint index = Unsafe.Add(ref MemoryMarshal.GetReference(log2ToPow10), BitOperations.Log2(value)); 114return (BitOperations.Log2(value) >> 2) + 1;
src\libraries\System.Private.CoreLib\src\System\Buffers\Utilities.cs (1)
20return BitOperations.Log2((uint)bufferSize - 1 | 15) - 3;
src\libraries\System.Private.CoreLib\src\System\Byte.cs (5)
282public static byte LeadingZeroCount(byte value) => (byte)(BitOperations.LeadingZeroCount(value) - 24); 285public static byte PopCount(byte value) => (byte)BitOperations.PopCount(value); 294public static byte TrailingZeroCount(byte value) => (byte)(BitOperations.TrailingZeroCount(value << 24) - 24); 412public static bool IsPow2(byte value) => BitOperations.IsPow2((uint)value); 415public static byte Log2(byte value) => (byte)BitOperations.Log2(value);
src\libraries\System.Private.CoreLib\src\System\Char.cs (3)
1163static char IBinaryInteger<char>.LeadingZeroCount(char value) => (char)(BitOperations.LeadingZeroCount(value) - 16); 1166static char IBinaryInteger<char>.PopCount(char value) => (char)BitOperations.PopCount(value); 1175static char IBinaryInteger<char>.TrailingZeroCount(char value) => (char)(BitOperations.TrailingZeroCount(value << 16) - 16);
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (1)
97length = (int)Math.Min(BitOperations.RoundUpToPowerOf2((uint)count), MaxSegmentLength);
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueueSegment.cs (1)
49Debug.Assert(BitOperations.IsPow2(boundedLength), $"Must be a power of 2, got {boundedLength}");
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (4)
127IntroSort(keys, 2 * (BitOperations.Log2((uint)keys.Length) + 1), comparer); 306IntroSort(keys, 2 * (BitOperations.Log2((uint)keys.Length) + 1)); 674IntroSort(keys, values, 2 * (BitOperations.Log2((uint)keys.Length) + 1), comparer); 859IntroSort(keys, values, 2 * (BitOperations.Log2((uint)keys.Length) + 1));
src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (3)
526newScale -= BitOperations.LeadingZeroCount(result[hiRes]); 1979curScale = BitOperations.LeadingZeroCount(tmp); 2260int shift = BitOperations.LeadingZeroCount(tmp);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
5575if (isbitmap && !BitOperations.IsPow2(hexValue))
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (4)
515mask = BitOperations.ResetLowestSetBit(BitOperations.ResetLowestSetBit(mask)); 581mask = BitOperations.ResetLowestSetBit(BitOperations.ResetLowestSetBit(mask));
src\libraries\System.Private.CoreLib\src\System\Half.cs (2)
1107int shiftDist = BitOperations.LeadingZeroCount(sig) - 16 - 5; 1571return MinExponent - (BitOperations.TrailingZeroCount(x.TrailingSignificand) - BiasedExponentLength);
src\libraries\System.Private.CoreLib\src\System\HashCode.cs (6)
271return BitOperations.RotateLeft(hash + input * Prime2, 13) * Prime1; 277return BitOperations.RotateLeft(hash + queuedValue * Prime3, 17) * Prime4; 283return BitOperations.RotateLeft(v1, 1) + BitOperations.RotateLeft(v2, 7) + BitOperations.RotateLeft(v3, 12) + BitOperations.RotateLeft(v4, 18);
src\libraries\System.Private.CoreLib\src\System\Int128.cs (2)
728return 64 + BitOperations.LeadingZeroCount(value._lower); 730return BitOperations.LeadingZeroCount(value._upper);
src\libraries\System.Private.CoreLib\src\System\Int16.cs (5)
285public static short LeadingZeroCount(short value) => (short)(BitOperations.LeadingZeroCount((ushort)value) - 16); 288public static short PopCount(short value) => (short)BitOperations.PopCount((ushort)value); 297public static short TrailingZeroCount(short value) => (byte)(BitOperations.TrailingZeroCount(value << 16) - 16); 509public static bool IsPow2(short value) => BitOperations.IsPow2(value); 518return (short)BitOperations.Log2((ushort)value);
src\libraries\System.Private.CoreLib\src\System\Int32.cs (7)
295public static int LeadingZeroCount(int value) => BitOperations.LeadingZeroCount((uint)value); 299public static int PopCount(int value) => BitOperations.PopCount((uint)value); 303public static int RotateLeft(int value, int rotateAmount) => (int)BitOperations.RotateLeft((uint)value, rotateAmount); 307public static int RotateRight(int value, int rotateAmount) => (int)BitOperations.RotateRight((uint)value, rotateAmount); 311public static int TrailingZeroCount(int value) => BitOperations.TrailingZeroCount(value); 542public static bool IsPow2(int value) => BitOperations.IsPow2(value); 553return BitOperations.Log2((uint)value);
src\libraries\System.Private.CoreLib\src\System\Int64.cs (9)
292public static long LeadingZeroCount(long value) => BitOperations.LeadingZeroCount((ulong)value); 296public static long PopCount(long value) => BitOperations.PopCount((ulong)value); 300public static long RotateLeft(long value, int rotateAmount) => (long)BitOperations.RotateLeft((ulong)value, rotateAmount); 304public static long RotateRight(long value, int rotateAmount) => (long)BitOperations.RotateRight((ulong)value, rotateAmount); 308public static long TrailingZeroCount(long value) => BitOperations.TrailingZeroCount(value); 484return (sizeof(long) * 8) - BitOperations.LeadingZeroCount((ulong)(value)); 488return (sizeof(long) * 8) + 1 - BitOperations.LeadingZeroCount((ulong)(~value)); 539public static bool IsPow2(long value) => BitOperations.IsPow2(value); 550return BitOperations.Log2((ulong)value);
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (9)
303public static nint LeadingZeroCount(nint value) => BitOperations.LeadingZeroCount((nuint)value); 307public static nint PopCount(nint value) => BitOperations.PopCount((nuint)value); 311public static nint RotateLeft(nint value, int rotateAmount) => (nint)BitOperations.RotateLeft((nuint)value, rotateAmount); 315public static nint RotateRight(nint value, int rotateAmount) => (nint)BitOperations.RotateRight((nuint)value, rotateAmount); 319public static nint TrailingZeroCount(nint value) => BitOperations.TrailingZeroCount(value); 495return (sizeof(nint_t) * 8) - BitOperations.LeadingZeroCount((nuint)value); 499return (sizeof(nint_t) * 8) + 1 - BitOperations.LeadingZeroCount((nuint)(~value)); 560public static bool IsPow2(nint value) => BitOperations.IsPow2(value); 571return BitOperations.Log2((nuint)value);
src\libraries\System.Private.CoreLib\src\System\Marvin.cs (5)
207partialResult = BitOperations.RotateLeft(partialResult, 16); 224p0 = BitOperations.RotateLeft(p0, 20); 227p1 = BitOperations.RotateLeft(p1, 9); 230p0 = BitOperations.RotateLeft(p0, 27); 233p1 = BitOperations.RotateLeft(p1, 19);
src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
862return double.MinExponent - (BitOperations.TrailingZeroCount(x.TrailingSignificand) - double.BiasedExponentLength);
src\libraries\System.Private.CoreLib\src\System\MathF.cs (1)
213return float.MinExponent - (BitOperations.TrailingZeroCount(x.TrailingSignificand) - float.BiasedExponentLength);
src\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (3)
424return 32 - (uint)BitOperations.LeadingZeroCount(value); 429return 64 - (uint)BitOperations.LeadingZeroCount(value); 523int shiftLeft = BitOperations.LeadingZeroCount(divHi);
src\libraries\System.Private.CoreLib\src\System\Number.DiyFp.cs (1)
136int lzcnt = BitOperations.LeadingZeroCount(f);
src\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (4)
33mantissaHighBitIdx = (uint)BitOperations.Log2(mantissa); 63mantissaHighBitIdx = (uint)BitOperations.Log2(mantissa); 93mantissaHighBitIdx = (uint)BitOperations.Log2(mantissa); 342uint hiBlockLog2 = (uint)BitOperations.Log2(hiBlock);
src\libraries\System.Private.CoreLib\src\System\Number.NumberToFloatingPointBits.cs (1)
1294int lz = BitOperations.LeadingZeroCount(w);
src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
206if (BitOperations.IsPow2(choices.Length) && choices.Length <= 256)
src\libraries\System.Private.CoreLib\src\System\Random.Net5CompatImpl.cs (2)
63int bits = BitOperations.Log2Ceiling(exclusiveRange); 180int bits = BitOperations.Log2Ceiling(exclusiveRange);
src\libraries\System.Private.CoreLib\src\System\Random.Xoshiro256StarStarImpl.cs (6)
57ulong result = BitOperations.RotateLeft(s1 * 5, 7) * 9; 66s3 = BitOperations.RotateLeft(s3, 45); 144BitOperations.RotateLeft(s1 * 5, 7) * 9); 153s3 = BitOperations.RotateLeft(s3, 45); 160ulong next = BitOperations.RotateLeft(s1 * 5, 7) * 9; 175s3 = BitOperations.RotateLeft(s3, 45);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\CastCache.cs (4)
38Debug.Assert(BitOperations.PopCount((uint)initialCacheSize) == 1 && initialCacheSize > 1); 39Debug.Assert(BitOperations.PopCount((uint)maxCacheSize) == 1 && maxCacheSize >= initialCacheSize); 95ulong hash = BitOperations.RotateLeft((ulong)source, 32) ^ (ulong)target; 253byte shift = (byte)BitOperations.LeadingZeroCount((nuint)(size - 1));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (3)
463Debug.Assert(BitOperations.IsPow2(InitialCapacity)); 486Debug.Assert(BitOperations.IsPow2(buckets.Length)); 689Debug.Assert(BitOperations.IsPow2(newSize));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\GenericCache.cs (3)
75Debug.Assert(BitOperations.PopCount((uint)initialCacheSize) == 1 && initialCacheSize > 1); 76Debug.Assert(BitOperations.PopCount((uint)maxCacheSize) == 1 && maxCacheSize >= initialCacheSize); 233byte shift = (byte)BitOperations.LeadingZeroCount((nuint)(size - 1));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeMemory.Unix.cs (2)
26if (!BitOperations.IsPow2(alignment)) 87if (!BitOperations.IsPow2(alignment))
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128_1.cs (1)
708return 31 - BitOperations.LeadingZeroCount(mask); // 31 = 32 (bits in Int32) - 1 (indexing from zero)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256_1.cs (1)
698return 31 - BitOperations.LeadingZeroCount(mask); // 31 = 32 (bits in Int32) - 1 (indexing from zero)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512_1.cs (1)
698return 63 - BitOperations.LeadingZeroCount(mask); // 63 = 64 (bits in Int64) - 1 (indexing from zero)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64_1.cs (1)
773return 31 - BitOperations.LeadingZeroCount(mask); // 31 = 32 (bits in Int32) - 1 (indexing from zero)
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\X86\X86Base.cs (4)
35/// Its functionality is exposed in the public <see cref="Numerics.BitOperations" /> class. 46/// Its functionality is exposed in the public <see cref="Numerics.BitOperations" /> class. 72/// Its functionality is exposed in the public <see cref="Numerics.BitOperations" /> class. 83/// Its functionality is exposed in the public <see cref="Numerics.BitOperations" /> class.
src\libraries\System.Private.CoreLib\src\System\SByte.cs (5)
288public static sbyte LeadingZeroCount(sbyte value) => (sbyte)(BitOperations.LeadingZeroCount((byte)value) - 24); 291public static sbyte PopCount(sbyte value) => (sbyte)BitOperations.PopCount((byte)value); 300public static sbyte TrailingZeroCount(sbyte value) => (sbyte)(BitOperations.TrailingZeroCount(value << 24) - 24); 470public static bool IsPow2(sbyte value) => BitOperations.IsPow2(value); 479return (sbyte)BitOperations.Log2((byte)value);
src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (8)
1144int offsetInVector = 31 - BitOperations.LeadingZeroCount(mask); 1153int offsetInVector = 31 - BitOperations.LeadingZeroCount(mask); 1175int offsetInVector = 31 - BitOperations.LeadingZeroCount(mask); 1191int offsetInVector = 31 - BitOperations.LeadingZeroCount(mask); 1328int offsetInVector = BitOperations.TrailingZeroCount(mask); 1343int offsetInVector = BitOperations.TrailingZeroCount(mask); 1351int offsetInVector = BitOperations.TrailingZeroCount(mask); 1372int offsetInVector = BitOperations.TrailingZeroCount(mask);
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMap.cs (16)
767index = BitOperations.TrailingZeroCount(mask); 774mask = BitOperations.ResetLowestSetBit(mask); 788index = BitOperations.TrailingZeroCount(mask); 802mask = BitOperations.ResetLowestSetBit(mask); 816index = BitOperations.TrailingZeroCount(mask); 823mask = BitOperations.ResetLowestSetBit(mask); 837index = BitOperations.TrailingZeroCount(mask); 851mask = BitOperations.ResetLowestSetBit(mask); 865index = 31 - BitOperations.LeadingZeroCount(mask); 873mask = BitOperations.FlipBit(mask, index); 887index = 31 - BitOperations.LeadingZeroCount(mask); 890mask = BitOperations.FlipBit(mask, index); 916index = 63 - BitOperations.LeadingZeroCount(mask); 924mask = BitOperations.FlipBit(mask, index); 938index = 63 - BitOperations.LeadingZeroCount(mask); 941mask = BitOperations.FlipBit(mask, index);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBase.cs (12)
543int matchOffset = BitOperations.TrailingZeroCount(resultMask); 558int candidateOffset = BitOperations.TrailingZeroCount(candidateMask); 570candidateMask = BitOperations.ResetLowestSetBit(candidateMask); 574resultMask = BitOperations.ResetLowestSetBit(resultMask); 591int matchOffset = BitOperations.TrailingZeroCount(resultMask); 603int candidateOffset = BitOperations.TrailingZeroCount(candidateMask); 615candidateMask = BitOperations.ResetLowestSetBit(candidateMask); 619resultMask = BitOperations.ResetLowestSetBit(resultMask); 636int matchOffset = BitOperations.TrailingZeroCount(resultMask); 648int candidateOffset = BitOperations.TrailingZeroCount(candidateMask); 660candidateMask = BitOperations.ResetLowestSetBit(candidateMask); 664resultMask = BitOperations.ResetLowestSetBit(resultMask);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesThreeChars.cs (6)
323int bitPos = BitOperations.TrailingZeroCount(mask); 340mask = BitOperations.ResetLowestSetBit(BitOperations.ResetLowestSetBit(mask)); 355int bitPos = BitOperations.TrailingZeroCount(mask); 372mask = BitOperations.ResetLowestSetBit(BitOperations.ResetLowestSetBit(mask));
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Byte.cs (26)
113int bitPos = BitOperations.TrailingZeroCount(mask); 121mask = BitOperations.ResetLowestSetBit(mask); // Clear the lowest set bit 174int bitPos = BitOperations.TrailingZeroCount(mask); 182mask = BitOperations.ResetLowestSetBit(mask); // Clear the lowest set bit 235int bitPos = BitOperations.TrailingZeroCount(mask); 244mask = BitOperations.ResetLowestSetBit(mask); 325int highestSetBitIndex = 63 - BitOperations.LeadingZeroCount(mask); 334mask = BitOperations.FlipBit(mask, highestSetBitIndex); 372int highestSetBitIndex = 31 - BitOperations.LeadingZeroCount(mask); 381mask = BitOperations.FlipBit(mask, highestSetBitIndex); 421int highestSetBitIndex = 31 - BitOperations.LeadingZeroCount(mask); 430mask = BitOperations.FlipBit(mask, highestSetBitIndex); 542return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 564return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 584return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 603return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 622return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 655return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 676return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 695return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 727return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 1011offset += (uint)BitOperations.TrailingZeroCount(differences); 1052offset += (uint)BitOperations.TrailingZeroCount(differences); 1089offset += (uint)BitOperations.TrailingZeroCount(differences); 1246=> BitOperations.TrailingZeroCount(match) >> 3; 1250=> BitOperations.Log2(match) >> 3;
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Char.cs (18)
117int bitPos = BitOperations.TrailingZeroCount(mask); 194mask = BitOperations.ResetLowestSetBit(BitOperations.ResetLowestSetBit(mask)); 256mask = BitOperations.ResetLowestSetBit(BitOperations.ResetLowestSetBit(mask)); 341int bitPos = 62 - BitOperations.LeadingZeroCount(mask); 391int bitPos = 30 - BitOperations.LeadingZeroCount(mask); 441int bitPos = 30 - BitOperations.LeadingZeroCount(mask); 610return (int)(offset + ((uint)BitOperations.TrailingZeroCount(matches) / sizeof(char))); 637return (int)(offset + ((uint)BitOperations.TrailingZeroCount(matches) / sizeof(char))); 668return (int)(offset + (uint)BitOperations.TrailingZeroCount(matches)); 691return (int)(offset + ((uint)BitOperations.TrailingZeroCount(matches) / sizeof(char))); 714return (int)(offset + ((uint)BitOperations.TrailingZeroCount(matches) / sizeof(char))); 754return (int)(offset + ((uint)BitOperations.TrailingZeroCount(matches) / sizeof(char))); 779return (int)(offset + ((uint)BitOperations.TrailingZeroCount(matches) / sizeof(char))); 802return (int)(offset + ((uint)BitOperations.TrailingZeroCount(matches) / sizeof(char))); 841return (int)(offset + ((uint)BitOperations.TrailingZeroCount(matches) / sizeof(char))); 866=> BitOperations.TrailingZeroCount(match) >> 4;
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (6)
1235int index = BitOperations.TrailingZeroCount(notEqualsElements); 1244int index = BitOperations.TrailingZeroCount(notEqualsElements); 1253int index = BitOperations.TrailingZeroCount(notEqualsElements); 1261int offsetInVector = BitOperations.TrailingZeroCount(notEqualsElements); 1276int offsetInVector = BitOperations.TrailingZeroCount(notEqualsElements); 1291int offsetInVector = BitOperations.TrailingZeroCount(notEqualsElements);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (13)
28if (!BitOperations.IsPow2(sizeof(T))) { goto CannotVectorize; } 3329int index = BitOperations.TrailingZeroCount(notEqualsElements); 3337int index = BitOperations.TrailingZeroCount(notEqualsElements); 3345int index = BitOperations.TrailingZeroCount(notEqualsElements); 3353int index = 31 - BitOperations.LeadingZeroCount(notEqualsElements); // 31 = 32 (bits in Int32) - 1 (indexing from zero) 3361int index = 31 - BitOperations.LeadingZeroCount(notEqualsElements); // 31 = 32 (bits in Int32) - 1 (indexing from zero) 3369int index = 63 - BitOperations.LeadingZeroCount(notEqualsElements); // 31 = 32 (bits in Int32) - 1 (indexing from zero) 3791count += BitOperations.PopCount(Vector512.Equals(Vector512.LoadUnsafe(ref current), targetVector).ExtractMostSignificantBits()); 3808count += BitOperations.PopCount(mask); 3819count += BitOperations.PopCount(Vector256.Equals(Vector256.LoadUnsafe(ref current), targetVector).ExtractMostSignificantBits()); 3836count += BitOperations.PopCount(mask); 3847count += BitOperations.PopCount(Vector128.Equals(Vector128.LoadUnsafe(ref current), targetVector).ExtractMostSignificantBits()); 3860count += BitOperations.PopCount(mask);
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (9)
833hash1 = (BitOperations.RotateLeft(hash1, 5) + hash1) ^ ptr[0]; 834hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ ptr[1]; 841hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ ptr[0]; 877hash1 = (BitOperations.RotateLeft(hash1, 5) + hash1) ^ (p0 | NormalizeToLowercase); 878hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ (p1 | NormalizeToLowercase); 891hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ (p0 | NormalizeToLowercase); 923hash1 = (BitOperations.RotateLeft(hash1, 5) + hash1) ^ (ptr[0] | NormalizeToLowercase); 924hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ (ptr[1] | NormalizeToLowercase); 930hash2 = (BitOperations.RotateLeft(hash2, 5) + hash2) ^ (ptr[0] | NormalizeToLowercase);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (6)
2064uint bitPos = (uint)BitOperations.TrailingZeroCount(mask) / sizeof(char); 2066mask = BitOperations.ResetLowestSetBit(mask); 2093uint bitPos = (uint)BitOperations.TrailingZeroCount(mask) / sizeof(char); 2095mask = BitOperations.ResetLowestSetBit(mask); 2122uint bitPos = (uint)BitOperations.TrailingZeroCount(mask) / sizeof(char); 2124mask = BitOperations.ResetLowestSetBit(mask);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (7)
73int index = BitOperations.TrailingZeroCount(mask) >> 2; 583pBuffer += (uint)BitOperations.TrailingZeroCount(currentSseMask); 628pBuffer += (nuint)(BitOperations.TrailingZeroCount(candidateUInt64) >> 3); 1120pBuffer = (char*)((byte*)pBuffer + (uint)BitOperations.TrailingZeroCount(currentMask) - 1); 1133pBuffer += BitOperations.TrailingZeroCount(asciiCompareMask) >> 3; 1181pBuffer = (char*)((byte*)pBuffer + ((nuint)(BitOperations.TrailingZeroCount(candidateUInt64) >> 3) & ~(nuint)1)); 2144asciiData = BitOperations.RotateLeft(asciiData, 8);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.Helpers.cs (4)
47return (uint)BitOperations.TrailingZeroCount(value & UInt32HighBitsOnlyMask) >> 3; 63value = BitOperations.RotateLeft(value, 1); 68value = BitOperations.RotateLeft(value, 8); 73value = BitOperations.RotateLeft(value, 8);
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.cs (1)
426pBuffer = (char*)((byte*)pBuffer + (uint)BitOperations.TrailingZeroCount(currentMask) - 1);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.Validation.cs (2)
129nuint popcnt = (uint)BitOperations.PopCount(mask); // on x64, perform zero-extension for free 225nuint surrogatePairsCountNuint = (uint)BitOperations.PopCount(highSurrogatesMask);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Helpers.cs (1)
118tempA = BitOperations.RotateLeft(tempA, 16); // = [ 00xxxxxx 00000000 00000000 00000uuu ]
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Transcoding.cs (1)
601toCheck = BitOperations.RotateRight(toCheck, 8);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Validation.cs (3)
135trailingZeroCount = (nuint)BitOperations.TrailingZeroCount(mask) >> 2; 151trailingZeroCount = (nuint)BitOperations.TrailingZeroCount(mask); 600thisDWord = BitOperations.RotateRight(thisDWord, 8);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (1)
556uint newSize = BitOperations.RoundUpToPowerOf2((uint)minSize);
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (3)
813return 64 + BitOperations.LeadingZeroCount(value._lower); 815return BitOperations.LeadingZeroCount(value._upper); 1204int shift = BitOperations.LeadingZeroCount(divHi);
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (5)
279public static ushort LeadingZeroCount(ushort value) => (ushort)(BitOperations.LeadingZeroCount(value) - 16); 282public static ushort PopCount(ushort value) => (ushort)BitOperations.PopCount(value); 291public static ushort TrailingZeroCount(ushort value) => (ushort)(BitOperations.TrailingZeroCount(value << 16) - 16); 441public static bool IsPow2(ushort value) => BitOperations.IsPow2((uint)value); 444public static ushort Log2(ushort value) => (ushort)BitOperations.Log2(value);
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (8)
290public static uint LeadingZeroCount(uint value) => (uint)BitOperations.LeadingZeroCount(value); 294public static uint PopCount(uint value) => (uint)BitOperations.PopCount(value); 298public static uint RotateLeft(uint value, int rotateAmount) => BitOperations.RotateLeft(value, rotateAmount); 302public static uint RotateRight(uint value, int rotateAmount) => BitOperations.RotateRight(value, rotateAmount); 306public static uint TrailingZeroCount(uint value) => (uint)BitOperations.TrailingZeroCount(value); 424int IBinaryInteger<uint>.GetShortestBitLength() => (sizeof(uint) * 8) - BitOperations.LeadingZeroCount(m_value); 473public static bool IsPow2(uint value) => BitOperations.IsPow2(value); 477public static uint Log2(uint value) => (uint)BitOperations.Log2(value);
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (8)
289public static ulong LeadingZeroCount(ulong value) => (ulong)BitOperations.LeadingZeroCount(value); 293public static ulong PopCount(ulong value) => (ulong)BitOperations.PopCount(value); 297public static ulong RotateLeft(ulong value, int rotateAmount) => BitOperations.RotateLeft(value, rotateAmount); 301public static ulong RotateRight(ulong value, int rotateAmount) => BitOperations.RotateRight(value, rotateAmount); 305public static ulong TrailingZeroCount(ulong value) => (ulong)BitOperations.TrailingZeroCount(value); 423int IBinaryInteger<ulong>.GetShortestBitLength() => (sizeof(ulong) * 8) - BitOperations.LeadingZeroCount(m_value); 472public static bool IsPow2(ulong value) => BitOperations.IsPow2(value); 476public static ulong Log2(ulong value) => (ulong)BitOperations.Log2(value);
src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (8)
299public static nuint LeadingZeroCount(nuint value) => (nuint)BitOperations.LeadingZeroCount(value); 303public static nuint PopCount(nuint value) => (nuint)BitOperations.PopCount(value); 307public static nuint RotateLeft(nuint value, int rotateAmount) => BitOperations.RotateLeft(value, rotateAmount); 311public static nuint RotateRight(nuint value, int rotateAmount) => BitOperations.RotateRight(value, rotateAmount); 315public static nuint TrailingZeroCount(nuint value) => (nuint)BitOperations.TrailingZeroCount(value); 433int IBinaryInteger<nuint>.GetShortestBitLength() => (sizeof(nuint_t) * 8) - BitOperations.LeadingZeroCount(_value); 501public static bool IsPow2(nuint value) => BitOperations.IsPow2(value); 505public static nuint Log2(nuint value) => (nuint)BitOperations.Log2(value);
System.Private.Xml (11)
System\Xml\Schema\XsdDateTime.cs (4)
180Debug.Assert(BitOperations.IsPow2((uint)kinds), "One and only one DateTime type code can be set."); 183DateTimeTypeCode code = (DateTimeTypeCode)BitOperations.TrailingZeroCount((uint)kinds); 224Debug.Assert(BitOperations.IsPow2((uint)kinds), "Only one DateTime type code can be set."); 229DateTimeTypeCode code = (DateTimeTypeCode)BitOperations.TrailingZeroCount((uint)kinds);
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (1)
3268if (!BitOperations.IsPow2((uint)kinds))
System\Xml\Xsl\XmlQueryTypeFactory.cs (3)
706if (BitOperations.IsPow2(kinds)) 708return ItemType.Create(s_nodeKindToTypeCode[BitOperations.TrailingZeroCount(kinds) + 1], false); 714members.Add(ItemType.Create(s_nodeKindToTypeCode[BitOperations.TrailingZeroCount(kinds) + 1], false));
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (2)
149Debug.Assert(flag == (flag & ScopeFlags.ExclusiveFlags) && BitOperations.IsPow2((uint)flag), "One exclusive flag"); 168Debug.Assert(flag == (flag & ScopeFlags.InheritedFlags) && BitOperations.IsPow2((uint)flag), "one inherited flag");
System\Xml\Xsl\Xslt\MatcherBuilder.cs (1)
183if (!BitOperations.IsPow2((uint)nodeKinds))
System.Private.Xml.Linq (1)
System\Xml\Linq\XHashtable.cs (1)
147Debug.Assert(BitOperations.IsPow2(capacity), "capacity must be a power of 2");
System.Reflection.Metadata (2)
System\Reflection\Internal\Utilities\BitArithmetic.cs (2)
21return BitOperations.PopCount(v); 35return BitOperations.PopCount(v);
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net9.0\System.Runtime.Forwards.cs (1)
365[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.BitOperations))]
System.Runtime.Extensions (1)
System.Runtime.Extensions.cs (1)
53[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.BitOperations))]
System.Runtime.Numerics (14)
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (2)
28uint index = Unsafe.Add(ref MemoryMarshal.GetReference(log2ToPow10), BitOperations.Log2(value)); 114return (BitOperations.Log2(value) >> 2) + 1;
System\Numerics\BigInteger.cs (9)
628return BitOperations.IsPow2(_sign); 633if (!BitOperations.IsPow2(_bits[iu])) 848int c = BitOperations.LeadingZeroCount((uint)h); 1842int z = BitOperations.LeadingZeroCount((uint)h); 3066long bitLength = bitsArrayLength * 32L - BitOperations.LeadingZeroCount(highValue); 3551return (sizeof(int) * 8) - BitOperations.LeadingZeroCount((uint)(value)); 3555return (sizeof(int) * 8) + 1 - BitOperations.LeadingZeroCount((uint)(~value)); 3563result += (sizeof(uint) * 8) - BitOperations.LeadingZeroCount(bits[^1]); 3582result += (sizeof(uint) * 8) + 1 - BitOperations.LeadingZeroCount(~part);
System\Numerics\BigIntegerCalculator.DivRem.cs (1)
130int shift = BitOperations.LeadingZeroCount(divHi);
System\Numerics\BigIntegerCalculator.GcdInv.cs (1)
267int z = BitOperations.LeadingZeroCount((uint)xh);
System\Numerics\NumericsHelpers.cs (1)
53int cbitShift = BitOperations.LeadingZeroCount(man) - 11;
System.Security.Cryptography (1)
System\Security\Cryptography\RandomNumberGenerator.cs (1)
360if (BitOperations.IsPow2(choices.Length) && choices.Length <= 256)
System.Text.Encodings.Web (8)
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (2)
106int idxOfSemicolon = (int)((uint)BitOperations.Log2(scalarValue) / 4) + 4; 181int idxOfSemicolon = (int)((uint)BitOperations.Log2(scalarValue) / 4) + 4;
System\Text\Encodings\Web\OptimizedInboxTextEncoder.AdvSimd64.cs (4)
131i += (uint)BitOperations.TrailingZeroCount(~resultScalar) >> 2; // location of lowest set bit is where we must begin escaping 138i += (uint)BitOperations.TrailingZeroCount(~resultScalar) >> 3; // location of lowest set bit is where we must begin escaping 246i += (uint)BitOperations.TrailingZeroCount(~resultScalar) >> 2; // location of lowest set bit is where we must begin escaping 253i += (uint)BitOperations.TrailingZeroCount(~resultScalar) >> 3; // location of lowest set bit is where we must begin escaping
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ssse3.cs (2)
123i += (uint)BitOperations.TrailingZeroCount(pmovmskb); // location of lowest set bit is where we must begin escaping 225i += (uint)BitOperations.TrailingZeroCount(pmovmskb); // location of lowest set bit is where we must begin escaping
System.Text.RegularExpressions (2)
System\Text\RegularExpressions\RegexCharClass.cs (1)
1255return BitOperations.IsPow2(mask);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (1)
166_mintermsLog = BitOperations.Log2((uint)_minterms.Length) + 1;