src\libraries\System.Private.CoreLib\src\System\Array.cs (12)
1524ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1532ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1540ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1548ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), startIndex),
1772ref Unsafe.Add(ref Unsafe.As<T, byte>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
1782ref Unsafe.Add(ref Unsafe.As<T, short>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
1792ref Unsafe.Add(ref Unsafe.As<T, int>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
1802ref Unsafe.Add(ref Unsafe.As<T, long>(ref MemoryMarshal.GetArrayDataReference(array)), endIndex),
1925SpanHelpers.Reverse(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), (nuint)length);
2179var span = new Span<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index), length);
2203var spanKeys = new Span<TKey>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(keys), index), length);
2204var 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))) ;
550T t = Unsafe.Add(ref MemoryMarshal.GetReference(keys), i + 1);
553while (j >= 0 && (t == null || LessThan(ref t, ref Unsafe.Add(ref MemoryMarshal.GetReference(keys), j))))
555Unsafe.Add(ref MemoryMarshal.GetReference(keys), j + 1) = Unsafe.Add(ref MemoryMarshal.GetReference(keys), j);
559Unsafe.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)
717Unsafe.Add(ref result._d, i) = (byte)byteVal;
925return r ^ Unsafe.Add(ref r, 1) ^ Unsafe.Add(ref r, 2) ^ Unsafe.Add(ref r, 3);
948&& Unsafe.Add(ref rA, 1) == Unsafe.Add(ref rB, 1)
949&& Unsafe.Add(ref rA, 2) == Unsafe.Add(ref rB, 2)
950&& Unsafe.Add(ref rA, 3) == Unsafe.Add(ref rB, 3);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (56)
1001Unsafe.Add(ref valuesRef, 1),
1002Unsafe.Add(ref valuesRef, 2),
1003Unsafe.Add(ref valuesRef, 3),
1004Unsafe.Add(ref valuesRef, 4),
1014Unsafe.Add(ref valuesRef, 1),
1015Unsafe.Add(ref valuesRef, 2),
1016Unsafe.Add(ref valuesRef, 3),
1017Unsafe.Add(ref valuesRef, 4),
1311Unsafe.Add(ref valuesRef, 1),
1312Unsafe.Add(ref valuesRef, 2),
1313Unsafe.Add(ref valuesRef, 3),
1314Unsafe.Add(ref valuesRef, 4),
1324Unsafe.Add(ref valuesRef, 1),
1325Unsafe.Add(ref valuesRef, 2),
1326Unsafe.Add(ref valuesRef, 3),
1327Unsafe.Add(ref valuesRef, 4),
2019Unsafe.Add(ref valueRef, 1),
2026Unsafe.Add(ref valueRef, 1),
2027Unsafe.Add(ref valueRef, 2),
2034Unsafe.Add(ref valueRef, 1),
2035Unsafe.Add(ref valueRef, 2),
2036Unsafe.Add(ref valueRef, 3),
2043Unsafe.Add(ref valueRef, 1),
2044Unsafe.Add(ref valueRef, 2),
2045Unsafe.Add(ref valueRef, 3),
2046Unsafe.Add(ref valueRef, 4),
2067Unsafe.Add(ref valueRef, 1),
2074Unsafe.Add(ref valueRef, 1),
2075Unsafe.Add(ref valueRef, 2),
2082Unsafe.Add(ref valueRef, 1),
2083Unsafe.Add(ref valueRef, 2),
2084Unsafe.Add(ref valueRef, 3),
2091Unsafe.Add(ref valueRef, 1),
2092Unsafe.Add(ref valueRef, 2),
2093Unsafe.Add(ref valueRef, 3),
2094Unsafe.Add(ref valueRef, 4),
2316Unsafe.Add(ref valueRef, 1),
2323Unsafe.Add(ref valueRef, 1),
2324Unsafe.Add(ref valueRef, 2),
2331Unsafe.Add(ref valueRef, 1),
2332Unsafe.Add(ref valueRef, 2),
2333Unsafe.Add(ref valueRef, 3),
2340Unsafe.Add(ref valueRef, 1),
2341Unsafe.Add(ref valueRef, 2),
2342Unsafe.Add(ref valueRef, 3),
2343Unsafe.Add(ref valueRef, 4),
2364Unsafe.Add(ref valueRef, 1),
2371Unsafe.Add(ref valueRef, 1),
2372Unsafe.Add(ref valueRef, 2),
2379Unsafe.Add(ref valueRef, 1),
2380Unsafe.Add(ref valueRef, 2),
2381Unsafe.Add(ref valueRef, 3),
2388Unsafe.Add(ref valueRef, 1),
2389Unsafe.Add(ref valueRef, 2),
2390Unsafe.Add(ref valueRef, 3),
2391Unsafe.Add(ref valueRef, 4),
src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (42)
220ref short searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
230currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 1);
250ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - (2 * Vector256<short>.Count));
263currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
272ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector256<short>.Count);
303ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - (2 * Vector128<short>.Count));
316currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
325ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<short>.Count);
355char c = (char)Unsafe.Add(ref searchSpace, i);
365ref short currentSearchSpace = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
381ref short twoVectorsAfterStart = ref Unsafe.Add(ref searchSpace, 2 * Vector256<short>.Count);
403ref short oneVectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector256<short>.Count);
432ref short twoVectorsAfterStart = ref Unsafe.Add(ref searchSpace, 2 * Vector128<short>.Count);
454ref short oneVectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<short>.Count);
501ref byte searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
511currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 1);
529ref byte vectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector256<byte>.Count);
541currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<byte>.Count);
550ref byte halfVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<byte>.Count);
578ref byte vectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<byte>.Count);
590currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<byte>.Count);
599ref byte halfVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - sizeof(ulong));
629byte b = Unsafe.Add(ref searchSpace, i);
639ref byte currentSearchSpace = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
653ref byte vectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector256<byte>.Count);
674ref byte halfVectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<byte>.Count);
702ref byte vectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<byte>.Count);
723ref byte halfVectorAfterStart = ref Unsafe.Add(ref searchSpace, sizeof(ulong));
771ref byte searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
781currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 1);
800ref byte vectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector256<byte>.Count);
812currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector256<byte>.Count);
821ref byte halfVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<byte>.Count);
852ref byte vectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - Vector128<byte>.Count);
864currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, Vector128<byte>.Count);
873ref byte halfVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength - sizeof(ulong));
903byte b = Unsafe.Add(ref searchSpace, i);
913ref byte currentSearchSpace = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
928ref byte vectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector256<byte>.Count);
949ref byte halfVectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<byte>.Count);
980ref byte vectorAfterStart = ref Unsafe.Add(ref searchSpace, Vector128<byte>.Count);
1001ref byte halfVectorAfterStart = ref Unsafe.Add(ref searchSpace, sizeof(ulong));
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMap.cs (24)
408ref char searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
423Vector512<byte> result = ContainsMask64CharsAvx512(charMap512, ref cur, ref Unsafe.Add(ref cur, Vector512<ushort>.Count));
433cur = ref Unsafe.Add(ref cur, 64);
492ref char searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
519cur = ref Unsafe.Add(ref cur, 32);
559cur = ref Unsafe.Add(ref cur, 16);
583ref char cur = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
593ref char lastStartVector = ref Unsafe.Add(ref searchSpace, 64);
601Vector512<byte> result = ContainsMask64CharsAvx512(charMap512, ref cur, ref Unsafe.Add(ref cur, Vector512<ushort>.Count));
670ref char cur = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
682ref char lastStartVectorAvx2 = ref Unsafe.Add(ref searchSpace, 32);
717cur = ref Unsafe.Add(ref searchSpace, 16);
724ref char lastStartVector = ref Unsafe.Add(ref searchSpace, 16);
769if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
797if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
818if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
846if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
867if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
899if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
918if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
950if (state.ConfirmProbabilisticMatch<TUseFastContains>(Unsafe.Add(ref cur, index)))
965ref char searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength);
976cur = ref Unsafe.Add(ref cur, 1);
988char c = Unsafe.Add(ref searchSpace, i);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBase.cs (21)
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)))
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)))
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)))
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)))
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)))
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)
74Unsafe.WriteUnaligned(ref Unsafe.Add(ref dest, 16), Unsafe.ReadUnaligned<Block16>(ref Unsafe.Add(ref src, 16)));
87Unsafe.WriteUnaligned(ref Unsafe.Add(ref dest, 32), Unsafe.ReadUnaligned<Block16>(ref Unsafe.Add(ref src, 32)));
102Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -16), Unsafe.ReadUnaligned<Block16>(ref Unsafe.Add(ref srcEnd, -16)));
121Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -8), Unsafe.ReadUnaligned<long>(ref Unsafe.Add(ref srcEnd, -8)));
136Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -4), Unsafe.ReadUnaligned<int>(ref Unsafe.Add(ref srcEnd, -4)));
147Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -2), Unsafe.ReadUnaligned<short>(ref Unsafe.Add(ref srcEnd, -2)));
208dest = ref Unsafe.Add(ref dest, 64);
209src = ref Unsafe.Add(ref src, 64);
218Unsafe.WriteUnaligned(ref Unsafe.Add(ref destEnd, -16), Unsafe.ReadUnaligned<Block16>(ref Unsafe.Add(ref srcEnd, -16)));
281Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref dest, 16), default);
294Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref dest, 32), default);
309Unsafe.WriteUnaligned<Block16>(ref Unsafe.Add(ref destEnd, -16), default);
328Unsafe.WriteUnaligned<long>(ref Unsafe.Add(ref destEnd, -8), 0);
343Unsafe.WriteUnaligned<int>(ref Unsafe.Add(ref destEnd, -4), 0);
354Unsafe.WriteUnaligned<short>(ref Unsafe.Add(ref destEnd, -2), 0);
410dest = ref Unsafe.Add(ref dest, 64);
419Unsafe.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)
25Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -1) = default;
26Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -2) = default;
27Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -3) = default;
28Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -4) = default;
29Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -5) = default;
30Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -6) = default;
31Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -7) = default;
32Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -8) = default;
71Unsafe.Add(ref ip, 2) = default;
72Unsafe.Add(ref ip, 3) = default;
73Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -3) = default;
74Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -2) = default;
80Unsafe.Add(ref ip, 1) = default;
81Unsafe.Add(ref Unsafe.Add(ref ip, (nint)pointerSizeLength), -1) = default;
344first = ref Unsafe.Add(ref first, 1);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (58)
125Unsafe.Add(ref searchSpace, 1) == value ||
126Unsafe.Add(ref searchSpace, 2) == value ||
127Unsafe.Add(ref searchSpace, 3) == value)
162ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
175currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
183ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
211ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
225currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
233ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
269ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
283currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
291ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<short>.Count);
329if (TNegator.NegateIfNeeded(TTransform.TransformInput(Unsafe.Add(ref searchSpace, 1)) == value)) return 1;
330if (TNegator.NegateIfNeeded(TTransform.TransformInput(Unsafe.Add(ref searchSpace, 2)) == value)) return 2;
331if (TNegator.NegateIfNeeded(TTransform.TransformInput(Unsafe.Add(ref searchSpace, 3)) == value)) return 3;
361ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
374currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
382ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
410ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
425currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
433ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
470ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
485currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
493ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<short>.Count);
535lookUp = TTransform.TransformInput(Unsafe.Add(ref searchSpace, 1));
537lookUp = TTransform.TransformInput(Unsafe.Add(ref searchSpace, 2));
539lookUp = TTransform.TransformInput(Unsafe.Add(ref searchSpace, 3));
571ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
585currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
593ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
623ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
638currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
646ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
684ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
699currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
707ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<short>.Count);
749lookUp = Unsafe.Add(ref searchSpace, 1);
751lookUp = Unsafe.Add(ref searchSpace, 2);
753lookUp = Unsafe.Add(ref searchSpace, 3);
787ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
801currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
809ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
840ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
855currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
863ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
902ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
917currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
925ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector128<short>.Count);
962uint current = (uint)Unsafe.Add(ref searchSpace, i);
986ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector512<short>.Count));
999currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector512<short>.Count);
1007ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector512<short>.Count);
1036ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector256<short>.Count));
1051currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector256<short>.Count);
1059ref short oneVectorAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - Vector256<short>.Count);
1097ref short twoVectorsAwayFromEnd = ref Unsafe.Add(ref searchSpace, length - (2 * Vector128<short>.Count));
1112currentSearchSpace = ref Unsafe.Add(ref currentSearchSpace, 2 * Vector128<short>.Count);
1120ref 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);
3820current = ref Unsafe.Add(ref current, Vector256<T>.Count);
3848current = ref Unsafe.Add(ref current, Vector128<T>.Count);
3874current = ref Unsafe.Add(ref current, 1);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (12)
48destination: ref Unsafe.Add(ref dest._firstChar, destPos),
698Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref value._firstChar, (nuint)insertLength);
699Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex + insertLength), ref Unsafe.Add(ref _firstChar, startIndex), (nuint)(oldLength - startIndex));
1086ref char dest = ref Unsafe.Add(ref result._firstChar, copiedLength);
1123Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, count), ref _firstChar, (nuint)oldLength);
1141new Span<char>(ref Unsafe.Add(ref result._firstChar, oldLength), count).Fill(paddingChar);
1162Buffer.Memmove(ref Unsafe.Add(ref result._firstChar, startIndex), ref Unsafe.Add(ref _firstChar, startIndex + count), (nuint)(newLength - startIndex));
1355int pos = PackedSpanHelpers.IndexOf(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1368int pos = SpanHelpers.NonPackedIndexOfChar(ref Unsafe.Add(ref _firstChar, i), c, Length - i);
1384int 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)
109int result = SpanHelpers.IndexOfChar(ref Unsafe.Add(ref _firstChar, startIndex), value, count);
149int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref _firstChar, startIndex), count).IndexOfAny(anyOf);
319int result = SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref Unsafe.Add(ref _firstChar, startSearchAt)), (short)value, count);
367int 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)
1273Unsafe.Add(ref outputBuffer, 1) = (byte)value;
1275Unsafe.Add(ref outputBuffer, 2) = (byte)value;
1277Unsafe.Add(ref outputBuffer, 3) = (byte)value;
1281Unsafe.Add(ref outputBuffer, 3) = (byte)value;
1283Unsafe.Add(ref outputBuffer, 2) = (byte)value;
1285Unsafe.Add(ref outputBuffer, 1) = (byte)value;
1305Unsafe.Add(ref outputBuffer, 1) = (byte)(value >> 16);
1309Unsafe.Add(ref outputBuffer, 1) = (byte)value;
2259Unsafe.Add(ref outputBuffer, 1) = (char)(byte)value;
2261Unsafe.Add(ref outputBuffer, 2) = (char)(byte)value;
2263Unsafe.Add(ref outputBuffer, 3) = (char)value;
2267Unsafe.Add(ref outputBuffer, 3) = (char)(byte)value;
2269Unsafe.Add(ref outputBuffer, 2) = (char)(byte)value;
2271Unsafe.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);
2276ref char destination = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(chunkChars), chunkLength);
2282Unsafe.Add(ref destination, 1) = Unsafe.Add(ref value, 1);
2323new ReadOnlySpan<char>(ref Unsafe.Add(ref value, firstLength), restLength).CopyTo(m_ChunkChars);
2490value = 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);
src\System\Array.CoreCLR.cs (16)
161ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex);
166object? obj = Unsafe.Add(ref srcData, i);
205ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex);
210Unsafe.Add(ref destData, i) = obj;
219ref object? srcData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(sourceArray)), sourceIndex);
220ref object? destData = ref Unsafe.Add(ref Unsafe.As<byte, object?>(ref MemoryMarshal.GetArrayDataReference(destinationArray)), destinationIndex);
224object? obj = Unsafe.Add(ref srcData, i);
229Unsafe.Add(ref destData, i) = CastHelpers.ChkCastAny(destTH, obj);
448lowerBound = Unsafe.Add(ref Unsafe.As<byte, int>(ref p), rank);
449p = ref Unsafe.Add(ref p, 2 * sizeof(int) * rank); // skip the bounds
478rawIndex -= Unsafe.Add(ref bounds, 1);
498int length = Unsafe.Add(ref bounds, i);
586return Unsafe.Add(ref RuntimeHelpers.GetMultiDimensionalArrayBounds(this), dimension);
600return Unsafe.Add(ref bounds, dimension) + Unsafe.Add(ref bounds, rank + dimension) - 1;
613return Unsafe.Add(ref RuntimeHelpers.GetMultiDimensionalArrayBounds(this), rank + dimension);