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