1661 references to Add
GenerateDocumentationAndConfigFiles (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
http2cat (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
IIS.FunctionalTests (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
IIS.LongTests (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
IIS.NewHandler.FunctionalTests (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
IIS.ShadowCopy.Tests (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
IISExpress.FunctionalTests (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
Metrics (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Metrics.Legacy (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Microsoft.AspNetCore.OutputCaching (6)
FormatterBinaryReader.cs (3)
40return Unsafe.Add(ref _root, _offset++); 143var s = Encoding.UTF8.GetString(MemoryMarshal.CreateReadOnlySpan(ref Unsafe.Add(ref _root, _offset), bytes)); 170var result = MemoryMarshal.CreateReadOnlySpan(ref Unsafe.Add(ref _root, _offset), count);
FormatterBinaryWriter.cs (3)
39return MemoryMarshal.CreateSpan(ref Unsafe.Add(ref root, offset), length - offset); 68Unsafe.Add(ref root, offset++) = value; 137Unsafe.Add(ref root, offset++) = value;
Microsoft.AspNetCore.Routing (1)
Matching\ILEmitTrieFactory.cs (1)
740/// <see cref="Unsafe.Add{T}(ref T, int)"/> - Add[ref byte]
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
Microsoft.AspNetCore.Server.IIS (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
Microsoft.AspNetCore.Server.Kestrel.Core (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
Microsoft.AspNetCore.Shared.Tests (2)
src\Shared\ServerInfrastructure\StringUtilities.cs (1)
172ref Unsafe.Add(ref MemoryMarshal.GetReference(buffer), i)),
Windows.Win32.VariableLengthInlineArray.g.cs (1)
31get => ref Unsafe.Add(ref this.e0, index);
Microsoft.CodeAnalysis.Analyzers (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Microsoft.CodeAnalysis.AnalyzerUtilities (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Microsoft.CodeAnalysis.BannedApiAnalyzers (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Microsoft.CodeAnalysis.CodeStyle (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Microsoft.CodeAnalysis.PublicApiAnalyzers (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Microsoft.CodeAnalysis.ResxSourceGenerator (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Microsoft.CodeAnalysis.Workspaces (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Roslyn.Diagnostics.Analyzers (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
System.IO.Hashing (15)
System\IO\Hashing\Adler32.cs (3)
272sourceRef = ref Unsafe.Add(ref sourceRef, BlockSize); 373sourceRef = ref Unsafe.Add(ref sourceRef, BlockSize); 434sourceRef = ref Unsafe.Add(ref sourceRef, BlockSize);
System\IO\Hashing\Crc32.Arm.cs (2)
26Unsafe.ReadUnaligned<ulong>(ref Unsafe.Add(ref ptr, i))); 54Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref ptr, i)));
System\IO\Hashing\Crc32.Vectorized.cs (4)
56srcRef = ref Unsafe.Add(ref srcRef, Vector128<byte>.Count * 4); 77srcRef = ref Unsafe.Add(ref srcRef, Vector128<byte>.Count * 4); 95srcRef = ref Unsafe.Add(ref srcRef, Vector128<byte>.Count); 105srcRef = ref Unsafe.Add(ref srcRef, Vector128<byte>.Count);
System\IO\Hashing\Crc32ParameterSet.WellKnown.cs (2)
117Unsafe.ReadUnaligned<ulong>(ref Unsafe.Add(ref ptr, offset))); 127Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref ptr, offset)));
System\IO\Hashing\Crc64.Vectorized.cs (4)
74srcRef = ref Unsafe.Add(ref srcRef, Vector128<byte>.Count * 8); 107srcRef = ref Unsafe.Add(ref srcRef, Vector128<byte>.Count * 8); 132srcRef = ref Unsafe.Add(ref srcRef, Vector128<byte>.Count); 142srcRef = ref Unsafe.Add(ref srcRef, Vector128<byte>.Count);
System.Linq (12)
System\Linq\MaxMin.cs (9)
54ref T lastVectorStart = ref Unsafe.Add(ref current, span.Length - Vector128<T>.Count); 57current = ref Unsafe.Add(ref current, Vector128<T>.Count); 62current = ref Unsafe.Add(ref current, Vector128<T>.Count); 78ref T lastVectorStart = ref Unsafe.Add(ref current, span.Length - Vector256<T>.Count); 81current = ref Unsafe.Add(ref current, Vector256<T>.Count); 86current = ref Unsafe.Add(ref current, Vector256<T>.Count); 102ref T lastVectorStart = ref Unsafe.Add(ref current, span.Length - Vector512<T>.Count); 105current = ref Unsafe.Add(ref current, Vector512<T>.Count); 110current = ref Unsafe.Add(ref current, Vector512<T>.Count);
System\Linq\Range.cs (3)
83ref T end = ref Unsafe.Add(ref pos, destination.Length); 98pos = ref Unsafe.Add(ref pos, Vector<T>.Count); 108pos = ref Unsafe.Add(ref pos, 1);
System.Numerics.Tensors (490)
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IAggregationOperator.cs (66)
822result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 14))); 826result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 13))); 830result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 12))); 834result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 11))); 838result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 10))); 842result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 9))); 846result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 8))); 850result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 7))); 854result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 6))); 858result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 5))); 862result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 4))); 866result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 3))); 870result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 2))); 874result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 1))); 969result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 6))); 973result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 5))); 977result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 4))); 981result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 3))); 985result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 2))); 989result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 1))); 1067result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 2))); 1073result = TAggregationOperator.Invoke(result, transform.Invoke(Unsafe.Add(ref xRef, 1))); 2024result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 14), Unsafe.Add(ref yRef, 14))); 2028result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 13), Unsafe.Add(ref yRef, 13))); 2032result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 12), Unsafe.Add(ref yRef, 12))); 2036result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 11), Unsafe.Add(ref yRef, 11))); 2040result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 10), Unsafe.Add(ref yRef, 10))); 2044result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 9), Unsafe.Add(ref yRef, 9))); 2048result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 8), Unsafe.Add(ref yRef, 8))); 2052result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 7), Unsafe.Add(ref yRef, 7))); 2056result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 6), Unsafe.Add(ref yRef, 6))); 2060result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 5), Unsafe.Add(ref yRef, 5))); 2064result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 4), Unsafe.Add(ref yRef, 4))); 2068result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 3), Unsafe.Add(ref yRef, 3))); 2072result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 2), Unsafe.Add(ref yRef, 2))); 2076result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 1), Unsafe.Add(ref yRef, 1))); 2177result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 6), Unsafe.Add(ref yRef, 6))); 2181result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 5), Unsafe.Add(ref yRef, 5))); 2185result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 4), Unsafe.Add(ref yRef, 4))); 2189result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 3), Unsafe.Add(ref yRef, 3))); 2193result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 2), Unsafe.Add(ref yRef, 2))); 2197result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 1), Unsafe.Add(ref yRef, 1))); 2281result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 2282Unsafe.Add(ref yRef, 2))); 2288result = TAggregationOperator.Invoke(result, TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 2289Unsafe.Add(ref yRef, 1)));
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBinaryOperator.cs (110)
1012Unsafe.Add(ref dRef, 14) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 14), 1013Unsafe.Add(ref yRef, 14)); 1017Unsafe.Add(ref dRef, 13) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 13), 1018Unsafe.Add(ref yRef, 13)); 1022Unsafe.Add(ref dRef, 12) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 12), 1023Unsafe.Add(ref yRef, 12)); 1027Unsafe.Add(ref dRef, 11) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 11), 1028Unsafe.Add(ref yRef, 11)); 1032Unsafe.Add(ref dRef, 10) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 10), 1033Unsafe.Add(ref yRef, 10)); 1037Unsafe.Add(ref dRef, 9) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 9), 1038Unsafe.Add(ref yRef, 9)); 1042Unsafe.Add(ref dRef, 8) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 8), 1043Unsafe.Add(ref yRef, 8)); 1047Unsafe.Add(ref dRef, 7) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 7), 1048Unsafe.Add(ref yRef, 7)); 1052Unsafe.Add(ref dRef, 6) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 6), 1053Unsafe.Add(ref yRef, 6)); 1057Unsafe.Add(ref dRef, 5) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 5), 1058Unsafe.Add(ref yRef, 5)); 1062Unsafe.Add(ref dRef, 4) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 4), 1063Unsafe.Add(ref yRef, 4)); 1067Unsafe.Add(ref dRef, 3) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 3), 1068Unsafe.Add(ref yRef, 3)); 1072Unsafe.Add(ref dRef, 2) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 1073Unsafe.Add(ref yRef, 2)); 1077Unsafe.Add(ref dRef, 1) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 1078Unsafe.Add(ref yRef, 1)); 1176Unsafe.Add(ref dRef, 6) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 6), 1177Unsafe.Add(ref yRef, 6)); 1181Unsafe.Add(ref dRef, 5) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 5), 1182Unsafe.Add(ref yRef, 5)); 1186Unsafe.Add(ref dRef, 4) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 4), 1187Unsafe.Add(ref yRef, 4)); 1191Unsafe.Add(ref dRef, 3) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 3), 1192Unsafe.Add(ref yRef, 3)); 1196Unsafe.Add(ref dRef, 2) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 1197Unsafe.Add(ref yRef, 2)); 1201Unsafe.Add(ref dRef, 1) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 1202Unsafe.Add(ref yRef, 1)); 1283Unsafe.Add(ref dRef, 2) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 1284Unsafe.Add(ref yRef, 2)); 1290Unsafe.Add(ref dRef, 1) = TBinaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 1291Unsafe.Add(ref yRef, 1)); 2336Unsafe.Add(ref dRef, 14) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 14)), 2341Unsafe.Add(ref dRef, 13) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 13)), 2346Unsafe.Add(ref dRef, 12) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 12)), 2351Unsafe.Add(ref dRef, 11) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 11)), 2356Unsafe.Add(ref dRef, 10) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 10)), 2361Unsafe.Add(ref dRef, 9) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 9)), 2366Unsafe.Add(ref dRef, 8) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 8)), 2371Unsafe.Add(ref dRef, 7) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 7)), 2376Unsafe.Add(ref dRef, 6) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 6)), 2381Unsafe.Add(ref dRef, 5) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 5)), 2386Unsafe.Add(ref dRef, 4) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 4)), 2391Unsafe.Add(ref dRef, 3) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 3)), 2396Unsafe.Add(ref dRef, 2) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 2)), 2401Unsafe.Add(ref dRef, 1) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 1)), 2504Unsafe.Add(ref dRef, 6) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 6)), 2509Unsafe.Add(ref dRef, 5) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 5)), 2514Unsafe.Add(ref dRef, 4) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 4)), 2519Unsafe.Add(ref dRef, 3) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 3)), 2524Unsafe.Add(ref dRef, 2) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 2)), 2529Unsafe.Add(ref dRef, 1) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 1)), 2615Unsafe.Add(ref dRef, 2) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 2)), 2622Unsafe.Add(ref dRef, 1) = TBinaryOperator.Invoke(TTransformOperator.Invoke(Unsafe.Add(ref xRef, 1)),
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBooleanUnaryOperator.cs (9)
169if (TAnyAll.ShouldEarlyExit(TOperator.Invoke(Unsafe.Add(ref xRef, i)))) 312Unsafe.Add(ref destinationRef, i) = TOperator.Invoke(Unsafe.Add(ref xRef, i)); 429Unsafe.Add(ref destinationRef, i) = TOperator.Invoke(Unsafe.Add(ref xRef, i)); 558Unsafe.Add(ref destinationRef, i) = TOperator.Invoke(Unsafe.Add(ref xRef, i)); 715Unsafe.Add(ref destinationRef, i) = TOperator.Invoke(Unsafe.Add(ref xRef, i));
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IStatefulUnaryOperator.cs (44)
878Unsafe.Add(ref dRef, 14) = op.Invoke(Unsafe.Add(ref xRef, 14)); 882Unsafe.Add(ref dRef, 13) = op.Invoke(Unsafe.Add(ref xRef, 13)); 886Unsafe.Add(ref dRef, 12) = op.Invoke(Unsafe.Add(ref xRef, 12)); 890Unsafe.Add(ref dRef, 11) = op.Invoke(Unsafe.Add(ref xRef, 11)); 894Unsafe.Add(ref dRef, 10) = op.Invoke(Unsafe.Add(ref xRef, 10)); 898Unsafe.Add(ref dRef, 9) = op.Invoke(Unsafe.Add(ref xRef, 9)); 902Unsafe.Add(ref dRef, 8) = op.Invoke(Unsafe.Add(ref xRef, 8)); 906Unsafe.Add(ref dRef, 7) = op.Invoke(Unsafe.Add(ref xRef, 7)); 910Unsafe.Add(ref dRef, 6) = op.Invoke(Unsafe.Add(ref xRef, 6)); 914Unsafe.Add(ref dRef, 5) = op.Invoke(Unsafe.Add(ref xRef, 5)); 918Unsafe.Add(ref dRef, 4) = op.Invoke(Unsafe.Add(ref xRef, 4)); 922Unsafe.Add(ref dRef, 3) = op.Invoke(Unsafe.Add(ref xRef, 3)); 926Unsafe.Add(ref dRef, 2) = op.Invoke(Unsafe.Add(ref xRef, 2)); 930Unsafe.Add(ref dRef, 1) = op.Invoke(Unsafe.Add(ref xRef, 1)); 1022Unsafe.Add(ref dRef, 6) = op.Invoke(Unsafe.Add(ref xRef, 6)); 1026Unsafe.Add(ref dRef, 5) = op.Invoke(Unsafe.Add(ref xRef, 5)); 1030Unsafe.Add(ref dRef, 4) = op.Invoke(Unsafe.Add(ref xRef, 4)); 1034Unsafe.Add(ref dRef, 3) = op.Invoke(Unsafe.Add(ref xRef, 3)); 1038Unsafe.Add(ref dRef, 2) = op.Invoke(Unsafe.Add(ref xRef, 2)); 1042Unsafe.Add(ref dRef, 1) = op.Invoke(Unsafe.Add(ref xRef, 1)); 1117Unsafe.Add(ref dRef, 2) = op.Invoke(Unsafe.Add(ref xRef, 2)); 1123Unsafe.Add(ref dRef, 1) = op.Invoke(Unsafe.Add(ref xRef, 1));
System\Numerics\Tensors\netcore\Common\TensorPrimitives.ITernaryOperator.cs (198)
1099Unsafe.Add(ref dRef, 14) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 14), 1100Unsafe.Add(ref yRef, 14), 1101Unsafe.Add(ref zRef, 14)); 1105Unsafe.Add(ref dRef, 13) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 13), 1106Unsafe.Add(ref yRef, 13), 1107Unsafe.Add(ref zRef, 13)); 1111Unsafe.Add(ref dRef, 12) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 12), 1112Unsafe.Add(ref yRef, 12), 1113Unsafe.Add(ref zRef, 12)); 1117Unsafe.Add(ref dRef, 11) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 11), 1118Unsafe.Add(ref yRef, 11), 1119Unsafe.Add(ref zRef, 11)); 1123Unsafe.Add(ref dRef, 10) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 10), 1124Unsafe.Add(ref yRef, 10), 1125Unsafe.Add(ref zRef, 10)); 1129Unsafe.Add(ref dRef, 9) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 9), 1130Unsafe.Add(ref yRef, 9), 1131Unsafe.Add(ref zRef, 9)); 1135Unsafe.Add(ref dRef, 8) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 8), 1136Unsafe.Add(ref yRef, 8), 1137Unsafe.Add(ref zRef, 8)); 1141Unsafe.Add(ref dRef, 7) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 7), 1142Unsafe.Add(ref yRef, 7), 1143Unsafe.Add(ref zRef, 7)); 1147Unsafe.Add(ref dRef, 6) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 6), 1148Unsafe.Add(ref yRef, 6), 1149Unsafe.Add(ref zRef, 6)); 1153Unsafe.Add(ref dRef, 5) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 5), 1154Unsafe.Add(ref yRef, 5), 1155Unsafe.Add(ref zRef, 5)); 1159Unsafe.Add(ref dRef, 4) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 4), 1160Unsafe.Add(ref yRef, 4), 1161Unsafe.Add(ref zRef, 4)); 1165Unsafe.Add(ref dRef, 3) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 3), 1166Unsafe.Add(ref yRef, 3), 1167Unsafe.Add(ref zRef, 3)); 1171Unsafe.Add(ref dRef, 2) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 1172Unsafe.Add(ref yRef, 2), 1173Unsafe.Add(ref zRef, 2)); 1177Unsafe.Add(ref dRef, 1) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 1178Unsafe.Add(ref yRef, 1), 1179Unsafe.Add(ref zRef, 1)); 1283Unsafe.Add(ref dRef, 6) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 6), 1284Unsafe.Add(ref yRef, 6), 1285Unsafe.Add(ref zRef, 6)); 1289Unsafe.Add(ref dRef, 5) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 5), 1290Unsafe.Add(ref yRef, 5), 1291Unsafe.Add(ref zRef, 5)); 1295Unsafe.Add(ref dRef, 4) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 4), 1296Unsafe.Add(ref yRef, 4), 1297Unsafe.Add(ref zRef, 4)); 1301Unsafe.Add(ref dRef, 3) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 3), 1302Unsafe.Add(ref yRef, 3), 1303Unsafe.Add(ref zRef, 3)); 1307Unsafe.Add(ref dRef, 2) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 1308Unsafe.Add(ref yRef, 2), 1309Unsafe.Add(ref zRef, 2)); 1313Unsafe.Add(ref dRef, 1) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 1314Unsafe.Add(ref yRef, 1), 1315Unsafe.Add(ref zRef, 1)); 1402Unsafe.Add(ref dRef, 2) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 1403Unsafe.Add(ref yRef, 2), 1404Unsafe.Add(ref zRef, 2)); 1410Unsafe.Add(ref dRef, 1) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 1411Unsafe.Add(ref yRef, 1), 1412Unsafe.Add(ref zRef, 1)); 2566Unsafe.Add(ref dRef, 14) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 14), 2567Unsafe.Add(ref yRef, 14), 2572Unsafe.Add(ref dRef, 13) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 13), 2573Unsafe.Add(ref yRef, 13), 2578Unsafe.Add(ref dRef, 12) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 12), 2579Unsafe.Add(ref yRef, 12), 2584Unsafe.Add(ref dRef, 11) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 11), 2585Unsafe.Add(ref yRef, 11), 2590Unsafe.Add(ref dRef, 10) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 10), 2591Unsafe.Add(ref yRef, 10), 2596Unsafe.Add(ref dRef, 9) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 9), 2597Unsafe.Add(ref yRef, 9), 2602Unsafe.Add(ref dRef, 8) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 8), 2603Unsafe.Add(ref yRef, 8), 2608Unsafe.Add(ref dRef, 7) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 7), 2609Unsafe.Add(ref yRef, 7), 2614Unsafe.Add(ref dRef, 6) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 6), 2615Unsafe.Add(ref yRef, 6), 2620Unsafe.Add(ref dRef, 5) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 5), 2621Unsafe.Add(ref yRef, 5), 2626Unsafe.Add(ref dRef, 4) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 4), 2627Unsafe.Add(ref yRef, 4), 2632Unsafe.Add(ref dRef, 3) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 3), 2633Unsafe.Add(ref yRef, 3), 2638Unsafe.Add(ref dRef, 2) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 2639Unsafe.Add(ref yRef, 2), 2644Unsafe.Add(ref dRef, 1) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 2645Unsafe.Add(ref yRef, 1), 2754Unsafe.Add(ref dRef, 6) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 6), 2755Unsafe.Add(ref yRef, 6), 2760Unsafe.Add(ref dRef, 5) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 5), 2761Unsafe.Add(ref yRef, 5), 2766Unsafe.Add(ref dRef, 4) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 4), 2767Unsafe.Add(ref yRef, 4), 2772Unsafe.Add(ref dRef, 3) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 3), 2773Unsafe.Add(ref yRef, 3), 2778Unsafe.Add(ref dRef, 2) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 2779Unsafe.Add(ref yRef, 2), 2784Unsafe.Add(ref dRef, 1) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 2785Unsafe.Add(ref yRef, 1), 2877Unsafe.Add(ref dRef, 2) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 2878Unsafe.Add(ref yRef, 2), 2885Unsafe.Add(ref dRef, 1) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 2886Unsafe.Add(ref yRef, 1), 4039Unsafe.Add(ref dRef, 14) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 14), 4045Unsafe.Add(ref dRef, 13) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 13), 4051Unsafe.Add(ref dRef, 12) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 12), 4057Unsafe.Add(ref dRef, 11) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 11), 4063Unsafe.Add(ref dRef, 10) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 10), 4069Unsafe.Add(ref dRef, 9) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 9), 4075Unsafe.Add(ref dRef, 8) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 8), 4081Unsafe.Add(ref dRef, 7) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 7), 4087Unsafe.Add(ref dRef, 6) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 6), 4093Unsafe.Add(ref dRef, 5) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 5), 4099Unsafe.Add(ref dRef, 4) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 4), 4105Unsafe.Add(ref dRef, 3) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 3), 4111Unsafe.Add(ref dRef, 2) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 4117Unsafe.Add(ref dRef, 1) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 4229Unsafe.Add(ref dRef, 6) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 6), 4235Unsafe.Add(ref dRef, 5) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 5), 4241Unsafe.Add(ref dRef, 4) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 4), 4247Unsafe.Add(ref dRef, 3) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 3), 4253Unsafe.Add(ref dRef, 2) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 4259Unsafe.Add(ref dRef, 1) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 1), 4354Unsafe.Add(ref dRef, 2) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 2), 4362Unsafe.Add(ref dRef, 1) = TTernaryOperator.Invoke(Unsafe.Add(ref xRef, 1),
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryInputBinaryOutput.cs (10)
162(T first, T second) = TUnaryOperator.Invoke(Unsafe.Add(ref sourceRef, i)); 163Unsafe.Add(ref destination1Ref, i) = first; 164Unsafe.Add(ref destination2Ref, i) = second; 351(T first, T second) = TOperator.Invoke(Unsafe.Add(ref xRef, i), Unsafe.Add(ref yRef, i)); 352Unsafe.Add(ref destination1Ref, i) = first; 353Unsafe.Add(ref destination2Ref, i) = second; 538(T first, T second) = TOperator.Invoke(Unsafe.Add(ref xRef, i), y); 539Unsafe.Add(ref destination1Ref, i) = first; 540Unsafe.Add(ref destination2Ref, i) = second;
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToFourOperator.cs (2)
157Unsafe.Add(ref destinationRef, i) = TUnaryOperator.Invoke(Unsafe.Add(ref sourceRef, i));
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToTwoOperator.cs (2)
145Unsafe.Add(ref destinationRef, i) = TUnaryOperator.Invoke(Unsafe.Add(ref sourceRef, i));
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOperator.cs (44)
918Unsafe.Add(ref dRef, 14) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 14)); 922Unsafe.Add(ref dRef, 13) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 13)); 926Unsafe.Add(ref dRef, 12) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 12)); 930Unsafe.Add(ref dRef, 11) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 11)); 934Unsafe.Add(ref dRef, 10) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 10)); 938Unsafe.Add(ref dRef, 9) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 9)); 942Unsafe.Add(ref dRef, 8) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 8)); 946Unsafe.Add(ref dRef, 7) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 7)); 950Unsafe.Add(ref dRef, 6) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 6)); 954Unsafe.Add(ref dRef, 5) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 5)); 958Unsafe.Add(ref dRef, 4) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 4)); 962Unsafe.Add(ref dRef, 3) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 3)); 966Unsafe.Add(ref dRef, 2) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 2)); 970Unsafe.Add(ref dRef, 1) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 1)); 1062Unsafe.Add(ref dRef, 6) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 6)); 1066Unsafe.Add(ref dRef, 5) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 5)); 1070Unsafe.Add(ref dRef, 4) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 4)); 1074Unsafe.Add(ref dRef, 3) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 3)); 1078Unsafe.Add(ref dRef, 2) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 2)); 1082Unsafe.Add(ref dRef, 1) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 1)); 1157Unsafe.Add(ref dRef, 2) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 2)); 1163Unsafe.Add(ref dRef, 1) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, 1));
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryTwoToOneOperator.cs (2)
145Unsafe.Add(ref destinationRef, i) = TUnaryOperator.Invoke(Unsafe.Add(ref xRef, i));
System\Numerics\Tensors\netcore\Tensor.cs (1)
1552ReadOnlySpan<T> span = MemoryMarshal.CreateSpan(ref Unsafe.Add(ref tensor.AsTensorSpan()._reference, tensor._start), tensor._values.Length - tensor._start);
System\Numerics\Tensors\netcore\Tensor_1.cs (2)
137public ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan() => new ReadOnlyTensorSpan<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(_values), _start), in _shape); 149public TensorSpan<T> AsTensorSpan() => new TensorSpan<T>(ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(_values), _start), in _shape);
System.Private.CoreLib (747)
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\Buffer.cs (2)
85return Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index); 96Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index) = value;
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (4)
328Unsafe.Add(ref destRef, i) = TReverser.Reverse(Unsafe.Add(ref sourceRef, i)); 361Unsafe.Add(ref destRef, i) = TReverser.Reverse(Unsafe.Add(ref sourceRef, i));
src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (1)
414Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(arrays), count) = array; // arrays[count] = array, but avoiding stelemref
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\Byte.cs (1)
322result = Unsafe.Add(ref MemoryMarshal.GetReference(source), source.Length - sizeof(byte));
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1258sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - sizeof(char));
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\InvariantModeCasing.cs (5)
172char charB = Unsafe.Add(ref source, 1); 201charA = ref Unsafe.Add(ref charA, codePointLengthA); 202charB = ref Unsafe.Add(ref charB, codePointLengthB); 213charA = ref Unsafe.Add(ref charA, codePointLengthA); 214charB = ref Unsafe.Add(ref charB, codePointLengthB);
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (4)
33charA = ref Unsafe.Add(ref charA, 1); 34charB = ref Unsafe.Add(ref charB, 1); 377valueCharU = Unsafe.Add(ref valueRef, valueTailLength); 419ref Unsafe.Add(ref valueRef, 1), valueTailLength))
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.Utf8.cs (4)
38charA = ref Unsafe.Add(ref charA, 1); 39charB = ref Unsafe.Add(ref charB, 1); 348source = ref Unsafe.Add(ref source, 1); 349prefix = ref Unsafe.Add(ref prefix, 1);
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\Int128.cs (3)
800sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - Size); 819result |= Unsafe.Add(ref sourceRef, i); 901result |= Unsafe.Add(ref sourceRef, i);
src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
348sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - sizeof(short));
src\libraries\System.Private.CoreLib\src\System\Int32.cs (3)
368sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - sizeof(int)); 387result |= Unsafe.Add(ref sourceRef, i); 469result |= Unsafe.Add(ref sourceRef, i);
src\libraries\System.Private.CoreLib\src\System\Int64.cs (3)
365sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - sizeof(long)); 384result |= Unsafe.Add(ref sourceRef, i); 466result |= Unsafe.Add(ref sourceRef, i);
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (3)
388sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - sizeof(nint_t)); 407result |= Unsafe.Add(ref sourceRef, i); 489result |= Unsafe.Add(ref sourceRef, i);
src\libraries\System.Private.CoreLib\src\System\Marvin.cs (1)
117uint partialResult = Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref Unsafe.AddByteOffset(ref data, (nuint)count & 7), -4));
src\libraries\System.Private.CoreLib\src\System\Memory.cs (1)
402ref char stringData = ref Unsafe.Add(ref s.GetRawStringData(), _index);
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\MemoryExtensions.Globalization.cs (1)
325ref Unsafe.Add(ref MemoryMarshal.GetReference(span), span.Length - value.Length),
src\libraries\System.Private.CoreLib\src\System\Numerics\Matrix3x2.cs (4)
180return Unsafe.Add(ref Unsafe.AsRef(in AsROImpl()).X, row); 222Unsafe.Add(ref AsImpl().X, row) = value; 281return Unsafe.Add(ref Unsafe.AsRef(in M11), (row * ColumnCount) + column); 323Unsafe.Add(ref M11, (row * ColumnCount) + column) = value;
src\libraries\System.Private.CoreLib\src\System\Numerics\Matrix4x4.cs (4)
259return Unsafe.Add(ref Unsafe.AsRef(in impl.X), row); 309Unsafe.Add(ref Unsafe.AsRef(in impl.X), row) = value; 375return Unsafe.Add(ref Unsafe.AsRef(in M11), (row * ColumnCount) + column); 425Unsafe.Add(ref Unsafe.AsRef(in M11), (row * ColumnCount) + column) = value;
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (2)
3564return Unsafe.Add(ref address, index); 3572Unsafe.Add(ref address, index) = value;
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
317ref char stringData = ref Unsafe.Add(ref s.GetRawStringData(), _index);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\CastCache.cs (3)
123return ref Unsafe.Add(ref tableData, 1); 129return ref Unsafe.As<int, uint>(ref Unsafe.Add(ref tableData, 2)); 136return ref Unsafe.Add(ref Unsafe.As<int, CastCacheEntry>(ref tableData), index + 1);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\GenericCache.cs (1)
138return ref Unsafe.Add(ref Unsafe.As<byte, Entry>(ref Unsafe.As<RawArrayData>(table).Data), index + 1);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs (1)
64ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), offset),
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (2)
4459return Unsafe.Add(ref address, index); 4467Unsafe.Add(ref address, index) = value;
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (2)
4412return Unsafe.Add(ref address, index); 4420Unsafe.Add(ref address, index) = value;
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (2)
4389return Unsafe.Add(ref address, index); 4397Unsafe.Add(ref address, index) = value;
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
4346return Unsafe.Add(ref address, index); 4354Unsafe.Add(ref address, index) = value;
src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
348result = (sbyte)Unsafe.Add(ref MemoryMarshal.GetReference(source), source.Length - sizeof(sbyte));
src\libraries\System.Private.CoreLib\src\System\SearchValues\BitmapCharSearchValues.cs (3)
73ref char searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength); 85cur = ref Unsafe.Add(ref cur, 1); 98char c = Unsafe.Add(ref searchSpace, searchSpaceLength);
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\ProbabilisticMapState.cs (5)
234ref char searchSpaceEnd = ref Unsafe.Add(ref searchSpace, searchSpaceLength); 252cur = ref Unsafe.Add(ref cur, 1); 265cur = ref Unsafe.Add(ref cur, 1); 286char c = Unsafe.Add(ref searchSpace, searchSpaceLength); 297char c = Unsafe.Add(ref searchSpace, searchSpaceLength);
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\Helpers\AhoCorasick.cs (5)
100ref Unsafe.As<char, short>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), i)), 123char c = TCaseSensitivity.TransformInput(Unsafe.Add(ref MemoryMarshal.GetReference(span), i)); 209ref Unsafe.As<char, short>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), i)), 242c = Unsafe.Add(ref MemoryMarshal.GetReference(span), i); 247char.IsLowSurrogate(lowSurrogate = Unsafe.Add(ref MemoryMarshal.GetReference(span), i + 1)))
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
155current = ref Unsafe.Add(ref current, 1);
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\SearchValues\Strings\SingleStringSearchValuesThreeChars.cs (6)
114searchSpace = ref Unsafe.Add(ref searchSpace, Vector512<ushort>.Count); 118if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpace, Vector512<ushort>.Count))) 161searchSpace = ref Unsafe.Add(ref searchSpace, Vector256<ushort>.Count); 165if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpace, Vector256<ushort>.Count))) 208searchSpace = ref Unsafe.Add(ref searchSpace, Vector128<ushort>.Count); 212if (Unsafe.AreSame(ref searchSpace, ref Unsafe.Add(ref lastSearchSpace, Vector128<ushort>.Count)))
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.BinarySearch.cs (1)
40int c = comparable.CompareTo(Unsafe.Add(ref spanStart, i));
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.cs (5)
112source: ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(value), startIndex)); 427destination: ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(destination), destinationIndex), 428source: ref Unsafe.Add(ref _firstChar, sourceIndex), 497source: ref Unsafe.Add(ref _firstChar, startIndex), 573Unsafe.Add(ref result._firstChar, 1) = c2;
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.cs (3)
63Unsafe.ReadUnaligned<uint>(ref Unsafe.As<T, byte>(ref Unsafe.Add(ref searchSpace, length - sizeof(uint))))); 103Unsafe.ReadUnaligned<ulong>(ref Unsafe.Subtract(ref Unsafe.As<T, byte>(ref Unsafe.Add(ref searchSpace, length)), sizeof(ulong)))); 106ref T searchSpaceEnd = ref Unsafe.Add(ref searchSpace, length);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Equality.cs (4)
83currentRightSearchSpace = ref Unsafe.Add(ref currentRightSearchSpace, Vector512<TLeft>.Count); 84currentLeftSearchSpace = ref Unsafe.Add(ref currentLeftSearchSpace, Vector512<TLeft>.Count); 113currentRightSearchSpace = ref Unsafe.Add(ref currentRightSearchSpace, Vector256<TLeft>.Count); 114currentLeftSearchSpace = ref Unsafe.Add(ref currentLeftSearchSpace, Vector256<TLeft>.Count);
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\Latin1Utility.Helpers.cs (8)
68Unsafe.Add(ref outputBuffer, 1) = (byte)value; 70Unsafe.Add(ref outputBuffer, 2) = (byte)value; 72Unsafe.Add(ref outputBuffer, 3) = (byte)value; 76Unsafe.Add(ref outputBuffer, 3) = (byte)value; 78Unsafe.Add(ref outputBuffer, 2) = (byte)value; 80Unsafe.Add(ref outputBuffer, 1) = (byte)value; 100Unsafe.Add(ref outputBuffer, 1) = (byte)(value >> 16); 104Unsafe.Add(ref outputBuffer, 1) = (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);
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (3)
851sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - Size); 870result |= Unsafe.Add(ref sourceRef, i); 926UInt128 part = Unsafe.Add(ref sourceRef, i);
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
322sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - sizeof(ushort));
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (3)
343sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - sizeof(uint)); 362result |= Unsafe.Add(ref sourceRef, i); 418uint part = Unsafe.Add(ref sourceRef, i);
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (3)
342sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - sizeof(ulong)); 361result |= Unsafe.Add(ref sourceRef, i); 417ulong part = Unsafe.Add(ref sourceRef, i);
src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (3)
364sourceRef = ref Unsafe.Add(ref sourceRef, source.Length - sizeof(nuint_t)); 383result |= Unsafe.Add(ref sourceRef, i); 439nuint part = Unsafe.Add(ref sourceRef, i);
src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (2)
259Unsafe.As<byte, object?>(ref Unsafe.Add(ref RuntimeHelpers.GetRawData(newContinuation), keepAliveOffset)) = loaderAllocator; 272Unsafe.As<byte, object?>(ref Unsafe.Add(ref RuntimeHelpers.GetRawData(newContinuation), keepAliveOffset)) = GCHandle.FromIntPtr(loaderAllocatorHandle).Target;
src\System\Runtime\CompilerServices\StaticsHelpers.cs (2)
183object? threadStaticObjectNonCollectible = Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(t_ThreadStatics->NonCollectibleTlsArrayData), indexOffset - ThreadLocalData.NUMBER_OF_TLSOFFSETS_NOT_USED_IN_NONCOLLECTIBLE_ARRAY); 192return ref Unsafe.Add(ref Unsafe.AsRef<byte>(t_ThreadStatics), indexOffset);
src\System\RuntimeType.BoxCache.cs (1)
85source = ref Unsafe.Add(ref source, _nullableValueOffset);
System.Private.DataContractSerialization (3)
System\Xml\XmlBinaryWriter.cs (3)
110ref byte bytePtr = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(buffer), offset); 113Unsafe.WriteUnaligned<T>(ref Unsafe.Add(ref bytePtr, 1), value); 125ref byte bytePtr = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(buffer), offset);
System.Private.Windows.Core (1)
Windows.Win32.VariableLengthInlineArray.g.cs (1)
31get => ref Unsafe.Add(ref this.e0, index);
System.Private.Xml (1)
System\Xml\XmlCharType.cs (1)
186private static uint GetCharProperties(char ch) => Unsafe.Add(ref MemoryMarshal.GetReference(CharProperties), ch);
System.Runtime.Numerics (35)
System\Number.BigInteger.cs (1)
1416ref TChar lastWholeBlockStart = ref Unsafe.Add(ref MemoryMarshal.GetReference(input), input.Length - TParser.DigitsPerBlock);
System\Numerics\BigInteger.cs (7)
3474ref byte address = ref Unsafe.Add(ref startAddress, (bits.Length - 1) * sizeof(uint)); 3495ref byte address = ref Unsafe.Add(ref startAddress, byteCount - sizeof(uint)); 3542Debug.Assert(Unsafe.AreSame(ref startAddress, ref Unsafe.Add(ref address, sizeof(uint)))); 3587address = ref Unsafe.Add(ref address, sizeof(uint)); 3596ref byte lastAddress = ref Unsafe.Add(ref address, byteCount - sizeof(uint)); 3612address = ref Unsafe.Add(ref address, sizeof(uint)); 3629address = ref Unsafe.Add(ref address, sizeof(uint));
System\Numerics\BigIntegerCalculator.AddSub.cs (16)
49carry += Unsafe.Add(ref leftPtr, i); 50carry += Unsafe.Add(ref rightPtr, i); 51Unsafe.Add(ref resultPtr, i) = unchecked((uint)carry); 76long digit = (Unsafe.Add(ref leftPtr, i) + carry) + right[i]; 77Unsafe.Add(ref leftPtr, i) = unchecked((uint)digit); 122carry += Unsafe.Add(ref leftPtr, i); 123carry -= Unsafe.Add(ref rightPtr, i); 124Unsafe.Add(ref resultPtr, i) = unchecked((uint)carry); 152long digit = (Unsafe.Add(ref leftPtr, i) + carry) - right[i]; 153Unsafe.Add(ref leftPtr, i) = unchecked((uint)digit); 182Unsafe.Add(ref resultPtr, i) = unchecked((uint)carry); 186Unsafe.Add(ref resultPtr, left.Length) = unchecked((uint)carry); 193Unsafe.Add(ref resultPtr, i) = unchecked((uint)carry); 205Unsafe.Add(ref resultPtr, left.Length) = unchecked((uint)carry); 229Unsafe.Add(ref resultPtr, i) = unchecked((uint)carry); 238Unsafe.Add(ref resultPtr, i) = unchecked((uint)carry);
System\Numerics\BigIntegerCalculator.SquMul.cs (11)
176ulong digit1 = Unsafe.Add(ref resultPtr, i + j) + carry; 178Unsafe.Add(ref resultPtr, i + j) = unchecked((uint)(digit1 + (digit2 << 1))); 182Unsafe.Add(ref resultPtr, i + i) = unchecked((uint)digits); 183Unsafe.Add(ref resultPtr, i + i + 1) = (uint)(digits >> 32); 543ref uint elementPtr = ref Unsafe.Add(ref resultPtr, i + j); 548Unsafe.Add(ref resultPtr, i + left.Length) = (uint)carry; 881long digit = (Unsafe.Add(ref corePtr, i) + carry) - Unsafe.Add(ref leftPtr, i) - right[i]; 882Unsafe.Add(ref corePtr, i) = unchecked((uint)digit); 888long digit = (Unsafe.Add(ref corePtr, i) + carry) - left[i]; 889Unsafe.Add(ref corePtr, i) = unchecked((uint)digit);
System.Text.Json (1)
src\libraries\System.Private.CoreLib\src\System\Marvin.cs (1)
117uint partialResult = Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref Unsafe.AddByteOffset(ref data, (nuint)count & 7), -4));
System.Windows.Forms.Primitives (1)
Windows.Win32.VariableLengthInlineArray.g.cs (1)
35get => ref Unsafe.Add(ref this.e0, index);
Test.Utilities (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);
Text.Analyzers (24)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (24)
48Unsafe.Add(ref destination, 1) = (byte)(value >> 8); 49Unsafe.Add(ref destination, 2) = (byte)value; 56int i1 = Unsafe.Add(ref encodedChars, 1); 57int i2 = Unsafe.Add(ref encodedChars, 2); 58int i3 = Unsafe.Add(ref encodedChars, 3); 63i0 = Unsafe.Add(ref decodingMap, i0); 64i1 = Unsafe.Add(ref decodingMap, i1); 65i2 = Unsafe.Add(ref decodingMap, i2); 66i3 = Unsafe.Add(ref decodingMap, i3); 227int result = Decode(ref Unsafe.Add(ref srcChars, sourceIndex), ref decodingMap); 230WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), result); 245int i0 = Unsafe.Add(ref srcChars, srcLength - 4); 246int i1 = Unsafe.Add(ref srcChars, srcLength - 3); 247int i2 = Unsafe.Add(ref srcChars, srcLength - 2); 248int i3 = Unsafe.Add(ref srcChars, srcLength - 1); 252i0 = Unsafe.Add(ref decodingMap, i0); 253i1 = Unsafe.Add(ref decodingMap, i1); 262i2 = Unsafe.Add(ref decodingMap, i2); 263i3 = Unsafe.Add(ref decodingMap, i3); 274WriteThreeLowOrderBytes(ref Unsafe.Add(ref destBytes, destIndex), i0); 279i2 = Unsafe.Add(ref decodingMap, i2); 289Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16); 290Unsafe.Add(ref destBytes, destIndex + 1) = (byte)(i0 >> 8); 299Unsafe.Add(ref destBytes, destIndex) = (byte)(i0 >> 16);