src\libraries\System.Private.CoreLib\src\System\Array.cs (29)
538ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex);
543object? obj = Unsafe.Add(ref srcData, i);
584ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex);
593Unsafe.Add(ref destData, i) = obj;
606ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex);
607ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex);
611object? obj = Unsafe.Add(ref srcData, i);
619Unsafe.Add(ref destData, i) = CastHelpers.ChkCastAny(pDestMT, obj);
696lowerBound = Unsafe.Add(ref Unsafe.As<byte, int>(ref p), rank);
697p = ref Unsafe.Add(ref p, 2 * sizeof(int) * rank); // skip the bounds
726rawIndex -= Unsafe.Add(ref bounds, 1);
745int index = indices[i] - Unsafe.Add(ref bounds, indices.Length + i);
746int length = Unsafe.Add(ref bounds, i);
773return Unsafe.Add(ref this.GetMultiDimensionalArrayBounds(), dimension);
787return Unsafe.Add(ref bounds, dimension)
788+ (SupportsNonZeroLowerBound ? Unsafe.Add(ref bounds, rank + dimension) : 0)
803return Unsafe.Add(ref this.GetMultiDimensionalArrayBounds(), rank + dimension);
1902ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1910ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1918ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1926ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
2147ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
2157ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
2167ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
2177ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
2297SpanHelpers.Reverse(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), (nuint)length);
2547var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length);
2571var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length);
2572var spanItems = new Span<TValue>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(items), index), length);
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\Convert.Base64.cs (24)
64int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap);
67WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result);
82int i0 = Unsafe.Add(ref srcChars, srcLength - 4);
83int i1 = Unsafe.Add(ref srcChars, srcLength - 3);
84int i2 = Unsafe.Add(ref srcChars, srcLength - 2);
85int i3 = Unsafe.Add(ref srcChars, srcLength - 1);
89i0 = Unsafe.Add(ref decodingMap, i0);
90i1 = Unsafe.Add(ref decodingMap, i1);
99i2 = Unsafe.Add(ref decodingMap, i2);
100i3 = Unsafe.Add(ref decodingMap, i3);
111WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0);
116i2 = Unsafe.Add(ref decodingMap, i2);
126Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
127Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8);
136Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
161int i1 = Unsafe.Add(ref encodedChars, 1);
162int i2 = Unsafe.Add(ref encodedChars, 2);
163int i3 = Unsafe.Add(ref encodedChars, 3);
168i0 = Unsafe.Add(ref decodingMap, i0);
169i1 = Unsafe.Add(ref decodingMap, i1);
170i2 = Unsafe.Add(ref decodingMap, i2);
171i3 = Unsafe.Add(ref decodingMap, i3);
188Unsafe.Add(ref destination, 1) = (byte)(value >> 8);
189Unsafe.Add(ref destination, 2) = (byte)value;
src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (11)
204if (!char.IsHighSurrogate(a) || index >= lengthA - 1 || !char.IsLowSurrogate(lowSurrogateA = Unsafe.Add(ref charA, 1)))
206if (!char.IsHighSurrogate(b) || index >= lengthB - 1 || !char.IsLowSurrogate(Unsafe.Add(ref charB, 1)))
215charA = ref Unsafe.Add(ref charA, 1);
216charB = ref Unsafe.Add(ref charB, 1);
226charA = ref Unsafe.Add(ref charA, 1);
227charB = ref Unsafe.Add(ref charB, 1);
247if (!char.IsHighSurrogate(b) || index >= lengthB - 1 || !char.IsLowSurrogate(lowSurrogateB = Unsafe.Add(ref charB, 1)))
266charA = ref Unsafe.Add(ref charA, 2);
267charB = ref Unsafe.Add(ref charB, 2);
277charA = ref Unsafe.Add(ref charA, 2);
278charB = ref Unsafe.Add(ref charB, 2);
src\libraries\System.Private.CoreLib\src\System\Guid.cs (10)
795Unsafe.Add(ref result._d, i) = (byte)byteVal;
1067return r ^ Unsafe.Add(ref r, 1) ^ Unsafe.Add(ref r, 2) ^ Unsafe.Add(ref r, 3);
1090&& Unsafe.Add(ref rA, 1) == Unsafe.Add(ref rB, 1)
1091&& Unsafe.Add(ref rA, 2) == Unsafe.Add(ref rB, 2)
1092&& 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)
1213Unsafe.Add(ref valuesRef, 1),
1214Unsafe.Add(ref valuesRef, 2),
1215Unsafe.Add(ref valuesRef, 3),
1216Unsafe.Add(ref valuesRef, 4),
1226Unsafe.Add(ref valuesRef, 1),
1227Unsafe.Add(ref valuesRef, 2),
1228Unsafe.Add(ref valuesRef, 3),
1229Unsafe.Add(ref valuesRef, 4),
1793Unsafe.Add(ref valuesRef, 1),
1794Unsafe.Add(ref valuesRef, 2),
1795Unsafe.Add(ref valuesRef, 3),
1796Unsafe.Add(ref valuesRef, 4),
1806Unsafe.Add(ref valuesRef, 1),
1807Unsafe.Add(ref valuesRef, 2),
1808Unsafe.Add(ref valuesRef, 3),
1809Unsafe.Add(ref valuesRef, 4),
2865Unsafe.Add(ref valueRef, 1),
2872Unsafe.Add(ref valueRef, 1),
2873Unsafe.Add(ref valueRef, 2),
2880Unsafe.Add(ref valueRef, 1),
2881Unsafe.Add(ref valueRef, 2),
2882Unsafe.Add(ref valueRef, 3),
2889Unsafe.Add(ref valueRef, 1),
2890Unsafe.Add(ref valueRef, 2),
2891Unsafe.Add(ref valueRef, 3),
2892Unsafe.Add(ref valueRef, 4),
2908Unsafe.Add(ref valueRef, 1),
2913Unsafe.Add(ref valueRef, 1),
2914Unsafe.Add(ref valueRef, 2),
2919Unsafe.Add(ref valueRef, 1),
2920Unsafe.Add(ref valueRef, 2),
2921Unsafe.Add(ref valueRef, 3),
2926Unsafe.Add(ref valueRef, 1),
2927Unsafe.Add(ref valueRef, 2),
2928Unsafe.Add(ref valueRef, 3),
2929Unsafe.Add(ref valueRef, 4),
3287Unsafe.Add(ref valueRef, 1),
3294Unsafe.Add(ref valueRef, 1),
3295Unsafe.Add(ref valueRef, 2),
3302Unsafe.Add(ref valueRef, 1),
3303Unsafe.Add(ref valueRef, 2),
3304Unsafe.Add(ref valueRef, 3),
3311Unsafe.Add(ref valueRef, 1),
3312Unsafe.Add(ref valueRef, 2),
3313Unsafe.Add(ref valueRef, 3),
3314Unsafe.Add(ref valueRef, 4),
3330Unsafe.Add(ref valueRef, 1),
3335Unsafe.Add(ref valueRef, 1),
3336Unsafe.Add(ref valueRef, 2),
3341Unsafe.Add(ref valueRef, 1),
3342Unsafe.Add(ref valueRef, 2),
3343Unsafe.Add(ref valueRef, 3),
3348Unsafe.Add(ref valueRef, 1),
3349Unsafe.Add(ref valueRef, 2),
3350Unsafe.Add(ref valueRef, 3),
3351Unsafe.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\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)));
275Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref dest, 16), default);
288Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref dest, 32), default);
303Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref destEnd, -16), default);
322Unsafe.WriteUnaligned<long>(ref Unsafe.Add(ref destEnd, -8), 0);
337Unsafe.WriteUnaligned<int>(ref Unsafe.Add(ref destEnd, -4), 0);
348Unsafe.WriteUnaligned<short>(ref Unsafe.Add(ref destEnd, -2), 0);
404dest = ref Unsafe.Add(ref dest, 64);
413Unsafe.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)
200ref T valueTail = ref Unsafe.Add(ref value, 1);
212int relativeIndex = IndexOf(ref Unsafe.Add(ref searchSpace, index), valueHead, remainingSearchSpaceLength);
218if (SequenceEqual(ref Unsafe.Add(ref searchSpace, index + 1), ref valueTail, valueTailLength))
400lookUp = Unsafe.Add(ref searchSpace, index);
403lookUp = Unsafe.Add(ref searchSpace, index + 1);
406lookUp = Unsafe.Add(ref searchSpace, index + 2);
409lookUp = Unsafe.Add(ref searchSpace, index + 3);
412lookUp = Unsafe.Add(ref searchSpace, index + 4);
415lookUp = Unsafe.Add(ref searchSpace, index + 5);
418lookUp = Unsafe.Add(ref searchSpace, index + 6);
421lookUp = Unsafe.Add(ref searchSpace, index + 7);
430lookUp = Unsafe.Add(ref searchSpace, index);
433lookUp = Unsafe.Add(ref searchSpace, index + 1);
436lookUp = Unsafe.Add(ref searchSpace, index + 2);
439lookUp = Unsafe.Add(ref searchSpace, index + 3);
448lookUp = Unsafe.Add(ref searchSpace, index);
459lookUp = Unsafe.Add(ref searchSpace, index);
506lookUp = Unsafe.Add(ref searchSpace, index);
509lookUp = Unsafe.Add(ref searchSpace, index + 1);
512lookUp = Unsafe.Add(ref searchSpace, index + 2);
515lookUp = Unsafe.Add(ref searchSpace, index + 3);
518lookUp = Unsafe.Add(ref searchSpace, index + 4);
521lookUp = Unsafe.Add(ref searchSpace, index + 5);
524lookUp = Unsafe.Add(ref searchSpace, index + 6);
527lookUp = Unsafe.Add(ref searchSpace, index + 7);
536lookUp = Unsafe.Add(ref searchSpace, index);
539lookUp = Unsafe.Add(ref searchSpace, index + 1);
542lookUp = Unsafe.Add(ref searchSpace, index + 2);
545lookUp = Unsafe.Add(ref searchSpace, index + 3);
554lookUp = Unsafe.Add(ref searchSpace, index);
565lookUp = Unsafe.Add(ref searchSpace, index);
626T candidate = Unsafe.Add(ref searchSpace, i);
629if (Unsafe.Add(ref value, j)!.Equals(candidate))
643T candidate = Unsafe.Add(ref searchSpace, i);
648if (candidate.Equals(Unsafe.Add(ref value, j)))
658if (Unsafe.Add(ref value, j) is null)
687ref T valueTail = ref Unsafe.Add(ref value, 1);
702if (SequenceEqual(ref Unsafe.Add(ref searchSpace, relativeIndex + 1), ref valueTail, valueTailLength))
722if (value.Equals(Unsafe.Add(ref searchSpace, length + 7)))
724if (value.Equals(Unsafe.Add(ref searchSpace, length + 6)))
726if (value.Equals(Unsafe.Add(ref searchSpace, length + 5)))
728if (value.Equals(Unsafe.Add(ref searchSpace, length + 4)))
730if (value.Equals(Unsafe.Add(ref searchSpace, length + 3)))
732if (value.Equals(Unsafe.Add(ref searchSpace, length + 2)))
734if (value.Equals(Unsafe.Add(ref searchSpace, length + 1)))
736if (value.Equals(Unsafe.Add(ref searchSpace, length)))
744if (value.Equals(Unsafe.Add(ref searchSpace, length + 3)))
746if (value.Equals(Unsafe.Add(ref searchSpace, length + 2)))
748if (value.Equals(Unsafe.Add(ref searchSpace, length + 1)))
750if (value.Equals(Unsafe.Add(ref searchSpace, length)))
758if (value.Equals(Unsafe.Add(ref searchSpace, length)))
766if ((object?)Unsafe.Add(ref searchSpace, length) is null)
806lookUp = Unsafe.Add(ref searchSpace, length + 7);
809lookUp = Unsafe.Add(ref searchSpace, length + 6);
812lookUp = Unsafe.Add(ref searchSpace, length + 5);
815lookUp = Unsafe.Add(ref searchSpace, length + 4);
818lookUp = Unsafe.Add(ref searchSpace, length + 3);
821lookUp = Unsafe.Add(ref searchSpace, length + 2);
824lookUp = Unsafe.Add(ref searchSpace, length + 1);
827lookUp = Unsafe.Add(ref searchSpace, length);
836lookUp = Unsafe.Add(ref searchSpace, length + 3);
839lookUp = Unsafe.Add(ref searchSpace, length + 2);
842lookUp = Unsafe.Add(ref searchSpace, length + 1);
845lookUp = Unsafe.Add(ref searchSpace, length);
854lookUp = Unsafe.Add(ref searchSpace, length);
863lookUp = Unsafe.Add(ref searchSpace, length);
911lookUp = Unsafe.Add(ref searchSpace, length + 7);
914lookUp = Unsafe.Add(ref searchSpace, length + 6);
917lookUp = Unsafe.Add(ref searchSpace, length + 5);
920lookUp = Unsafe.Add(ref searchSpace, length + 4);
923lookUp = Unsafe.Add(ref searchSpace, length + 3);
926lookUp = Unsafe.Add(ref searchSpace, length + 2);
929lookUp = Unsafe.Add(ref searchSpace, length + 1);
932lookUp = Unsafe.Add(ref searchSpace, length);
941lookUp = Unsafe.Add(ref searchSpace, length + 3);
944lookUp = Unsafe.Add(ref searchSpace, length + 2);
947lookUp = Unsafe.Add(ref searchSpace, length + 1);
950lookUp = Unsafe.Add(ref searchSpace, length);
959lookUp = Unsafe.Add(ref searchSpace, length);
968lookUp = Unsafe.Add(ref searchSpace, length);
1018T candidate = Unsafe.Add(ref searchSpace, i);
1021if (Unsafe.Add(ref value, j)!.Equals(candidate))
1032T candidate = Unsafe.Add(ref searchSpace, i);
1037if (candidate.Equals(Unsafe.Add(ref value, j)))
1047if (Unsafe.Add(ref value, j) is null)
1065if (!EqualityComparer<T>.Default.Equals(Unsafe.Add(ref searchSpace, i), value0))
1080if (!EqualityComparer<T>.Default.Equals(Unsafe.Add(ref searchSpace, i), value0))
1095ref T current = ref Unsafe.Add(ref searchSpace, i);
1111ref T current = ref Unsafe.Add(ref searchSpace, i);
1127ref T current = ref Unsafe.Add(ref searchSpace, i);
1145ref T current = ref Unsafe.Add(ref searchSpace, i);
1163ref T current = ref Unsafe.Add(ref searchSpace, i);
1182ref T current = ref Unsafe.Add(ref searchSpace, i);
1297T lookUp = Unsafe.Add(ref second, i);
1298int result = (Unsafe.Add(ref first, i)?.CompareTo(lookUp) ?? (((object?)lookUp is null) ? 0 : -1));
1384currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<T>.Count);
1411currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<T>.Count);
1441currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<T>.Count);
1563ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<TValue>.Count);
1575currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
1594ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<TValue>.Count);
1602currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
1624ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<TValue>.Count);
1632currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
1721lookUp = Unsafe.Add(ref current, 1);
1723lookUp = Unsafe.Add(ref current, 2);
1725lookUp = Unsafe.Add(ref current, 3);
1727lookUp = Unsafe.Add(ref current, 4);
1729lookUp = Unsafe.Add(ref current, 5);
1731lookUp = Unsafe.Add(ref current, 6);
1733lookUp = Unsafe.Add(ref current, 7);
1747lookUp = Unsafe.Add(ref current, 1);
1749lookUp = Unsafe.Add(ref current, 2);
1751lookUp = Unsafe.Add(ref current, 3);
1788ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<TValue>.Count);
1797currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
1820ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<TValue>.Count);
1829currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
1852ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<TValue>.Count);
1861currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
1928lookUp = Unsafe.Add(ref current, 1);
1930lookUp = Unsafe.Add(ref current, 2);
1932lookUp = Unsafe.Add(ref current, 3);
1934lookUp = Unsafe.Add(ref current, 4);
1936lookUp = Unsafe.Add(ref current, 5);
1938lookUp = Unsafe.Add(ref current, 6);
1940lookUp = Unsafe.Add(ref current, 7);
1954lookUp = Unsafe.Add(ref current, 1);
1956lookUp = Unsafe.Add(ref current, 2);
1958lookUp = Unsafe.Add(ref current, 3);
1995ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<TValue>.Count);
2004currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
2027ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<TValue>.Count);
2036currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
2059ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<TValue>.Count);
2068currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
2118lookUp = Unsafe.Add(ref current, 1);
2120lookUp = Unsafe.Add(ref current, 2);
2122lookUp = Unsafe.Add(ref current, 3);
2151ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<TValue>.Count);
2161currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
2185ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<TValue>.Count);
2195currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
2219ref TValue oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<TValue>.Count);
2229currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
2280lookUp = Unsafe.Add(ref current, 1);
2282lookUp = Unsafe.Add(ref current, 2);
2284lookUp = Unsafe.Add(ref current, 3);
2325currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector512<TValue>.Count);
2360currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<TValue>.Count);
2395currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<TValue>.Count);
2568lookUp = Unsafe.Add(ref current, -1);
2570lookUp = Unsafe.Add(ref current, -2);
2572lookUp = Unsafe.Add(ref current, -3);
2574lookUp = Unsafe.Add(ref current, -4);
2576lookUp = Unsafe.Add(ref current, -5);
2578lookUp = Unsafe.Add(ref current, -6);
2580lookUp = Unsafe.Add(ref current, -7);
2594lookUp = Unsafe.Add(ref current, -1);
2596lookUp = Unsafe.Add(ref current, -2);
2598lookUp = Unsafe.Add(ref current, -3);
2753lookUp = Unsafe.Add(ref current, -1);
2755lookUp = Unsafe.Add(ref current, -2);
2757lookUp = Unsafe.Add(ref current, -3);
2759lookUp = Unsafe.Add(ref current, -4);
2761lookUp = Unsafe.Add(ref current, -5);
2763lookUp = Unsafe.Add(ref current, -6);
2765lookUp = Unsafe.Add(ref current, -7);
2779lookUp = Unsafe.Add(ref current, -1);
2781lookUp = Unsafe.Add(ref current, -2);
2783lookUp = Unsafe.Add(ref current, -3);
2937lookUp = Unsafe.Add(ref current, -1);
2939lookUp = Unsafe.Add(ref current, -2);
2941lookUp = Unsafe.Add(ref current, -3);
3204lookUp = Unsafe.Add(ref current, -1);
3206lookUp = Unsafe.Add(ref current, -2);
3208lookUp = Unsafe.Add(ref current, -3);
3443ref T current = ref Unsafe.Add(ref searchSpace, i);
3458ref T current = ref Unsafe.Add(ref searchSpace, i);
3506ref T current = ref Unsafe.Add(ref searchSpace, i);
3531current = ref Unsafe.Add(ref current, Vector128<T>.Count);
3560current = ref Unsafe.Add(ref current, Vector256<T>.Count);
3589current = ref Unsafe.Add(ref current, Vector256<T>.Count);
3609ref T current = ref Unsafe.Add(ref searchSpace, i);
3624ref T current = ref Unsafe.Add(ref searchSpace, i);
3653ref T current = ref Unsafe.Add(ref searchSpace, i);
3749ref T end = ref Unsafe.Add(ref current, length);
3759current = ref Unsafe.Add(ref current, 1);
3771current = ref Unsafe.Add(ref current, 1);
3781ref T end = ref Unsafe.Add(ref current, length);
3792current = ref Unsafe.Add(ref current, Vector512<T>.Count);
3807current = ref Unsafe.Add(ref current, Vector256<T>.Count);
3822current = ref Unsafe.Add(ref current, Vector128<T>.Count);
3840current = ref Unsafe.Add(ref current, 1);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (12)
63destination: ref Unsafe.Add(ref dest._firstChar, destPos),
713Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref value._firstChar, (nuint)insertLength);
714Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex + insertLength), ref Unsafe.Add(ref _firstChar, startIndex), (nuint)(oldLength - startIndex));
1101ref char dest = ref Unsafe.Add(ref result._firstChar, copiedLength);
1138Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, count), ref _firstChar, (nuint)oldLength);
1156new Span<char>(ref Unsafe.Add(ref result._firstChar, oldLength), count).Fill(paddingChar);
1177Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref Unsafe.Add(ref _firstChar, startIndex + count), (nuint)(newLength - startIndex));
1357int pos = PackedSpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1370int pos = SpanHelpers.NonPackedIndexOfChar(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1386int 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 (4)
98int result = SpanHelpers.IndexOfChar(ref Unsafe.Add(ref _firstChar, startIndex), value, count);
138int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref _firstChar, startIndex), count).IndexOfAny(anyOf);
295int result = SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref Unsafe.Add(ref _firstChar, startSearchAt)), (short)value, count);
343int 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)
1295Unsafe.Add(ref outputBuffer, 1) = (byte)value;
1297Unsafe.Add(ref outputBuffer, 2) = (byte)value;
1299Unsafe.Add(ref outputBuffer, 3) = (byte)value;
1303Unsafe.Add(ref outputBuffer, 3) = (byte)value;
1305Unsafe.Add(ref outputBuffer, 2) = (byte)value;
1307Unsafe.Add(ref outputBuffer, 1) = (byte)value;
1327Unsafe.Add(ref outputBuffer, 1) = (byte)(value >> 16);
1331Unsafe.Add(ref outputBuffer, 1) = (byte)value;
2297Unsafe.Add(ref outputBuffer, 1) = (char)(byte)value;
2299Unsafe.Add(ref outputBuffer, 2) = (char)(byte)value;
2301Unsafe.Add(ref outputBuffer, 3) = (char)value;
2305Unsafe.Add(ref outputBuffer, 3) = (char)(byte)value;
2307Unsafe.Add(ref outputBuffer, 2) = (char)(byte)value;
2309Unsafe.Add(ref outputBuffer, 1) = (char)(byte)value;
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (7)
340ref Unsafe.Add(ref result.GetRawStringData(), chunkOffset),
787Append(ref Unsafe.Add(ref value.GetRawStringData(), startIndex), count);
2277ref char destination = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(chunkChars), chunkLength);
2283Unsafe.Add(ref destination, 1) = Unsafe.Add(ref value, 1);
2324new ReadOnlySpan<char>(ref Unsafe.Add(ref value, firstLength), restLength).CopyTo(m_ChunkChars);
2491value = 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);