src\libraries\System.Private.CoreLib\src\System\Array.cs (29)
543ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex);
548object? obj = Unsafe.Add(ref srcData, i);
589ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex);
598Unsafe.Add(ref destData, i) = obj;
611ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex);
612ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex);
616object? obj = Unsafe.Add(ref srcData, i);
624Unsafe.Add(ref destData, i) = CastHelpers.ChkCastAny(pDestMT, obj);
701lowerBound = Unsafe.Add(ref Unsafe.As<byte, int>(ref p), rank);
702p = ref Unsafe.Add(ref p, 2 * sizeof(int) * rank); // skip the bounds
731rawIndex -= Unsafe.Add(ref bounds, 1);
750int index = indices[i] - Unsafe.Add(ref bounds, indices.Length + i);
751int length = Unsafe.Add(ref bounds, i);
778return Unsafe.Add(ref this.GetMultiDimensionalArrayBounds(), dimension);
792return Unsafe.Add(ref bounds, dimension)
793+ (SupportsNonZeroLowerBound ? Unsafe.Add(ref bounds, rank + dimension) : 0)
808return Unsafe.Add(ref this.GetMultiDimensionalArrayBounds(), rank + dimension);
1919ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1927ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1935ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1943ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
2164ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
2174ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
2184ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
2194ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
2314SpanHelpers.Reverse(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), (nuint)length);
2564var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length);
2588var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length);
2589var spanItems = new Span<TValue>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(items), index), length);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (13)
401int i0 = Unsafe.Add(ref decodingMap, (int)t0);
402int i1 = Unsafe.Add(ref decodingMap, (int)t1);
411int i2 = Unsafe.Add(ref decodingMap, (int)t2);
412int i3 = Unsafe.Add(ref decodingMap, (int)t3);
429int i2 = Unsafe.Add(ref decodingMap, (int)t2);
1525int i0 = Unsafe.Add(ref decodingMap, (int)t0);
1526int i1 = Unsafe.Add(ref decodingMap, (int)t1);
1527int i2 = Unsafe.Add(ref decodingMap, (int)t2);
1528int i3 = Unsafe.Add(ref decodingMap, (int)t3);
1736int i0 = Unsafe.Add(ref decodingMap, (int)t0);
1737int i1 = Unsafe.Add(ref decodingMap, (int)t1);
1738int i2 = Unsafe.Add(ref decodingMap, (int)t2);
1739int i3 = Unsafe.Add(ref decodingMap, (int)t3);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (12)
464ref T lastRef = ref Unsafe.Add(ref zeroRef, keys.Length - 1);
465ref T middleRef = ref Unsafe.Add(ref zeroRef, (keys.Length - 1) >> 1);
471ref T nextToLastRef = ref Unsafe.Add(ref zeroRef, keys.Length - 2);
481while (Unsafe.IsAddressLessThan(ref leftRef, ref nextToLastRef) && (leftRef = ref Unsafe.Add(ref leftRef, 1)) == null) ;
482while (Unsafe.IsAddressGreaterThan(ref rightRef, ref zeroRef) && (rightRef = ref Unsafe.Add(ref rightRef, -1)) != null) ;
486while (Unsafe.IsAddressLessThan(ref leftRef, ref nextToLastRef) && GreaterThan(ref pivot, ref leftRef = ref Unsafe.Add(ref leftRef, 1))) ;
487while (Unsafe.IsAddressGreaterThan(ref rightRef, ref zeroRef) && LessThan(ref pivot, ref rightRef = ref Unsafe.Add(ref rightRef, -1))) ;
549T t = Unsafe.Add(ref MemoryMarshal.GetReference(keys), i + 1);
552while (j >= 0 && (t == null || LessThan(ref t, ref Unsafe.Add(ref MemoryMarshal.GetReference(keys), j))))
554Unsafe.Add(ref MemoryMarshal.GetReference(keys), j + 1) = Unsafe.Add(ref MemoryMarshal.GetReference(keys), j);
558Unsafe.Add(ref MemoryMarshal.GetReference(keys), j + 1) = t!;
src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (11)
193if (!char.IsHighSurrogate(a) || index >= lengthA - 1 || !char.IsLowSurrogate(lowSurrogateA = Unsafe.Add(ref charA, 1)))
195if (!char.IsHighSurrogate(b) || index >= lengthB - 1 || !char.IsLowSurrogate(Unsafe.Add(ref charB, 1)))
204charA = ref Unsafe.Add(ref charA, 1);
205charB = ref Unsafe.Add(ref charB, 1);
215charA = ref Unsafe.Add(ref charA, 1);
216charB = ref Unsafe.Add(ref charB, 1);
236if (!char.IsHighSurrogate(b) || index >= lengthB - 1 || !char.IsLowSurrogate(lowSurrogateB = Unsafe.Add(ref charB, 1)))
255charA = ref Unsafe.Add(ref charA, 2);
256charB = ref Unsafe.Add(ref charB, 2);
266charA = ref Unsafe.Add(ref charA, 2);
267charB = ref Unsafe.Add(ref charB, 2);
src\libraries\System.Private.CoreLib\src\System\Guid.cs (10)
808Unsafe.Add(ref result._d, i) = (byte)byteVal;
1079return r ^ Unsafe.Add(ref r, 1) ^ Unsafe.Add(ref r, 2) ^ Unsafe.Add(ref r, 3);
1102&& Unsafe.Add(ref rA, 1) == Unsafe.Add(ref rB, 1)
1103&& Unsafe.Add(ref rA, 2) == Unsafe.Add(ref rB, 2)
1104&& Unsafe.Add(ref rA, 3) == Unsafe.Add(ref rB, 3);
src\libraries\System.Private.CoreLib\src\System\HashCode.cs (10)
321ref byte end = ref Unsafe.Add(ref pos, value.Length);
342pos = ref Unsafe.Add(ref pos, sizeof(int));
347pos = ref Unsafe.Add(ref pos, sizeof(int));
352pos = ref Unsafe.Add(ref pos, sizeof(int));
365uint v2 = Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref pos, sizeof(int) * 1));
367uint v3 = Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref pos, sizeof(int) * 2));
369uint v4 = Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref pos, sizeof(int) * 3));
373pos = ref Unsafe.Add(ref pos, sizeof(int) * 4);
381pos = ref Unsafe.Add(ref pos, sizeof(int));
388pos = ref Unsafe.Add(ref pos, 1);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (56)
1217Unsafe.Add(ref valuesRef, 1),
1218Unsafe.Add(ref valuesRef, 2),
1219Unsafe.Add(ref valuesRef, 3),
1220Unsafe.Add(ref valuesRef, 4),
1230Unsafe.Add(ref valuesRef, 1),
1231Unsafe.Add(ref valuesRef, 2),
1232Unsafe.Add(ref valuesRef, 3),
1233Unsafe.Add(ref valuesRef, 4),
1797Unsafe.Add(ref valuesRef, 1),
1798Unsafe.Add(ref valuesRef, 2),
1799Unsafe.Add(ref valuesRef, 3),
1800Unsafe.Add(ref valuesRef, 4),
1810Unsafe.Add(ref valuesRef, 1),
1811Unsafe.Add(ref valuesRef, 2),
1812Unsafe.Add(ref valuesRef, 3),
1813Unsafe.Add(ref valuesRef, 4),
2893Unsafe.Add(ref valueRef, 1),
2900Unsafe.Add(ref valueRef, 1),
2901Unsafe.Add(ref valueRef, 2),
2908Unsafe.Add(ref valueRef, 1),
2909Unsafe.Add(ref valueRef, 2),
2910Unsafe.Add(ref valueRef, 3),
2917Unsafe.Add(ref valueRef, 1),
2918Unsafe.Add(ref valueRef, 2),
2919Unsafe.Add(ref valueRef, 3),
2920Unsafe.Add(ref valueRef, 4),
2936Unsafe.Add(ref valueRef, 1),
2941Unsafe.Add(ref valueRef, 1),
2942Unsafe.Add(ref valueRef, 2),
2947Unsafe.Add(ref valueRef, 1),
2948Unsafe.Add(ref valueRef, 2),
2949Unsafe.Add(ref valueRef, 3),
2954Unsafe.Add(ref valueRef, 1),
2955Unsafe.Add(ref valueRef, 2),
2956Unsafe.Add(ref valueRef, 3),
2957Unsafe.Add(ref valueRef, 4),
3315Unsafe.Add(ref valueRef, 1),
3322Unsafe.Add(ref valueRef, 1),
3323Unsafe.Add(ref valueRef, 2),
3330Unsafe.Add(ref valueRef, 1),
3331Unsafe.Add(ref valueRef, 2),
3332Unsafe.Add(ref valueRef, 3),
3339Unsafe.Add(ref valueRef, 1),
3340Unsafe.Add(ref valueRef, 2),
3341Unsafe.Add(ref valueRef, 3),
3342Unsafe.Add(ref valueRef, 4),
3358Unsafe.Add(ref valueRef, 1),
3363Unsafe.Add(ref valueRef, 1),
3364Unsafe.Add(ref valueRef, 2),
3369Unsafe.Add(ref valueRef, 1),
3370Unsafe.Add(ref valueRef, 2),
3371Unsafe.Add(ref valueRef, 3),
3376Unsafe.Add(ref valueRef, 1),
3377Unsafe.Add(ref valueRef, 2),
3378Unsafe.Add(ref valueRef, 3),
3379Unsafe.Add(ref valueRef, 4),
src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (42)
295ref short searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
305currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 1);
325ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - (2 * Vector256<short>.Count));
338currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
347ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector256<short>.Count);
378ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - (2 * Vector128<short>.Count));
391currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
400ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<short>.Count);
431char c = (char)Unsafe.Add(ref searchSpace, i);
441ref short currentSearchSpace = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
457ref short twoVectorsAfterStart = ref Unsafe.Add(ref searchSpace, 2 * Vector256<short>.Count);
479ref short oneVectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector256<short>.Count);
508ref short twoVectorsAfterStart = ref Unsafe.Add(ref searchSpace, 2 * Vector128<short>.Count);
530ref short oneVectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<short>.Count);
580ref byte searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
590currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 1);
608ref byte vectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector256<byte>.Count);
620currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<byte>.Count);
629ref byte halfVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<byte>.Count);
657ref byte vectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<byte>.Count);
669currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<byte>.Count);
678ref byte halfVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - sizeof(ulong));
709byte b = Unsafe.Add(ref searchSpace, i);
719ref byte currentSearchSpace = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
733ref byte vectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector256<byte>.Count);
754ref byte halfVectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<byte>.Count);
782ref byte vectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<byte>.Count);
803ref byte halfVectorAfterStart = ref Unsafe.Add(ref searchSpace, sizeof(ulong));
851ref byte searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
861currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 1);
880ref byte vectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector256<byte>.Count);
892currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<byte>.Count);
901ref byte halfVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<byte>.Count);
932ref byte vectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<byte>.Count);
944currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<byte>.Count);
953ref byte halfVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - sizeof(ulong));
983byte b = Unsafe.Add(ref searchSpace, i);
993ref byte currentSearchSpace = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
1008ref byte vectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector256<byte>.Count);
1029ref byte halfVectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<byte>.Count);
1060ref byte vectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<byte>.Count);
1081ref byte halfVectorAfterStart = ref Unsafe.Add(ref searchSpace, sizeof(ulong));
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMap.cs (24)
426ref char searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
441Vector512<byte> result = ContainsMask64CharsAvx512(charMap512, ref cur, ref Unsafe.Add(ref cur, Vector512<ushort>.Count));
451cur = ref Unsafe.Add(ref cur, 64);
510ref char searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
537cur = ref Unsafe.Add(ref cur, 32);
577cur = ref Unsafe.Add(ref cur, 16);
601ref char cur = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
611ref char lastStartVector = ref Unsafe.Add(ref searchSpace, 64);
619Vector512<byte> result = ContainsMask64CharsAvx512(charMap512, ref cur, ref Unsafe.Add(ref cur, Vector512<ushort>.Count));
688ref char cur = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
700ref char lastStartVectorAvx2 = ref Unsafe.Add(ref searchSpace, 32);
735cur = ref Unsafe.Add(ref searchSpace, 16);
742ref char lastStartVector = ref Unsafe.Add(ref searchSpace, 16);
787if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
815if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
836if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
864if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
885if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
917if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
936if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
968if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
983ref char searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
994cur = ref Unsafe.Add(ref cur, 1);
1006char c = Unsafe.Add(ref searchSpace, i);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBase.cs (27)
203ref char lastSearchSpaceStart = ref Unsafe.Add(ref searchSpace, span.Length - CharsPerIterationVector128);
205searchSpace = ref Unsafe.Add(ref searchSpace, MatchStartOffsetN2);
223searchSpace = ref Unsafe.Add(ref searchSpace, CharsPerIterationVector128);
227if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpaceStart, CharsPerIterationVector128)))
255ref char lastSearchSpaceStart = ref Unsafe.Add(ref searchSpace, span.Length - CharsPerIterationAvx2);
257searchSpace = ref Unsafe.Add(ref searchSpace, MatchStartOffsetN2);
275searchSpace = ref Unsafe.Add(ref searchSpace, CharsPerIterationAvx2);
279if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpaceStart, CharsPerIterationAvx2)))
307ref char lastSearchSpaceStart = ref Unsafe.Add(ref searchSpace, span.Length - CharsPerIterationAvx512);
309searchSpace = ref Unsafe.Add(ref searchSpace, MatchStartOffsetN2);
327searchSpace = ref Unsafe.Add(ref searchSpace, CharsPerIterationAvx512);
331if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpaceStart, CharsPerIterationAvx512)))
362ref char lastSearchSpaceStart = ref Unsafe.Add(ref searchSpace, span.Length - CharsPerIterationVector128);
364searchSpace = ref Unsafe.Add(ref searchSpace, MatchStartOffsetN3);
397searchSpace = ref Unsafe.Add(ref searchSpace, CharsPerIterationVector128);
401if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpaceStart, CharsPerIterationVector128)))
432ref char lastSearchSpaceStart = ref Unsafe.Add(ref searchSpace, span.Length - CharsPerIterationAvx2);
434searchSpace = ref Unsafe.Add(ref searchSpace, MatchStartOffsetN3);
454searchSpace = ref Unsafe.Add(ref searchSpace, CharsPerIterationAvx2);
458if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpaceStart, CharsPerIterationAvx2)))
487ref char lastSearchSpaceStart = ref Unsafe.Add(ref searchSpace, span.Length - CharsPerIterationAvx512);
489searchSpace = ref Unsafe.Add(ref searchSpace, MatchStartOffsetN3);
509searchSpace = ref Unsafe.Add(ref searchSpace, CharsPerIterationAvx512);
513if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpaceStart, CharsPerIterationAvx512)))
546ref char matchRef = ref Unsafe.Add(ref searchSpace, matchOffset - matchStartOffset);
593ref char matchRef = ref Unsafe.Add(ref searchSpace, matchOffset - matchStartOffset);
638ref char matchRef = ref Unsafe.Add(ref searchSpace, matchOffset - matchStartOffset);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesPackedThreeChars.cs (8)
114searchSpace = ref Unsafe.Add(ref searchSpace, Vector512<byte>.Count);
118if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpace, Vector512<byte>.Count)))
161searchSpace = ref Unsafe.Add(ref searchSpace, Vector256<byte>.Count);
165if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpace, Vector256<byte>.Count)))
208searchSpace = ref Unsafe.Add(ref searchSpace, Vector128<byte>.Count);
212if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpace, Vector128<byte>.Count)))
337ref char matchRef = ref Unsafe.Add(ref searchSpace, bitPos);
364ref char matchRef = ref Unsafe.Add(ref searchSpace, bitPos);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Byte.cs (20)
36ref byte valueTail = ref Unsafe.Add(ref value, 1);
70byte ch2Val = Unsafe.Add(ref value, valueTailLength);
131byte ch2Val = Unsafe.Add(ref value, valueTailLength);
192byte ch2Val = Unsafe.Add(ref value, valueTailLength);
195ch2Val = Unsafe.Add(ref value, --ch1ch2Distance);
272ref byte valueTail = ref Unsafe.Add(ref value, 1);
288ref Unsafe.Add(ref searchSpace, relativeIndex + 1),
305byte ch2Val = Unsafe.Add(ref value, valueTailLength);
308ch2Val = Unsafe.Add(ref value, --ch1ch2Distance);
328ref Unsafe.Add(ref searchSpace, offset + highestSetBitIndex),
352byte ch2Val = Unsafe.Add(ref value, valueTailLength);
355ch2Val = Unsafe.Add(ref value, --ch1ch2Distance);
375ref Unsafe.Add(ref searchSpace, offset + highestSetBitIndex),
399byte ch2Val = Unsafe.Add(ref value, valueTailLength);
402ch2Val = Unsafe.Add(ref value, --ch1ch2Distance);
424ref Unsafe.Add(ref searchSpace, offset + highestSetBitIndex),
1171if (Unsafe.Add(ref first, 1) != Unsafe.Add(ref second, 1))
1176if (i > 2 && Unsafe.Add(ref first, 2) != Unsafe.Add(ref second, 2))
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.ByteMemOps.cs (24)
71Unsafe.WriteUnaligned(ref Unsafe.Add(ref dest, 16), Unsafe.ReadUnaligned<Block16>(ref Unsafe.Add(ref src, 16)));
84Unsafe.WriteUnaligned(ref Unsafe.Add(ref dest, 32), Unsafe.ReadUnaligned<Block16>(ref Unsafe.Add(ref src, 32)));
99Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -16), Unsafe.ReadUnaligned<Block16>(ref Unsafe.Add(ref srcEnd, -16)));
118Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -8), Unsafe.ReadUnaligned<long>(ref Unsafe.Add(ref srcEnd, -8)));
133Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -4), Unsafe.ReadUnaligned<int>(ref Unsafe.Add(ref srcEnd, -4)));
144Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -2), Unsafe.ReadUnaligned<short>(ref Unsafe.Add(ref srcEnd, -2)));
205dest = ref Unsafe.Add(ref dest, 64);
206src = ref Unsafe.Add(ref src, 64);
215Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -16), Unsafe.ReadUnaligned<Block16>(ref Unsafe.Add(ref srcEnd, -16)));
298Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref dest, 16), default);
311Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref dest, 32), default);
326Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref destEnd, -16), default);
345Unsafe.WriteUnaligned<long>(ref Unsafe.Add(ref destEnd, -8), 0);
360Unsafe.WriteUnaligned<int>(ref Unsafe.Add(ref destEnd, -4), 0);
371Unsafe.WriteUnaligned<short>(ref Unsafe.Add(ref destEnd, -2), 0);
427dest = ref Unsafe.Add(ref dest, 64);
436Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref destEnd, -16), default);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Char.cs (15)
37ref byte valueTail = ref Unsafe.As<char, byte>(ref Unsafe.Add(ref value, 1));
75ushort ch2Val = Unsafe.Add(ref value, valueTailLength);
142ushort ch2Val = Unsafe.Add(ref value, valueTailLength);
204ushort ch2Val = Unsafe.Add(ref value, valueTailLength);
284ref byte valueTail = ref Unsafe.As<char, byte>(ref Unsafe.Add(ref value, 1));
300ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, relativeIndex + 1)),
319char ch2Val = Unsafe.Add(ref value, valueTailLength);
322ch2Val = Unsafe.Add(ref value, --ch1ch2Distance);
346ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + charPos)),
369char ch2Val = Unsafe.Add(ref value, valueTailLength);
372ch2Val = Unsafe.Add(ref value, --ch1ch2Distance);
396ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + charPos)),
419char ch2Val = Unsafe.Add(ref value, valueTailLength);
422ch2Val = Unsafe.Add(ref value, --ch1ch2Distance);
446ref Unsafe.As<char, byte>(ref Unsafe.Add(ref searchSpace, offset + charPos)),
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.cs (15)
23Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -1) = default;
24Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -2) = default;
25Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -3) = default;
26Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -4) = default;
27Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -5) = default;
28Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -6) = default;
29Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -7) = default;
30Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -8) = default;
69Unsafe.Add(ref ip, 2) = default;
70Unsafe.Add(ref ip, 3) = default;
71Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -3) = default;
72Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -2) = default;
78Unsafe.Add(ref ip, 1) = default;
79Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -1) = default;
342first = ref Unsafe.Add(ref first, 1);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (58)
123Unsafe.Add(ref searchSpace, 1) == value ||
124Unsafe.Add(ref searchSpace, 2) == value ||
125Unsafe.Add(ref searchSpace, 3) == value)
160ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
173currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
181ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
209ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
223currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
231ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
267ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
281currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
289ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<short>.Count);
327if (TNegator.NegateIfNeeded(TTransform.TransformInput(Unsafe.Add(ref searchSpace, 1)) == value)) return 1;
328if (TNegator.NegateIfNeeded(TTransform.TransformInput(Unsafe.Add(ref searchSpace, 2)) == value)) return 2;
329if (TNegator.NegateIfNeeded(TTransform.TransformInput(Unsafe.Add(ref searchSpace, 3)) == value)) return 3;
359ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
372currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
380ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
408ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
423currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
431ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
468ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
483currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
491ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<short>.Count);
533lookUp = TTransform.TransformInput(Unsafe.Add(ref searchSpace, 1));
535lookUp = TTransform.TransformInput(Unsafe.Add(ref searchSpace, 2));
537lookUp = TTransform.TransformInput(Unsafe.Add(ref searchSpace, 3));
569ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
583currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
591ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
621ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
636currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
644ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
682ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
697currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
705ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<short>.Count);
747lookUp = Unsafe.Add(ref searchSpace, 1);
749lookUp = Unsafe.Add(ref searchSpace, 2);
751lookUp = Unsafe.Add(ref searchSpace, 3);
785ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
799currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
807ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
838ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
853currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
861ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
900ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
915currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
923ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<short>.Count);
960uint current = (uint)Unsafe.Add(ref searchSpace, i);
984ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
997currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
1005ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
1034ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
1049currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
1057ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
1095ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
1110currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
1118ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<short>.Count);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (194)
214ref T valueTail = ref Unsafe.Add(ref value, 1);
228int relativeIndex = IndexOf(ref Unsafe.Add(ref searchSpace, index), valueHead, remainingSearchSpaceLength);
236if (SequenceEqual(ref Unsafe.Add(ref searchSpace, index + 1), ref valueTail, valueTailLength))
429lookUp = Unsafe.Add(ref searchSpace, index);
435lookUp = Unsafe.Add(ref searchSpace, index + 1);
441lookUp = Unsafe.Add(ref searchSpace, index + 2);
447lookUp = Unsafe.Add(ref searchSpace, index + 3);
453lookUp = Unsafe.Add(ref searchSpace, index + 4);
459lookUp = Unsafe.Add(ref searchSpace, index + 5);
465lookUp = Unsafe.Add(ref searchSpace, index + 6);
471lookUp = Unsafe.Add(ref searchSpace, index + 7);
482lookUp = Unsafe.Add(ref searchSpace, index);
488lookUp = Unsafe.Add(ref searchSpace, index + 1);
494lookUp = Unsafe.Add(ref searchSpace, index + 2);
500lookUp = Unsafe.Add(ref searchSpace, index + 3);
511lookUp = Unsafe.Add(ref searchSpace, index);
524lookUp = Unsafe.Add(ref searchSpace, index);
554lookUp = Unsafe.Add(ref searchSpace, index);
560lookUp = Unsafe.Add(ref searchSpace, index + 1);
566lookUp = Unsafe.Add(ref searchSpace, index + 2);
572lookUp = Unsafe.Add(ref searchSpace, index + 3);
578lookUp = Unsafe.Add(ref searchSpace, index + 4);
584lookUp = Unsafe.Add(ref searchSpace, index + 5);
590lookUp = Unsafe.Add(ref searchSpace, index + 6);
596lookUp = Unsafe.Add(ref searchSpace, index + 7);
607lookUp = Unsafe.Add(ref searchSpace, index);
613lookUp = Unsafe.Add(ref searchSpace, index + 1);
619lookUp = Unsafe.Add(ref searchSpace, index + 2);
625lookUp = Unsafe.Add(ref searchSpace, index + 3);
636lookUp = Unsafe.Add(ref searchSpace, index);
649lookUp = Unsafe.Add(ref searchSpace, index);
693T candidate = Unsafe.Add(ref searchSpace, i);
696if (Unsafe.Add(ref value, j)!.Equals(candidate))
709T candidate = Unsafe.Add(ref searchSpace, i);
714if (candidate.Equals(Unsafe.Add(ref value, j)))
724if (Unsafe.Add(ref value, j) is null)
753ref T valueTail = ref Unsafe.Add(ref value, 1);
772if (SequenceEqual(ref Unsafe.Add(ref searchSpace, relativeIndex + 1), ref valueTail, valueTailLength))
794if (value.Equals(Unsafe.Add(ref searchSpace, length + 7)))
798if (value.Equals(Unsafe.Add(ref searchSpace, length + 6)))
802if (value.Equals(Unsafe.Add(ref searchSpace, length + 5)))
806if (value.Equals(Unsafe.Add(ref searchSpace, length + 4)))
810if (value.Equals(Unsafe.Add(ref searchSpace, length + 3)))
814if (value.Equals(Unsafe.Add(ref searchSpace, length + 2)))
818if (value.Equals(Unsafe.Add(ref searchSpace, length + 1)))
822if (value.Equals(Unsafe.Add(ref searchSpace, length)))
832if (value.Equals(Unsafe.Add(ref searchSpace, length + 3)))
836if (value.Equals(Unsafe.Add(ref searchSpace, length + 2)))
840if (value.Equals(Unsafe.Add(ref searchSpace, length + 1)))
844if (value.Equals(Unsafe.Add(ref searchSpace, length)))
854if (value.Equals(Unsafe.Add(ref searchSpace, length)))
864if ((object?)Unsafe.Add(ref searchSpace, length) is null)
887lookUp = Unsafe.Add(ref searchSpace, length + 7);
893lookUp = Unsafe.Add(ref searchSpace, length + 6);
899lookUp = Unsafe.Add(ref searchSpace, length + 5);
905lookUp = Unsafe.Add(ref searchSpace, length + 4);
911lookUp = Unsafe.Add(ref searchSpace, length + 3);
917lookUp = Unsafe.Add(ref searchSpace, length + 2);
923lookUp = Unsafe.Add(ref searchSpace, length + 1);
929lookUp = Unsafe.Add(ref searchSpace, length);
940lookUp = Unsafe.Add(ref searchSpace, length + 3);
946lookUp = Unsafe.Add(ref searchSpace, length + 2);
952lookUp = Unsafe.Add(ref searchSpace, length + 1);
958lookUp = Unsafe.Add(ref searchSpace, length);
969lookUp = Unsafe.Add(ref searchSpace, length);
980lookUp = Unsafe.Add(ref searchSpace, length);
1011lookUp = Unsafe.Add(ref searchSpace, length + 7);
1017lookUp = Unsafe.Add(ref searchSpace, length + 6);
1023lookUp = Unsafe.Add(ref searchSpace, length + 5);
1029lookUp = Unsafe.Add(ref searchSpace, length + 4);
1035lookUp = Unsafe.Add(ref searchSpace, length + 3);
1041lookUp = Unsafe.Add(ref searchSpace, length + 2);
1047lookUp = Unsafe.Add(ref searchSpace, length + 1);
1053lookUp = Unsafe.Add(ref searchSpace, length);
1064lookUp = Unsafe.Add(ref searchSpace, length + 3);
1070lookUp = Unsafe.Add(ref searchSpace, length + 2);
1076lookUp = Unsafe.Add(ref searchSpace, length + 1);
1082lookUp = Unsafe.Add(ref searchSpace, length);
1093lookUp = Unsafe.Add(ref searchSpace, length);
1104lookUp = Unsafe.Add(ref searchSpace, length);
1136T candidate = Unsafe.Add(ref searchSpace, i);
1139if (Unsafe.Add(ref value, j)!.Equals(candidate))
1150T candidate = Unsafe.Add(ref searchSpace, i);
1155if (candidate.Equals(Unsafe.Add(ref value, j)))
1165if (Unsafe.Add(ref value, j) is null)
1183if (!EqualityComparer<T>.Default.Equals(Unsafe.Add(ref searchSpace, i), value0))
1198if (!EqualityComparer<T>.Default.Equals(Unsafe.Add(ref searchSpace, i), value0))
1213ref T current = ref Unsafe.Add(ref searchSpace, i);
1229ref T current = ref Unsafe.Add(ref searchSpace, i);
1245ref T current = ref Unsafe.Add(ref searchSpace, i);
1263ref T current = ref Unsafe.Add(ref searchSpace, i);
1281ref T current = ref Unsafe.Add(ref searchSpace, i);
1300ref T current = ref Unsafe.Add(ref searchSpace, i);
1450T lookUp = Unsafe.Add(ref second, i);
1451int result = (Unsafe.Add(ref first, i)?.CompareTo(lookUp) ?? (((object?)lookUp is null) ? 0 : -1));
1543currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<T>.Count);
1570currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<T>.Count);
1600currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<T>.Count);
1750ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<TValue>.Count);
1762currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
1781ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<TValue>.Count);
1789currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
1811ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<TValue>.Count);
1819currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
1916lookUp = Unsafe.Add(ref current, 1);
1922lookUp = Unsafe.Add(ref current, 2);
1928lookUp = Unsafe.Add(ref current, 3);
1934lookUp = Unsafe.Add(ref current, 4);
1940lookUp = Unsafe.Add(ref current, 5);
1946lookUp = Unsafe.Add(ref current, 6);
1952lookUp = Unsafe.Add(ref current, 7);
1973lookUp = Unsafe.Add(ref current, 1);
1979lookUp = Unsafe.Add(ref current, 2);
1985lookUp = Unsafe.Add(ref current, 3);
2013ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<TValue>.Count);
2022currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
2045ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<TValue>.Count);
2054currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
2077ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<TValue>.Count);
2086currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
2157lookUp = Unsafe.Add(ref current, 1);
2163lookUp = Unsafe.Add(ref current, 2);
2169lookUp = Unsafe.Add(ref current, 3);
2175lookUp = Unsafe.Add(ref current, 4);
2181lookUp = Unsafe.Add(ref current, 5);
2187lookUp = Unsafe.Add(ref current, 6);
2193lookUp = Unsafe.Add(ref current, 7);
2214lookUp = Unsafe.Add(ref current, 1);
2220lookUp = Unsafe.Add(ref current, 2);
2226lookUp = Unsafe.Add(ref current, 3);
2254ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<TValue>.Count);
2263currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
2286ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<TValue>.Count);
2295currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
2318ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<TValue>.Count);
2327currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
2381lookUp = Unsafe.Add(ref current, 1);
2387lookUp = Unsafe.Add(ref current, 2);
2393lookUp = Unsafe.Add(ref current, 3);
2421ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<TValue>.Count);
2431currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
2455ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<TValue>.Count);
2465currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
2489ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<TValue>.Count);
2499currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
2554lookUp = Unsafe.Add(ref current, 1);
2560lookUp = Unsafe.Add(ref current, 2);
2566lookUp = Unsafe.Add(ref current, 3);
2605currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
2640currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
2675currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
2876lookUp = Unsafe.Add(ref current, -1);
2882lookUp = Unsafe.Add(ref current, -2);
2888lookUp = Unsafe.Add(ref current, -3);
2894lookUp = Unsafe.Add(ref current, -4);
2900lookUp = Unsafe.Add(ref current, -5);
2906lookUp = Unsafe.Add(ref current, -6);
2912lookUp = Unsafe.Add(ref current, -7);
2933lookUp = Unsafe.Add(ref current, -1);
2939lookUp = Unsafe.Add(ref current, -2);
2945lookUp = Unsafe.Add(ref current, -3);
3093lookUp = Unsafe.Add(ref current, -1);
3099lookUp = Unsafe.Add(ref current, -2);
3105lookUp = Unsafe.Add(ref current, -3);
3111lookUp = Unsafe.Add(ref current, -4);
3117lookUp = Unsafe.Add(ref current, -5);
3123lookUp = Unsafe.Add(ref current, -6);
3129lookUp = Unsafe.Add(ref current, -7);
3150lookUp = Unsafe.Add(ref current, -1);
3156lookUp = Unsafe.Add(ref current, -2);
3162lookUp = Unsafe.Add(ref current, -3);
3308lookUp = Unsafe.Add(ref current, -1);
3314lookUp = Unsafe.Add(ref current, -2);
3320lookUp = Unsafe.Add(ref current, -3);
3580lookUp = Unsafe.Add(ref current, -1);
3586lookUp = Unsafe.Add(ref current, -2);
3592lookUp = Unsafe.Add(ref current, -3);
3831ref T current = ref Unsafe.Add(ref searchSpace, i);
3846ref T current = ref Unsafe.Add(ref searchSpace, i);
3894ref T current = ref Unsafe.Add(ref searchSpace, i);
3919current = ref Unsafe.Add(ref current, Vector128<T>.Count);
3948current = ref Unsafe.Add(ref current, Vector256<T>.Count);
3977current = ref Unsafe.Add(ref current, Vector512<T>.Count);
3997ref T current = ref Unsafe.Add(ref searchSpace, i);
4012ref T current = ref Unsafe.Add(ref searchSpace, i);
4041ref T current = ref Unsafe.Add(ref searchSpace, i);
4137ref T end = ref Unsafe.Add(ref current, length);
4147current = ref Unsafe.Add(ref current, 1);
4159current = ref Unsafe.Add(ref current, 1);
4169ref T end = ref Unsafe.Add(ref current, length);
4180current = ref Unsafe.Add(ref current, Vector512<T>.Count);
4195current = ref Unsafe.Add(ref current, Vector256<T>.Count);
4210current = ref Unsafe.Add(ref current, Vector128<T>.Count);
4228current = ref Unsafe.Add(ref current, 1);
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (9)
77if (Unsafe.Add(ref strA._firstChar, 1) != Unsafe.Add(ref strB._firstChar, 1)) goto DiffOffset1;
87ref Unsafe.Add(ref strA._firstChar, 2), strA.Length - 2,
88ref Unsafe.Add(ref strB._firstChar, 2), strB.Length - 2);
99return Unsafe.Add(ref strA._firstChar, 1) - Unsafe.Add(ref strB._firstChar, 1);
321return Ordinal.CompareStringIgnoreCase(ref Unsafe.Add(ref strA.GetRawStringData(), indexA), lengthA, ref Unsafe.Add(ref strB.GetRawStringData(), indexB), lengthB);
463Ordinal.EqualsIgnoreCase(ref Unsafe.Add(ref GetRawStringData(), Length - value.Length),
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (12)
63destination: ref Unsafe.Add(ref dest._firstChar, destPos),
709Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref value._firstChar, (nuint)insertLength);
710Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex + insertLength), ref Unsafe.Add(ref _firstChar, startIndex), (nuint)(oldLength - startIndex));
1097ref char dest = ref Unsafe.Add(ref result._firstChar, copiedLength);
1134Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, count), ref _firstChar, (nuint)oldLength);
1152new Span<char>(ref Unsafe.Add(ref result._firstChar, oldLength), count).Fill(paddingChar);
1173Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref Unsafe.Add(ref _firstChar, startIndex + count), (nuint)(newLength - startIndex));
1353int pos = PackedSpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1366int pos = SpanHelpers.NonPackedIndexOfChar(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1382int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), Length - i, ref oldValue._firstChar, oldValue.Length);
src\libraries\System.Private.CoreLib\src\System\String.Searching.cs (6)
136ref char startChar = ref Unsafe.Add(ref _firstChar, startIndex);
171int result = SpanHelpers.IndexOfChar(ref Unsafe.Add(ref _firstChar, startIndex), value, count);
211int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref _firstChar, startIndex), count).IndexOfAny(anyOf);
471int result = SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref Unsafe.Add(ref _firstChar, startSearchAt)), (short)value, count);
551ref char startChar = ref Unsafe.Add(ref _firstChar, startSearchAt);
620int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref _firstChar, startSearchAt), count).LastIndexOfAny(anyOf);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (14)
1298Unsafe.Add(ref outputBuffer, 1) = (byte)value;
1300Unsafe.Add(ref outputBuffer, 2) = (byte)value;
1302Unsafe.Add(ref outputBuffer, 3) = (byte)value;
1306Unsafe.Add(ref outputBuffer, 3) = (byte)value;
1308Unsafe.Add(ref outputBuffer, 2) = (byte)value;
1310Unsafe.Add(ref outputBuffer, 1) = (byte)value;
1330Unsafe.Add(ref outputBuffer, 1) = (byte)(value >> 16);
1334Unsafe.Add(ref outputBuffer, 1) = (byte)value;
2300Unsafe.Add(ref outputBuffer, 1) = (char)(byte)value;
2302Unsafe.Add(ref outputBuffer, 2) = (char)(byte)value;
2304Unsafe.Add(ref outputBuffer, 3) = (char)value;
2308Unsafe.Add(ref outputBuffer, 3) = (char)(byte)value;
2310Unsafe.Add(ref outputBuffer, 2) = (char)(byte)value;
2312Unsafe.Add(ref outputBuffer, 1) = (char)(byte)value;
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (7)
342ref Unsafe.Add(ref result.GetRawStringData(), chunkOffset),
797Append(ref Unsafe.Add(ref value.GetRawStringData(), startIndex), count);
2346ref char destination = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(chunkChars), chunkLength);
2352Unsafe.Add(ref destination, 1) = Unsafe.Add(ref value, 1);
2393new ReadOnlySpan<char>(ref Unsafe.Add(ref value, firstLength), restLength).CopyTo(m_ChunkChars);
2560value = ref Unsafe.Add(ref value, lengthToCopy);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Helpers.cs (9)
737Unsafe.WriteUnaligned(ref Unsafe.Add(ref outputBuffer, 4), (ushort)(((value >> 22) & 0x3Fu) + ((value >> 8) & 0x3F00u) + 0x8080u)); // = [ 10XXXXXX 10YYYYYY ]
744Unsafe.Add(ref outputBuffer, 5) = (byte)((value & 0x3Fu) | 0x80u);
745Unsafe.Add(ref outputBuffer, 4) = (byte)(((value >>= 6) & 0x3Fu) | 0x80u);
746Unsafe.Add(ref outputBuffer, 3) = (byte)(((value >>= 6) & 0x0Fu) | 0xE0u);
747Unsafe.Add(ref outputBuffer, 2) = (byte)(((value >>= 4) & 0x3Fu) | 0x80u);
748Unsafe.Add(ref outputBuffer, 1) = (byte)(((value >>= 6) & 0x3Fu) | 0x80u);
771Unsafe.Add(ref outputBuffer, 2) = (byte)((value & 0x3Fu) | ~0x7Fu); // [ 10xxxxxx ]
778Unsafe.Add(ref outputBuffer, 2) = (byte)(((value >>= 16) & 0x3Fu) | 0x80u);
779Unsafe.Add(ref outputBuffer, 1) = (byte)(((value >>= 6) & 0x3Fu) | 0x80u);