diff --git a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/ThrowHelpers.cs b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/ThrowHelpers.cs index 377fba25b43a36..3a1c5d2980492b 100644 --- a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/ThrowHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/ThrowHelpers.cs @@ -12,10 +12,12 @@ internal static unsafe partial class ThrowHelpers { [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowAmbiguousResolutionException")] + [RequiresUnsafe] private static partial void ThrowAmbiguousResolutionException(MethodTable* targetType, MethodTable* interfaceType, void* methodDesc); [DoesNotReturn] [DebuggerHidden] + [RequiresUnsafe] internal static void ThrowAmbiguousResolutionException( void* method, // MethodDesc* void* interfaceType, // MethodTable* @@ -26,10 +28,12 @@ internal static void ThrowAmbiguousResolutionException( [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowEntryPointNotFoundException")] + [RequiresUnsafe] private static partial void ThrowEntryPointNotFoundException(MethodTable* targetType, MethodTable* interfaceType, void* methodDesc); [DoesNotReturn] [DebuggerHidden] + [RequiresUnsafe] internal static void ThrowEntryPointNotFoundException( void* method, // MethodDesc* void* interfaceType, // MethodTable* @@ -40,11 +44,13 @@ internal static void ThrowEntryPointNotFoundException( [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowMethodAccessException")] + [RequiresUnsafe] private static partial void ThrowMethodAccessExceptionInternal(void* caller, void* callee); // implementation of CORINFO_HELP_METHOD_ACCESS_EXCEPTION [DoesNotReturn] [DebuggerHidden] + [RequiresUnsafe] internal static void ThrowMethodAccessException( void* caller, // MethodDesc* void* callee) // MethodDesc* @@ -54,11 +60,13 @@ internal static void ThrowMethodAccessException( [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowFieldAccessException")] + [RequiresUnsafe] private static partial void ThrowFieldAccessExceptionInternal(void* caller, void* callee); // implementation of CORINFO_HELP_FIELD_ACCESS_EXCEPTION [DoesNotReturn] [DebuggerHidden] + [RequiresUnsafe] internal static void ThrowFieldAccessException( void* caller, // MethodDesc* void* callee) // FieldDesc* @@ -68,11 +76,13 @@ internal static void ThrowFieldAccessException( [DoesNotReturn] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ExceptionNative_ThrowClassAccessException")] + [RequiresUnsafe] private static partial void ThrowClassAccessExceptionInternal(void* caller, void* callee); // implementation of CORINFO_HELP_CLASS_ACCESS_EXCEPTION [DoesNotReturn] [DebuggerHidden] + [RequiresUnsafe] internal static void ThrowClassAccessException( void* caller, // MethodDesc* void* callee) // Type handle diff --git a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs index bb8036686d83e6..aa4e64ee600887 100644 --- a/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs +++ b/src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.PlatformNotSupported.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace Internal.Runtime.InteropServices @@ -13,6 +14,7 @@ internal static class ComActivator /// /// Pointer to a instance [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe int GetClassFactoryForTypeInternal(ComActivationContextInternal* pCxtInt) => throw new PlatformNotSupportedException(); @@ -21,6 +23,7 @@ private static unsafe int GetClassFactoryForTypeInternal(ComActivationContextInt /// /// Pointer to a instance [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe int RegisterClassForTypeInternal(ComActivationContextInternal* pCxtInt) => throw new PlatformNotSupportedException(); @@ -29,6 +32,7 @@ private static unsafe int RegisterClassForTypeInternal(ComActivationContextInter /// /// Pointer to a instance [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe int UnregisterClassForTypeInternal(ComActivationContextInternal* pCxtInt) => throw new PlatformNotSupportedException(); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/AppContext.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/AppContext.CoreCLR.cs index 99073bb46d91ec..75b8b42cf51f65 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/AppContext.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/AppContext.CoreCLR.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -9,6 +10,7 @@ namespace System public static partial class AppContext { [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void OnProcessExit(Exception* pException) { try @@ -22,6 +24,7 @@ private static unsafe void OnProcessExit(Exception* pException) } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void OnUnhandledException(object* pException, Exception* pOutException) { try @@ -35,6 +38,7 @@ private static unsafe void OnUnhandledException(object* pException, Exception* p } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void OnFirstChanceException(Exception* pException, Exception* pOutException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/ArgIterator.cs b/src/coreclr/System.Private.CoreLib/src/System/ArgIterator.cs index 7beb15f81ccc2a..f9d3d9d3ba3ebb 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/ArgIterator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/ArgIterator.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -161,6 +162,7 @@ public ArgIterator(RuntimeArgumentHandle arglist) } [CLSCompliant(false)] + [RequiresUnsafe] public unsafe ArgIterator(RuntimeArgumentHandle arglist, void* ptr) { throw new PlatformNotSupportedException(SR.PlatformNotSupported_ArgIterator); // https://github.com/dotnet/runtime/issues/7317 diff --git a/src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs index 3c7cea884d1d03..72193cc785dc83 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs @@ -16,9 +16,11 @@ namespace System public abstract partial class Array : ICloneable, IList, IStructuralComparable, IStructuralEquatable { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Array_CreateInstance")] + [RequiresUnsafe] private static unsafe partial void InternalCreate(QCallTypeHandle type, int rank, int* pLengths, int* pLowerBounds, [MarshalAs(UnmanagedType.Bool)] bool fromArrayType, ObjectHandleOnStack retArray); + [RequiresUnsafe] private static unsafe Array InternalCreate(RuntimeType elementType, int rank, int* pLengths, int* pLowerBounds) { Array? retArray = null; @@ -27,6 +29,7 @@ private static unsafe Array InternalCreate(RuntimeType elementType, int rank, in return retArray!; } + [RequiresUnsafe] private static unsafe Array InternalCreateFromArrayType(RuntimeType arrayType, int rank, int* pLengths, int* pLowerBounds) { Array? retArray = null; @@ -36,12 +39,14 @@ private static unsafe Array InternalCreateFromArrayType(RuntimeType arrayType, i } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Array_Ctor")] + [RequiresUnsafe] private static unsafe partial void Ctor(MethodTable* pArrayMT, uint dwNumArgs, int* pArgList, ObjectHandleOnStack retArray); // implementation of CORINFO_HELP_NEW_MDARR and CORINFO_HELP_NEW_MDARR_RARE. [StackTraceHidden] [DebuggerStepThrough] [DebuggerHidden] + [RequiresUnsafe] internal static unsafe Array Ctor(MethodTable* pArrayMT, uint dwNumArgs, int* pArgList) { Array? arr = null; @@ -304,6 +309,7 @@ public int Rank [MethodImpl(MethodImplOptions.InternalCall)] internal extern CorElementType GetCorElementTypeOfElementType(); + [RequiresUnsafe] private unsafe MethodTable* ElementMethodTable => RuntimeHelpers.GetMethodTable(this)->GetArrayElementTypeHandle().AsMethodTable(); private unsafe bool IsValueOfElementType(object value) @@ -350,8 +356,10 @@ internal sealed unsafe partial class ArrayInitializeCache : RuntimeType.IGeneric internal readonly delegate* ConstructorEntrypoint; [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Array_GetElementConstructorEntrypoint")] + [RequiresUnsafe] private static partial delegate* GetElementConstructorEntrypoint(QCallTypeHandle arrayType); + [RequiresUnsafe] private ArrayInitializeCache(delegate* constructorEntrypoint) { ConstructorEntrypoint = constructorEntrypoint; diff --git a/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs index 7f31868f6a0c8a..8764e418aaf5ae 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Buffer.CoreCLR.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -13,6 +14,7 @@ public partial class Buffer private static extern void BulkMoveWithWriteBarrierInternal(ref byte destination, ref byte source, nuint byteCount); // Used by ilmarshalers.cpp + [RequiresUnsafe] internal static unsafe void Memcpy(byte* dest, byte* src, int len) { Debug.Assert(len >= 0, "Negative length in memcpy!"); @@ -20,6 +22,7 @@ internal static unsafe void Memcpy(byte* dest, byte* src, int len) } // Used by ilmarshalers.cpp + [RequiresUnsafe] internal static unsafe void Memcpy(byte* pDest, int destIndex, byte[] src, int srcIndex, int len) { Debug.Assert((srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs index 358dab7f43674d..8d822a08a6b42b 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs @@ -483,9 +483,11 @@ private void DelegateConstruct(object target, IntPtr method) private static partial void Construct(ObjectHandleOnStack _this, ObjectHandleOnStack target, IntPtr method); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe void* GetMulticastInvoke(MethodTable* pMT); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Delegate_GetMulticastInvokeSlow")] + [RequiresUnsafe] private static unsafe partial void* GetMulticastInvokeSlow(MethodTable* pMT); internal unsafe IntPtr GetMulticastInvoke() @@ -503,6 +505,7 @@ internal unsafe IntPtr GetMulticastInvoke() } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe void* GetInvokeMethod(MethodTable* pMT); internal unsafe IntPtr GetInvokeMethod() diff --git a/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs index 1ecbcb87a4d026..4b4fb747ca049d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Environment.CoreCLR.cs @@ -87,6 +87,7 @@ private static void FailFast(ref StackCrawlMark mark, string? message, Exception [DoesNotReturn] private static partial void FailFast(StackCrawlMarkHandle mark, string? message, ObjectHandleOnStack exception, string? errorMessage); + [RequiresUnsafe] private static unsafe string[] InitializeCommandLineArgs(char* exePath, int argc, char** argv) // invoked from VM { string[] commandLineArgs = new string[argc + 1]; @@ -107,6 +108,7 @@ private static unsafe string[] InitializeCommandLineArgs(char* exePath, int argc internal static partial int GetProcessorCount(); [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void GetResourceString(char* pKey, string* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs index 312e2a755c4929..3c4c5623e76a9a 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Exception.CoreCLR.cs @@ -115,6 +115,7 @@ internal void InternalPreserveStackTrace() } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void InternalPreserveStackTrace(Exception* pException, Exception* pOutException) { try @@ -271,6 +272,7 @@ private bool CanSetRemoteStackTrace() } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void CreateRuntimeWrappedException(object* pThrownObject, object* pResult, Exception* pException) { try @@ -284,6 +286,7 @@ internal static unsafe void CreateRuntimeWrappedException(object* pThrownObject, } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void CreateTypeInitializationException(char* pTypeName, Exception* pInnerException, object* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs index 4222b730e73e6e..2d73e6bdaf01d0 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/GC.CoreCLR.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; @@ -308,6 +309,7 @@ public static int GetGeneration(WeakReference wo) public static int MaxGeneration => GetMaxGeneration(); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_GetNextFinalizableObject")] + [RequiresUnsafe] private static unsafe partial void* GetNextFinalizeableObject(ObjectHandleOnStack target); private static unsafe uint RunFinalizers() @@ -759,6 +761,7 @@ static void Free(NoGCRegionCallbackFinalizerWorkItem* pWorkItem) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EnableNoGCRegionCallback")] + [RequiresUnsafe] private static unsafe partial EnableNoGCRegionCallbackStatus _EnableNoGCRegionCallback(NoGCRegionCallbackFinalizerWorkItem* callback, long totalSize); internal static long GetGenerationBudget(int generation) @@ -871,6 +874,7 @@ internal struct GCConfigurationContext } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void ConfigCallback(void* configurationContext, byte* name, byte* publicKey, GCConfigurationType type, long data) { // If the public key is null, it means that the corresponding configuration isn't publicly available @@ -932,6 +936,7 @@ internal enum GCConfigurationType } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "GCInterface_EnumerateConfigurationValues")] + [RequiresUnsafe] internal static unsafe partial void _EnumerateConfigurationValues(void* configurationDictionary, delegate* unmanaged callback); internal enum RefreshMemoryStatus diff --git a/src/coreclr/System.Private.CoreLib/src/System/IO/Stream.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/IO/Stream.CoreCLR.cs index 18e9ca018f4218..b485bf5de46401 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/IO/Stream.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/IO/Stream.CoreCLR.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -9,6 +10,7 @@ namespace System.IO public abstract unsafe partial class Stream { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Stream_HasOverriddenSlow")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool HasOverriddenSlow(MethodTable* pMT, [MarshalAs(UnmanagedType.Bool)] bool isRead); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs index 530355082d26d2..29e85816c4595e 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Math.CoreCLR.cs @@ -10,6 +10,7 @@ ** ===========================================================*/ +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System @@ -122,9 +123,11 @@ public static unsafe (double Sin, double Cos) SinCos(double x) public static extern double Tanh(double value); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe double ModF(double x, double* intptr); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe void SinCos(double x, double* sin, double* cos); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/MathF.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/MathF.CoreCLR.cs index 90403480bf5df0..6b9eb3cb128213 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/MathF.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/MathF.CoreCLR.cs @@ -7,6 +7,7 @@ ** ===========================================================*/ +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System @@ -119,9 +120,11 @@ public static unsafe (float Sin, float Cos) SinCos(float x) public static extern float Tanh(float x); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe float ModF(float x, float* intptr); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe void SinCos(float x, float* sin, float* cos); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs index 48396e6dd42ef9..ab666d209b3abb 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/AssemblyName.CoreCLR.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Configuration.Assemblies; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -62,6 +63,7 @@ public void SetVersion(Version? version, ushort defaultValue) public sealed partial class AssemblyName { + [RequiresUnsafe] internal unsafe AssemblyName(NativeAssemblyNameParts* pParts) : this() { @@ -144,6 +146,7 @@ private static ProcessorArchitecture CalculateProcArch(PortableExecutableKinds p return ProcessorArchitecture.None; } + [RequiresUnsafe] private static unsafe void ParseAsAssemblySpec(char* pAssemblyName, void* pAssemblySpec) { AssemblyNameParser.AssemblyNameParts parts = AssemblyNameParser.Parse(MemoryMarshal.CreateReadOnlySpanFromNullTerminated(pAssemblyName)); @@ -168,6 +171,7 @@ private static unsafe void ParseAsAssemblySpec(char* pAssemblyName, void* pAssem } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyName_InitializeAssemblySpec")] + [RequiresUnsafe] private static unsafe partial void InitializeAssemblySpec(NativeAssemblyNameParts* pAssemblyNameParts, void* pAssemblySpec); } } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs index f58e24742dc500..a5027d6a8da32a 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/ConstructorInvoker.CoreCLR.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; + namespace System.Reflection { public partial class ConstructorInvoker @@ -13,6 +15,7 @@ internal unsafe ConstructorInvoker(RuntimeConstructorInfo constructor) : this(co _invokeFunc_RefArgs = InterpretedInvoke; } + [RequiresUnsafe] private unsafe object? InterpretedInvoke(object? obj, IntPtr* args) { return RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: obj is null); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs index ae112cbce2bda6..fed49fef5cea4f 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Diagnostics.SymbolStore; using System.Runtime.InteropServices; @@ -756,6 +757,7 @@ internal override byte[] GetLocalsSignature() return m_exceptionHeader; } + [RequiresUnsafe] internal override unsafe void GetEHInfo(int excNumber, void* exc) { Debug.Assert(m_exceptions != null); @@ -904,6 +906,7 @@ public void SetCode(byte[]? code, int maxStackSize) } [CLSCompliant(false)] + [RequiresUnsafe] public unsafe void SetCode(byte* code, int codeSize, int maxStackSize) { ArgumentOutOfRangeException.ThrowIfNegative(codeSize); @@ -920,6 +923,7 @@ public void SetExceptions(byte[]? exceptions) } [CLSCompliant(false)] + [RequiresUnsafe] public unsafe void SetExceptions(byte* exceptions, int exceptionsSize) { ArgumentOutOfRangeException.ThrowIfNegative(exceptionsSize); @@ -936,6 +940,7 @@ public void SetLocalSignature(byte[]? localSignature) } [CLSCompliant(false)] + [RequiresUnsafe] public unsafe void SetLocalSignature(byte* localSignature, int signatureSize) { ArgumentOutOfRangeException.ThrowIfNegative(signatureSize); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs index 474e2c68292709..ee44898231d7e9 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeAssemblyBuilder.cs @@ -113,6 +113,7 @@ internal RuntimeAssemblyBuilder(AssemblyName name, #region DefineDynamicAssembly [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppDomain_CreateDynamicAssembly")] + [RequiresUnsafe] private static unsafe partial void CreateDynamicAssembly(ObjectHandleOnStack assemblyLoadContext, NativeAssemblyNameParts* pAssemblyName, AssemblyHashAlgorithm hashAlgId, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeTypeBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeTypeBuilder.cs index 58fe7960ab3c6d..9405e17878f3d2 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeTypeBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeTypeBuilder.cs @@ -126,6 +126,7 @@ internal static partial int SetParamInfo(QCallModule module, int tkMethod, int i internal static partial void SetClassLayout(QCallModule module, int tk, PackingSize iPackingSize, int iTypeSize); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetConstantValue")] + [RequiresUnsafe] private static unsafe partial void SetConstantValue(QCallModule module, int tk, int corType, void* pValue); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeBuilder_SetPInvokeData", StringMarshalling = StringMarshalling.Utf16)] diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs index f79445292e7cbc..fe8e3a234d0e53 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/InstanceCalliHelper.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Reflection @@ -15,151 +16,197 @@ internal static unsafe class InstanceCalliHelper // Zero parameter methods such as property getters: [Intrinsic] + [RequiresUnsafe] internal static bool Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static byte Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static char Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static DateTime Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static DateTimeOffset Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static decimal Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static double Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static float Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static Guid Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static short Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static int Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static long Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static nint Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static nuint Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static object? Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static sbyte Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static ushort Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static uint Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static ulong Call(delegate* fn, object o) => fn(o); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o) => fn(o); // One parameter methods with no return such as property setters: [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, bool arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, byte arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, char arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, DateTime arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, DateTimeOffset arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, decimal arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, double arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, float arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, Guid arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, short arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, int arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, long arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, nint arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, nuint arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, sbyte arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, ushort arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, uint arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, ulong arg1) => fn(o, arg1); // Other methods: [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2) => fn(o, arg1, arg2); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2, object? arg3) => fn(o, arg1, arg2, arg3); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2, object? arg3, object? arg4) => fn(o, arg1, arg2, arg3, arg4); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5) => fn(o, arg1, arg2, arg3, arg4, arg5); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate* fn, object o, object? arg1, object? arg2, object? arg3, object? arg4, object? arg5, object? arg6) => fn(o, arg1, arg2, arg3, arg4, arg5, arg6); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate*?, void> fn, object o, IEnumerable? arg1) => fn(o, arg1); [Intrinsic] + [RequiresUnsafe] internal static void Call(delegate*?, IEnumerable?, void> fn, object o, IEnumerable? arg1, IEnumerable? arg2) => fn(o, arg1, arg2); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs index 08436811b42be2..febdd92b7426aa 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/LoaderAllocator.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -55,6 +56,7 @@ private LoaderAllocator() } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void Create(object* pResult, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MdImport.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MdImport.cs index f9e37a152f0ad5..368e5d8cbe2063 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MdImport.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MdImport.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -228,6 +229,7 @@ private bool Equals(MetadataImport import) #region Static Members [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MetadataImport_GetMarshalAs")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool GetMarshalAs( IntPtr pNativeType, @@ -333,6 +335,7 @@ internal MetadataImport(RuntimeModule module) #endregion [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MetadataImport_Enum")] + [RequiresUnsafe] private static unsafe partial void Enum(IntPtr scope, int type, int parent, ref int length, int* shortResult, ObjectHandleOnStack longResult); public unsafe void Enum(MetadataTokenType type, int parent, out MetadataEnumResult result) @@ -376,6 +379,7 @@ public void EnumEvents(int mdTypeDef, out MetadataEnumResult result) Enum(MetadataTokenType.Event, mdTypeDef, out result); } + [RequiresUnsafe] private static unsafe string? ConvertMetadataStringPermitInvalidContent(char* stringMetadataEncoding, int length) { Debug.Assert(stringMetadataEncoding != null); @@ -386,6 +390,7 @@ public void EnumEvents(int mdTypeDef, out MetadataEnumResult result) #region FCalls [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetDefaultValue( IntPtr scope, int mdToken, @@ -410,6 +415,7 @@ private static extern unsafe int GetDefaultValue( } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetUserString(IntPtr scope, int mdToken, out char* stringMetadataEncoding, out int length); public unsafe string? GetUserString(int mdToken) @@ -422,6 +428,7 @@ private static extern unsafe int GetDefaultValue( } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetName(IntPtr scope, int mdToken, out byte* name); public unsafe MdUtf8String GetName(int mdToken) @@ -431,6 +438,7 @@ public unsafe MdUtf8String GetName(int mdToken) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetNamespace(IntPtr scope, int mdToken, out byte* namesp); public unsafe MdUtf8String GetNamespace(int mdToken) @@ -440,8 +448,10 @@ public unsafe MdUtf8String GetNamespace(int mdToken) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetEventProps(IntPtr scope, int mdToken, out void* name, out int eventAttributes); + [RequiresUnsafe] public unsafe void GetEventProps(int mdToken, out void* name, out EventAttributes eventAttributes) { ThrowBadImageExceptionForHR(GetEventProps(m_metadataImport2, mdToken, out name, out int eventAttributesRaw)); @@ -458,8 +468,10 @@ public void GetFieldDefProps(int mdToken, out FieldAttributes fieldAttributes) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetPropertyProps(IntPtr scope, int mdToken, out void* name, out int propertyAttributes, out ConstArray signature); + [RequiresUnsafe] public unsafe void GetPropertyProps(int mdToken, out void* name, out PropertyAttributes propertyAttributes, out ConstArray signature) { ThrowBadImageExceptionForHR(GetPropertyProps(m_metadataImport2, mdToken, out name, out int propertyAttributesRaw, out signature)); @@ -602,6 +614,7 @@ public ConstArray GetFieldMarshal(int fieldToken) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetPInvokeMap(IntPtr scope, int token, out int attributes, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs index c3dbc2a73f2d6c..5d06bcfcf89177 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -9,6 +10,7 @@ namespace System.Reflection.Metadata public static partial class AssemblyExtensions { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalTryGetRawMetadata")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool InternalTryGetRawMetadata(QCallAssembly assembly, ref byte* blob, ref int length); @@ -28,6 +30,7 @@ public static partial class AssemblyExtensions /// The caller is responsible for keeping the assembly object alive while accessing the metadata blob. /// [CLSCompliant(false)] // out byte* blob + [RequiresUnsafe] public static unsafe bool TryGetRawMetadata(this Assembly assembly, out byte* blob, out int length) { ArgumentNullException.ThrowIfNull(assembly); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs index f0b6774ac45503..6dc9ced64de36e 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs @@ -11,6 +11,7 @@ namespace System.Reflection.Metadata public static partial class MetadataUpdater { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_ApplyUpdate")] + [RequiresUnsafe] private static unsafe partial void ApplyUpdate(QCallAssembly assembly, byte* metadataDelta, int metadataDeltaLength, byte* ilDelta, int ilDeltaLength, byte* pdbDelta, int pdbDeltaLength); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_IsApplyUpdateSupported")] diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs index 7bb6439468d192..48babc3ebc4a8e 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.CoreCLR.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Reflection.Emit; namespace System.Reflection @@ -29,9 +30,11 @@ internal unsafe MethodBaseInvoker(DynamicMethod method, Signature signature) : t _invokeFunc_RefArgs = InterpretedInvoke_Method; } + [RequiresUnsafe] private unsafe object? InterpretedInvoke_Constructor(object? obj, IntPtr* args) => RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: obj is null); + [RequiresUnsafe] private unsafe object? InterpretedInvoke_Method(object? obj, IntPtr* args) => RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: false); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodInvoker.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodInvoker.CoreCLR.cs index 644364a77266e2..ed74df63ac261b 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodInvoker.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MethodInvoker.CoreCLR.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Reflection.Emit; namespace System.Reflection @@ -30,9 +31,11 @@ private unsafe MethodInvoker(RuntimeConstructorInfo constructor) : this(construc _invocationFlags = constructor.ComputeAndUpdateInvocationFlags(); } + [RequiresUnsafe] private unsafe object? InterpretedInvoke_Method(object? obj, IntPtr* args) => RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: false); + [RequiresUnsafe] private unsafe object? InterpretedInvoke_Constructor(object? obj, IntPtr* args) => RuntimeMethodHandle.InvokeMethod(obj, (void**)args, _signature!, isConstructor: obj is null); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs index 48ebce7eb9e4cc..211da3c50b79c5 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs @@ -41,6 +41,7 @@ private sealed class ManifestResourceStream : UnmanagedMemoryStream // ensures the RuntimeAssembly is kept alive for as long as the stream lives private readonly RuntimeAssembly _manifestAssembly; + [RequiresUnsafe] internal unsafe ManifestResourceStream(RuntimeAssembly manifestAssembly, byte* pointer, long length, long capacity, FileAccess access) : base(pointer, length, capacity, access) { _manifestAssembly = manifestAssembly; @@ -267,6 +268,7 @@ public override bool IsCollectible // GetResource will return a pointer to the resources in memory. [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_GetResource", StringMarshalling = StringMarshalling.Utf16)] + [RequiresUnsafe] private static unsafe partial byte* GetResource(QCallAssembly assembly, string resourceName, out uint length); @@ -395,6 +397,7 @@ internal static unsafe RuntimeAssembly InternalLoad(AssemblyName assemblyName, } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AssemblyNative_InternalLoad")] + [RequiresUnsafe] private static unsafe partial void InternalLoad(NativeAssemblyNameParts* pAssemblyNameParts, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs index 06492be84dfd6b..b0a37eb1997d05 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs @@ -1835,6 +1835,7 @@ internal static object[] CreateAttributeArrayHelper(RuntimeType caType, int elem [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "CustomAttribute_ParseAttributeUsageAttribute")] [SuppressGCTransition] + [RequiresUnsafe] private static partial int ParseAttributeUsageAttribute( IntPtr pData, int cData, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs index 7fba80eb553206..118254da701297 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs @@ -131,6 +131,7 @@ internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName, } // Used by VM + [RequiresUnsafe] internal static unsafe RuntimeType? GetTypeHelper(char* pTypeName, RuntimeAssembly? requestingAssembly, bool throwOnError, bool requireAssemblyQualifiedName, IntPtr unsafeAccessorMethod) { diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs index 40bbcdc14db299..785704c5848980 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs @@ -234,12 +234,15 @@ public void CaptureContexts() #if !NATIVEAOT [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AsyncHelpers_AddContinuationToExInternal")] + [RequiresUnsafe] private static unsafe partial void AddContinuationToExInternal(void* diagnosticIP, ObjectHandleOnStack ex); + [RequiresUnsafe] internal static unsafe void AddContinuationToExInternal(void* diagnosticIP, Exception e) => AddContinuationToExInternal(diagnosticIP, ObjectHandleOnStack.Create(ref e)); #endif + [RequiresUnsafe] private static unsafe Continuation AllocContinuation(Continuation prevContinuation, MethodTable* contMT) { #if NATIVEAOT @@ -252,6 +255,7 @@ private static unsafe Continuation AllocContinuation(Continuation prevContinuati } #if !NATIVEAOT + [RequiresUnsafe] private static unsafe Continuation AllocContinuationMethod(Continuation prevContinuation, MethodTable* contMT, int keepAliveOffset, MethodDesc* method) { LoaderAllocator loaderAllocator = RuntimeMethodHandle.GetLoaderAllocator(new RuntimeMethodHandleInternal((IntPtr)method)); @@ -261,6 +265,7 @@ private static unsafe Continuation AllocContinuationMethod(Continuation prevCont return newContinuation; } + [RequiresUnsafe] private static unsafe Continuation AllocContinuationClass(Continuation prevContinuation, MethodTable* contMT, int keepAliveOffset, MethodTable* methodTable) { IntPtr loaderAllocatorHandle = methodTable->GetLoaderAllocatorHandle(); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs index d98b50f752b5be..785705d31abb07 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/CastHelpers.cs @@ -15,9 +15,11 @@ internal static unsafe partial class CastHelpers internal static int[]? s_table; [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThrowInvalidCastException")] + [RequiresUnsafe] private static partial void ThrowInvalidCastExceptionInternal(void* fromTypeHnd, void* toTypeHnd); [DoesNotReturn] + [RequiresUnsafe] internal static void ThrowInvalidCastException(void* fromTypeHnd, void* toTypeHnd) { ThrowInvalidCastExceptionInternal(fromTypeHnd, toTypeHnd); @@ -25,6 +27,7 @@ internal static void ThrowInvalidCastException(void* fromTypeHnd, void* toTypeHn } [DoesNotReturn] + [RequiresUnsafe] internal static void ThrowInvalidCastException(object fromType, void* toTypeHnd) { ThrowInvalidCastExceptionInternal(RuntimeHelpers.GetMethodTable(fromType), toTypeHnd); @@ -33,10 +36,12 @@ internal static void ThrowInvalidCastException(object fromType, void* toTypeHnd) } [LibraryImport(RuntimeHelpers.QCall)] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool IsInstanceOf_NoCacheLookup(void *toTypeHnd, [MarshalAs(UnmanagedType.Bool)] bool throwCastException, ObjectHandleOnStack obj); [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static object? IsInstanceOfAny_NoCacheLookup(void* toTypeHnd, object obj) { if (IsInstanceOf_NoCacheLookup(toTypeHnd, false, ObjectHandleOnStack.Create(ref obj))) @@ -47,6 +52,7 @@ internal static void ThrowInvalidCastException(object fromType, void* toTypeHnd) } [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) { IsInstanceOf_NoCacheLookup(toTypeHnd, true, ObjectHandleOnStack.Create(ref obj)); @@ -60,6 +66,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) // Unlike the IsInstanceOfInterface and IsInstanceOfClass functions, // this test must deal with all kinds of type tests [DebuggerHidden] + [RequiresUnsafe] internal static object? IsInstanceOfAny(void* toTypeHnd, object? obj) { if (obj != null) @@ -91,6 +98,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] + [RequiresUnsafe] private static object? IsInstanceOfInterface(void* toTypeHnd, object? obj) { const int unrollSize = 4; @@ -160,6 +168,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] + [RequiresUnsafe] private static object? IsInstanceOfClass(void* toTypeHnd, object? obj) { if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) @@ -211,6 +220,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static object? IsInstance_Helper(void* toTypeHnd, object obj) { CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); @@ -231,6 +241,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) // Unlike the ChkCastInterface and ChkCastClass functions, // this test must deal with all kinds of type tests [DebuggerHidden] + [RequiresUnsafe] internal static object? ChkCastAny(void* toTypeHnd, object? obj) { CastResult result; @@ -260,6 +271,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static object? ChkCast_Helper(void* toTypeHnd, object obj) { CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)toTypeHnd); @@ -273,6 +285,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] + [RequiresUnsafe] private static object? ChkCastInterface(void* toTypeHnd, object? obj) { const int unrollSize = 4; @@ -339,6 +352,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] + [RequiresUnsafe] private static object? ChkCastClass(void* toTypeHnd, object? obj) { if (obj == null || RuntimeHelpers.GetMethodTable(obj) == toTypeHnd) @@ -352,6 +366,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) // Optimized helper for classes. Assumes that the trivial cases // has been taken care of by the inlined check [DebuggerHidden] + [RequiresUnsafe] private static object? ChkCastClassSpecial(void* toTypeHnd, object obj) { MethodTable* mt = RuntimeHelpers.GetMethodTable(obj); @@ -398,6 +413,7 @@ private static object ChkCastAny_NoCacheLookup(void* toTypeHnd, object obj) } [DebuggerHidden] + [RequiresUnsafe] private static ref byte Unbox(MethodTable* toTypeHnd, object obj) { // This will throw NullReferenceException if obj is null. @@ -420,6 +436,7 @@ private static void ThrowArrayMismatchException() } [DebuggerHidden] + [RequiresUnsafe] private static ref object? LdelemaRef(object?[] array, nint index, void* type) { // This will throw NullReferenceException if array is null. @@ -470,6 +487,7 @@ private static void StelemRef(object?[] array, nint index, object? obj) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static void StelemRef_Helper(ref object? element, void* elementType, object obj) { CastResult result = CastCache.TryGet(s_table!, (nuint)RuntimeHelpers.GetMethodTable(obj), (nuint)elementType); @@ -483,6 +501,7 @@ private static void StelemRef_Helper(ref object? element, void* elementType, obj } [DebuggerHidden] + [RequiresUnsafe] private static void StelemRef_Helper_NoCacheLookup(ref object? element, void* elementType, object obj) { Debug.Assert(obj != null); @@ -515,6 +534,7 @@ private static void ArrayTypeCheck(object obj, Array array) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static void ArrayTypeCheck_Helper(object obj, void* elementType) { Debug.Assert(obj != null); @@ -527,6 +547,7 @@ private static void ArrayTypeCheck_Helper(object obj, void* elementType) // Helpers for boxing [DebuggerHidden] + [RequiresUnsafe] internal static object? Box_Nullable(MethodTable* srcMT, ref byte nullableData) { Debug.Assert(srcMT->IsNullable); @@ -543,6 +564,7 @@ private static void ArrayTypeCheck_Helper(object obj, void* elementType) } [DebuggerHidden] + [RequiresUnsafe] internal static object Box(MethodTable* typeMT, ref byte unboxedData) { Debug.Assert(typeMT != null); @@ -586,6 +608,7 @@ private static bool AreTypesEquivalent(MethodTable* pMTa, MethodTable* pMTb) [DebuggerHidden] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static bool IsNullableForType(MethodTable* typeMT, MethodTable* boxedMT) { if (!typeMT->IsNullable) @@ -614,6 +637,7 @@ internal static bool IsNullableForType(MethodTable* typeMT, MethodTable* boxedMT [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static void Unbox_Nullable_NotIsNullableForType(ref byte destPtr, MethodTable* typeMT, object obj) { // Also allow true nullables to be unboxed normally. @@ -626,6 +650,7 @@ private static void Unbox_Nullable_NotIsNullableForType(ref byte destPtr, Method } [DebuggerHidden] + [RequiresUnsafe] internal static void Unbox_Nullable(ref byte destPtr, MethodTable* typeMT, object? obj) { if (obj == null) @@ -660,6 +685,7 @@ internal static void Unbox_Nullable(ref byte destPtr, MethodTable* typeMT, objec } [DebuggerHidden] + [RequiresUnsafe] internal static object? ReboxFromNullable(MethodTable* srcMT, object src) { ref byte nullableData = ref src.GetRawData(); @@ -668,6 +694,7 @@ internal static void Unbox_Nullable(ref byte destPtr, MethodTable* typeMT, objec [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static ref byte Unbox_Helper(MethodTable* pMT1, object obj) { // must be a value type @@ -689,6 +716,7 @@ private static ref byte Unbox_Helper(MethodTable* pMT1, object obj) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static void Unbox_TypeTest_Helper(MethodTable *pMT1, MethodTable *pMT2) { if ((!pMT1->IsPrimitive || !pMT2->IsPrimitive || @@ -703,6 +731,7 @@ private static void Unbox_TypeTest_Helper(MethodTable *pMT1, MethodTable *pMT2) } [DebuggerHidden] + [RequiresUnsafe] private static void Unbox_TypeTest(MethodTable *pMT1, MethodTable *pMT2) { if (pMT1 == pMT2) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericsHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericsHelpers.cs index 3d719604f4337a..196cd56be5130f 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericsHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/GenericsHelpers.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Runtime.CompilerServices; @@ -28,6 +29,7 @@ public static IntPtr Method(IntPtr methodHnd, IntPtr signature) } [DebuggerHidden] + [RequiresUnsafe] public static IntPtr MethodWithSlotAndModule(IntPtr methodHnd, GenericHandleArgs * pArgs) { return GenericHandleWorker(methodHnd, IntPtr.Zero, pArgs->signature, pArgs->dictionaryIndexAndSlot, pArgs->module); @@ -40,6 +42,7 @@ public static IntPtr Class(IntPtr classHnd, IntPtr signature) } [DebuggerHidden] + [RequiresUnsafe] public static IntPtr ClassWithSlotAndModule(IntPtr classHnd, GenericHandleArgs * pArgs) { return GenericHandleWorker(IntPtr.Zero, classHnd, pArgs->signature, pArgs->dictionaryIndexAndSlot, pArgs->module); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/InitHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/InitHelpers.cs index 55d66f8a1a9ba0..456ada4aeaded1 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/InitHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/InitHelpers.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Runtime.CompilerServices @@ -11,16 +12,19 @@ namespace System.Runtime.CompilerServices internal static unsafe partial class InitHelpers { [LibraryImport(RuntimeHelpers.QCall)] + [RequiresUnsafe] private static partial void InitClassHelper(MethodTable* mt); [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] internal static void InitClassSlow(MethodTable* mt) { InitClassHelper(mt); } [DebuggerHidden] + [RequiresUnsafe] private static void InitClass(MethodTable* mt) { if (mt->AuxiliaryData->IsClassInited) @@ -30,6 +34,7 @@ private static void InitClass(MethodTable* mt) } [DebuggerHidden] + [RequiresUnsafe] private static void InitInstantiatedClass(MethodTable* mt, MethodDesc* methodDesc) { MethodTable *pTemplateMT = methodDesc->MethodTable; diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs index a5fa643f472472..20bb42c4198b3d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.CoreCLR.cs @@ -198,6 +198,7 @@ public static void RunModuleConstructor(ModuleHandle module) internal static partial void CompileMethod(RuntimeMethodHandleInternal method); [LibraryImport(QCall, EntryPoint = "ReflectionInvocation_PrepareMethod")] + [RequiresUnsafe] private static unsafe partial void PrepareMethod(RuntimeMethodHandleInternal method, IntPtr* pInstantiation, int cInstantiation); public static void PrepareMethod(RuntimeMethodHandle method) => PrepareMethod(method, null); @@ -447,6 +448,7 @@ internal static unsafe bool ObjectHasComponentSize(object obj) /// A reference to the data to box. /// A boxed instance of the value at . /// This method includes proper handling for nullable value types as well. + [RequiresUnsafe] internal static unsafe object? Box(MethodTable* methodTable, ref byte data) => methodTable->IsNullable ? CastHelpers.Box_Nullable(methodTable, ref data) : CastHelpers.Box(methodTable, ref data); @@ -462,9 +464,11 @@ internal static unsafe bool ObjectHasComponentSize(object obj) // GC.KeepAlive(o); // [Intrinsic] + [RequiresUnsafe] internal static unsafe MethodTable* GetMethodTable(object obj) => GetMethodTable(obj); [LibraryImport(QCall, EntryPoint = "MethodTable_AreTypesEquivalent")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool AreTypesEquivalent(MethodTable* pMTa, MethodTable* pMTb); @@ -519,9 +523,11 @@ public static IntPtr AllocateTypeAssociatedMemory(Type type, int size, int align private static partial IntPtr AllocateTypeAssociatedMemoryAligned(QCallTypeHandle type, uint size, uint alignment); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe TailCallArgBuffer* GetTailCallArgBuffer(); [LibraryImport(QCall, EntryPoint = "TailCallHelp_AllocTailCallArgBufferInternal")] + [RequiresUnsafe] private static unsafe partial TailCallArgBuffer* AllocTailCallArgBufferInternal(int size); private const int TAILCALLARGBUFFER_ACTIVE = 0; @@ -529,6 +535,7 @@ public static IntPtr AllocateTypeAssociatedMemory(Type type, int size, int align private const int TAILCALLARGBUFFER_INACTIVE = 2; [MethodImpl(MethodImplOptions.AggressiveInlining)] // To allow unrolling of Span.Clear + [RequiresUnsafe] private static unsafe TailCallArgBuffer* AllocTailCallArgBuffer(int size, IntPtr gcDesc) { TailCallArgBuffer* buffer = GetTailCallArgBuffer(); @@ -558,9 +565,11 @@ public static IntPtr AllocateTypeAssociatedMemory(Type type, int size, int align } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe TailCallTls* GetTailCallInfo(IntPtr retAddrSlot, IntPtr* retAddr); [StackTraceHidden] + [RequiresUnsafe] private static unsafe void DispatchTailCalls( IntPtr callersRetAddrSlot, delegate* callTarget, @@ -643,6 +652,7 @@ public static int SizeOf(RuntimeTypeHandle type) } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void CallToString(object* pObj, string* pResult, Exception* pException) { try @@ -695,8 +705,10 @@ internal unsafe struct MethodDesc [MethodImpl(MethodImplOptions.AggressiveInlining)] [DebuggerHidden] [DebuggerStepThrough] + [RequiresUnsafe] private MethodDescChunk* GetMethodDescChunk() => (MethodDescChunk*)(((byte*)Unsafe.AsPointer(ref this)) - (sizeof(MethodDescChunk) + ChunkIndex * sizeof(IntPtr))); + [RequiresUnsafe] public MethodTable* MethodTable => GetMethodDescChunk()->MethodTable; } @@ -888,6 +900,7 @@ internal unsafe struct MethodTable public bool IsCollectible => (Flags & enum_flag_Collectible) != 0; + [RequiresUnsafe] internal static bool AreSameType(MethodTable* mt1, MethodTable* mt2) => mt1 == mt2; public bool HasDefaultConstructor => (Flags & (enum_flag_HasComponentSize | enum_flag_HasDefaultCtor)) == enum_flag_HasDefaultCtor; @@ -991,9 +1004,11 @@ public TypeHandle GetArrayElementTypeHandle() /// Get the MethodTable in the type hierarchy of this MethodTable that has the same TypeDef/Module as parent. /// [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] public extern MethodTable* GetMethodTableMatchingParentClass(MethodTable* parent); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] public extern MethodTable* InstantiationArg0(); [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1176,6 +1191,7 @@ internal readonly unsafe partial struct TypeHandle private readonly void* m_asTAddr; [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public TypeHandle(void* tAddr) { m_asTAddr = tAddr; @@ -1201,6 +1217,7 @@ public bool IsTypeDesc /// /// This is only safe to call if returned . [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public MethodTable* AsMethodTable() { Debug.Assert(!IsTypeDesc); @@ -1213,6 +1230,7 @@ public bool IsTypeDesc /// /// This is only safe to call if returned . [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public TypeDesc* AsTypeDesc() { Debug.Assert(IsTypeDesc); @@ -1285,10 +1303,12 @@ private static bool CanCastToWorker(TypeHandle srcTH, TypeHandle destTH, bool nu } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeHandle_CanCastTo_NoCacheLookup")] + [RequiresUnsafe] private static partial Interop.BOOL CanCastTo_NoCacheLookup(void* fromTypeHnd, void* toTypeHnd); [SuppressGCTransition] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeHandle_GetCorElementType")] + [RequiresUnsafe] private static partial int GetCorElementType(void* typeHnd); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/StaticsHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/StaticsHelpers.cs index 61817463f40458..eedcb4476a7df7 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/StaticsHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/StaticsHelpers.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Runtime.CompilerServices @@ -14,6 +15,7 @@ internal static unsafe partial class StaticsHelpers private static partial void GetThreadStaticsByIndex(ByteRefOnStack result, int index, [MarshalAs(UnmanagedType.Bool)] bool gcStatics); [LibraryImport(RuntimeHelpers.QCall)] + [RequiresUnsafe] private static partial void GetThreadStaticsByMethodTable(ByteRefOnStack result, MethodTable* pMT, [MarshalAs(UnmanagedType.Bool)] bool gcStatics); [Intrinsic] @@ -21,6 +23,7 @@ internal static unsafe partial class StaticsHelpers [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static ref byte GetNonGCStaticBaseSlow(MethodTable* mt) { InitHelpers.InitClassSlow(mt); @@ -28,6 +31,7 @@ private static ref byte GetNonGCStaticBaseSlow(MethodTable* mt) } [DebuggerHidden] + [RequiresUnsafe] private static ref byte GetNonGCStaticBase(MethodTable* mt) { ref byte nonGCStaticBase = ref VolatileReadAsByref(ref mt->AuxiliaryData->GetDynamicStaticsInfo()._pNonGCStatics); @@ -39,6 +43,7 @@ private static ref byte GetNonGCStaticBase(MethodTable* mt) } [DebuggerHidden] + [RequiresUnsafe] private static ref byte GetDynamicNonGCStaticBase(DynamicStaticsInfo* dynamicStaticsInfo) { ref byte nonGCStaticBase = ref VolatileReadAsByref(ref dynamicStaticsInfo->_pNonGCStatics); @@ -51,6 +56,7 @@ private static ref byte GetDynamicNonGCStaticBase(DynamicStaticsInfo* dynamicSta [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static ref byte GetGCStaticBaseSlow(MethodTable* mt) { InitHelpers.InitClassSlow(mt); @@ -58,6 +64,7 @@ private static ref byte GetGCStaticBaseSlow(MethodTable* mt) } [DebuggerHidden] + [RequiresUnsafe] private static ref byte GetGCStaticBase(MethodTable* mt) { ref byte gcStaticBase = ref VolatileReadAsByref(ref mt->AuxiliaryData->GetDynamicStaticsInfo()._pGCStatics); @@ -69,6 +76,7 @@ private static ref byte GetGCStaticBase(MethodTable* mt) } [DebuggerHidden] + [RequiresUnsafe] private static ref byte GetDynamicGCStaticBase(DynamicStaticsInfo* dynamicStaticsInfo) { ref byte gcStaticBase = ref VolatileReadAsByref(ref dynamicStaticsInfo->_pGCStatics); @@ -154,6 +162,7 @@ private static ref byte GetGCThreadStaticsByIndexSlow(int index) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static ref byte GetNonGCThreadStaticBaseSlow(MethodTable* mt) { ByteRef result = default; @@ -163,6 +172,7 @@ private static ref byte GetNonGCThreadStaticBaseSlow(MethodTable* mt) [DebuggerHidden] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private static ref byte GetGCThreadStaticBaseSlow(MethodTable* mt) { ByteRef result = default; @@ -218,6 +228,7 @@ private static ref byte GetThreadLocalStaticBaseByIndex(int index, bool gcStatic } [DebuggerHidden] + [RequiresUnsafe] private static ref byte GetNonGCThreadStaticBase(MethodTable* mt) { int index = mt->AuxiliaryData->GetThreadStaticsInfo()._nonGCTlsIndex; @@ -228,6 +239,7 @@ private static ref byte GetNonGCThreadStaticBase(MethodTable* mt) } [DebuggerHidden] + [RequiresUnsafe] private static ref byte GetGCThreadStaticBase(MethodTable* mt) { int index = mt->AuxiliaryData->GetThreadStaticsInfo()._gcTlsIndex; @@ -238,6 +250,7 @@ private static ref byte GetGCThreadStaticBase(MethodTable* mt) } [DebuggerHidden] + [RequiresUnsafe] private static ref byte GetDynamicNonGCThreadStaticBase(ThreadStaticsInfo* threadStaticsInfo) { int index = threadStaticsInfo->_nonGCTlsIndex; @@ -248,6 +261,7 @@ private static ref byte GetDynamicNonGCThreadStaticBase(ThreadStaticsInfo* threa } [DebuggerHidden] + [RequiresUnsafe] private static ref byte GetDynamicGCThreadStaticBase(ThreadStaticsInfo* threadStaticsInfo) { int index = threadStaticsInfo->_gcTlsIndex; @@ -278,12 +292,14 @@ private struct StaticFieldAddressArgs } [DebuggerHidden] + [RequiresUnsafe] private static unsafe ref byte StaticFieldAddress_Dynamic(StaticFieldAddressArgs* pArgs) { return ref Unsafe.Add(ref pArgs->staticBaseHelper(pArgs->arg0), pArgs->offset); } [DebuggerHidden] + [RequiresUnsafe] private static unsafe ref byte StaticFieldAddressUnbox_Dynamic(StaticFieldAddressArgs* pArgs) { object boxedObject = Unsafe.As(ref Unsafe.Add(ref pArgs->staticBaseHelper(pArgs->arg0), pArgs->offset)); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/ExceptionServices/InternalCalls.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/ExceptionServices/InternalCalls.cs index 8a78ae2452e9a3..c862fc7d6505ef 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/ExceptionServices/InternalCalls.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/ExceptionServices/InternalCalls.cs @@ -6,6 +6,7 @@ // using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -15,32 +16,38 @@ internal static partial class InternalCalls { [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "SfiInit")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpSfiInit(ref StackFrameIterator pThis, void* pStackwalkCtx, [MarshalAs(UnmanagedType.U1)] bool instructionFault, bool* fIsExceptionIntercepted); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "SfiNext")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpSfiNext(ref StackFrameIterator pThis, uint* uExCollideClauseIdx, bool* fUnwoundReversePInvoke, bool* fIsExceptionIntercepted); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "CallFilterFunclet")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpCallFilterFunclet( ObjectHandleOnStack exceptionObj, byte* pFilterIP, void* pvRegDisplay); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "AppendExceptionStackFrame")] + [RequiresUnsafe] internal static unsafe partial void RhpAppendExceptionStackFrame(ObjectHandleOnStack exceptionObj, IntPtr ip, UIntPtr sp, int flags, EH.ExInfo* exInfo); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EHEnumInitFromStackFrameIterator")] [SuppressGCTransition] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpEHEnumInitFromStackFrameIterator(ref StackFrameIterator pFrameIter, out EH.MethodRegionInfo pMethodRegionInfo, void* pEHEnum); [StackTraceHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EHEnumNext")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.U1)] internal static unsafe partial bool RhpEHEnumNext(void* pEHEnum, void* pEHClause); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreCLR.cs index 728be79fcf4e5b..cde042607e20d8 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.CoreCLR.cs @@ -5,6 +5,7 @@ using System.Runtime.CompilerServices; using System.Collections.Generic; using System.Collections.Concurrent; +using System.Diagnostics.CodeAnalysis; namespace System.Runtime.InteropServices { @@ -26,6 +27,7 @@ public static void GetIUnknownImpl(out IntPtr fpQueryInterface, out IntPtr fpAdd [SuppressGCTransition] private static partial void GetIUnknownImplInternal(out IntPtr fpQueryInterface, out IntPtr fpAddRef, out IntPtr fpRelease); + [RequiresUnsafe] internal static unsafe void GetUntrackedIUnknownImpl(out delegate* unmanaged[MemberFunction] fpAddRef, out delegate* unmanaged[MemberFunction] fpRelease) { fpAddRef = fpRelease = GetUntrackedAddRefRelease(); @@ -33,6 +35,7 @@ internal static unsafe void GetUntrackedIUnknownImpl(out delegate* unmanaged[Mem [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ComWrappers_GetUntrackedAddRefRelease")] [SuppressGCTransition] + [RequiresUnsafe] private static unsafe partial delegate* unmanaged[MemberFunction] GetUntrackedAddRefRelease(); internal static IntPtr DefaultIUnknownVftblPtr { get; } = CreateDefaultIUnknownVftbl(); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs index ccef0dc39fea33..8d590990e797e2 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.Versioning; @@ -37,6 +38,7 @@ public static partial class JavaMarshal /// runtime code when cross-reference marking is required. /// Additionally, this callback must be implemented in unmanaged code. /// + [RequiresUnsafe] public static unsafe void Initialize(delegate* unmanaged markCrossReferences) { ArgumentNullException.ThrowIfNull(markCrossReferences); @@ -61,6 +63,7 @@ public static unsafe void Initialize(delegate* unmanagedA that represents the allocated reference-tracking handle. /// is null. /// The runtime or platform does not support Java cross-reference marshalling. + [RequiresUnsafe] public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* context) { ArgumentNullException.ThrowIfNull(obj); @@ -81,6 +84,7 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co /// The returned pointer is the exact value that was originally provided as /// the context parameter when the handle was created. /// + [RequiresUnsafe] public static unsafe void* GetContext(GCHandle obj) { IntPtr handle = GCHandle.ToIntPtr(obj); @@ -102,6 +106,7 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co /// A pointer to the structure containing cross-reference information produced during marking. /// A span of values that were determined to be unreachable from the native side. /// The runtime or platform does not support Java cross-reference marshalling. + [RequiresUnsafe] public static unsafe void FinishCrossReferenceProcessing( MarkCrossReferencesArgs* crossReferences, ReadOnlySpan unreachableObjectHandles) @@ -120,13 +125,16 @@ public static unsafe void FinishCrossReferenceProcessing( private static partial bool InitializeInternal(IntPtr callback); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "JavaMarshal_CreateReferenceTrackingHandle")] + [RequiresUnsafe] private static unsafe partial IntPtr CreateReferenceTrackingHandleInternal(ObjectHandleOnStack obj, void* context); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "JavaMarshal_FinishCrossReferenceProcessing")] + [RequiresUnsafe] private static unsafe partial void FinishCrossReferenceProcessing(MarkCrossReferencesArgs* crossReferences, nuint length, void* unreachableObjectHandles); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "JavaMarshal_GetContext")] [SuppressGCTransition] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool GetContextInternal(IntPtr handle, out void* context); } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs index d7894da107dd14..ee8a9345e2de36 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.CoreCLR.cs @@ -327,6 +327,7 @@ public static unsafe void DestroyStructure(IntPtr ptr, Type structuretype) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_TryGetStructMarshalStub")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool TryGetStructMarshalStub(IntPtr th, delegate** structMarshalStub, nuint* size); @@ -992,6 +993,7 @@ internal static IntPtr GetFunctionPointerForDelegateInternal(Delegate d) #if DEBUG // Used for testing in Checked or Debug [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MarshalNative_GetIsInCooperativeGCModeFunctionPointer")] + [RequiresUnsafe] internal static unsafe partial delegate* unmanaged GetIsInCooperativeGCModeFunctionPointer(); #endif } diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs index baee8db37dd8a0..7e9d558c00dd57 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeHandles.cs @@ -67,6 +67,7 @@ internal static unsafe RuntimeType GetRuntimeTypeFromHandle(IntPtr handle) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe RuntimeType GetRuntimeType(MethodTable* pMT) { return pMT->AuxiliaryData->ExposedClassObject ?? GetRuntimeTypeFromHandleSlow((IntPtr)pMT); @@ -275,12 +276,14 @@ internal static object CreateInstanceForAnotherGenericParameter( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_CreateInstanceForAnotherGenericParameter")] + [RequiresUnsafe] private static partial void CreateInstanceForAnotherGenericParameter( QCallTypeHandle baseType, IntPtr* pTypeHandles, int cTypeHandles, ObjectHandleOnStack instantiatedObject); + [RequiresUnsafe] internal static unsafe object InternalAlloc(MethodTable* pMT) { object? result = null; @@ -297,10 +300,12 @@ internal static object InternalAlloc(RuntimeType type) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_InternalAlloc")] + [RequiresUnsafe] private static unsafe partial void InternalAlloc(MethodTable* pMT, ObjectHandleOnStack result); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static object InternalAllocNoChecks(MethodTable* pMT) { return InternalAllocNoChecks_FastPath(pMT) ?? InternalAllocNoChecksWorker(pMT); @@ -315,9 +320,11 @@ static object InternalAllocNoChecksWorker(MethodTable* pMT) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_InternalAllocNoChecks")] + [RequiresUnsafe] private static unsafe partial void InternalAllocNoChecks(MethodTable* pMT, ObjectHandleOnStack result); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern object? InternalAllocNoChecks_FastPath(MethodTable* pMT); /// @@ -325,6 +332,7 @@ static object InternalAllocNoChecksWorker(MethodTable* pMT) /// semantics. This method will ensure the type object is fully initialized within /// the VM, but it will not call any static ctors on the type. /// + [RequiresUnsafe] internal static void GetActivationInfo( RuntimeType rt, out delegate* pfnAllocator, @@ -354,6 +362,7 @@ internal static void GetActivationInfo( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetActivationInfo")] + [RequiresUnsafe] private static partial void GetActivationInfo( ObjectHandleOnStack pRuntimeType, delegate** ppfnAllocator, @@ -458,6 +467,7 @@ public ModuleHandle GetModuleHandle() internal static extern int GetToken(RuntimeType type); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetMethodAt")] + [RequiresUnsafe] private static unsafe partial IntPtr GetMethodAt(MethodTable* pMT, int slot); internal static RuntimeMethodHandleInternal GetMethodAt(RuntimeType type, int slot) @@ -536,6 +546,7 @@ internal static IntroducedMethodEnumerator GetIntroducedMethods(RuntimeType type private static extern void GetNextIntroducedMethod(ref RuntimeMethodHandleInternal method); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetFields")] + [RequiresUnsafe] private static partial Interop.BOOL GetFields(MethodTable* pMT, Span data, ref int usedCount); internal static bool GetFields(RuntimeType type, Span buffer, out int count) @@ -557,6 +568,7 @@ internal static bool GetFields(RuntimeType type, Span buffer, out int co } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_GetInterfaces")] + [RequiresUnsafe] private static unsafe partial void GetInterfaces(MethodTable* pMT, ObjectHandleOnStack result); internal static Type[] GetInterfaces(RuntimeType type) @@ -659,6 +671,7 @@ internal string ConstructName(TypeNameFormatFlags formatFlags) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe void* GetUtf8NameInternal(MethodTable* pMT); // Since the returned string is a pointer into metadata, the caller should @@ -753,6 +766,7 @@ internal RuntimeType[] GetInstantiationInternal() } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_Instantiate")] + [RequiresUnsafe] private static partial void Instantiate(QCallTypeHandle handle, IntPtr* pInst, int numGenericArgs, ObjectHandleOnStack type); internal RuntimeType Instantiate(RuntimeType inst) @@ -814,6 +828,7 @@ internal RuntimeType MakeByRef() } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeTypeHandle_MakeFunctionPointer")] + [RequiresUnsafe] private static partial void MakeFunctionPointer(nint* retAndParamTypes, int numArgs, [MarshalAs(UnmanagedType.Bool)] bool isUnmanaged, ObjectHandleOnStack type); internal RuntimeType MakeFunctionPointer(Type[] parameterTypes, bool isUnmanaged) @@ -1109,6 +1124,7 @@ internal static string ConstructInstantiation(IRuntimeMethodInfo method, TypeNam } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe MethodTable* GetMethodTable(RuntimeMethodHandleInternal method); internal static unsafe RuntimeType GetDeclaringType(RuntimeMethodHandleInternal method) @@ -1160,6 +1176,7 @@ internal static string GetName(IRuntimeMethodInfo method) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern void* GetUtf8NameInternal(RuntimeMethodHandleInternal method); // Since the returned string is a pointer into metadata, the caller should @@ -1178,10 +1195,12 @@ internal static MdUtf8String GetUtf8Name(RuntimeMethodHandleInternal method) [DebuggerStepThrough] [DebuggerHidden] [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeMethodHandle_InvokeMethod")] + [RequiresUnsafe] private static partial void InvokeMethod(ObjectHandleOnStack target, void** arguments, ObjectHandleOnStack sig, Interop.BOOL isConstructor, ObjectHandleOnStack result); [DebuggerStepThrough] [DebuggerHidden] + [RequiresUnsafe] internal static object? InvokeMethod(object? target, void** arguments, Signature sig, bool isConstructor) { object? result = null; @@ -1522,6 +1541,7 @@ internal static string GetName(IRuntimeFieldInfo field) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern void* GetUtf8NameInternal(RuntimeFieldHandleInternal field); // Since the returned string is a pointer into metadata, the caller should @@ -1541,6 +1561,7 @@ internal static MdUtf8String GetUtf8Name(RuntimeFieldHandleInternal field) internal static extern FieldAttributes GetAttributes(RuntimeFieldHandleInternal field); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern MethodTable* GetApproxDeclaringMethodTable(RuntimeFieldHandleInternal field); internal static RuntimeType GetApproxDeclaringType(RuntimeFieldHandleInternal field) @@ -1569,6 +1590,7 @@ internal static RuntimeType GetApproxDeclaringType(IRuntimeFieldInfo field) internal static extern IntPtr GetStaticFieldAddress(RtFieldInfo field); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeFieldHandle_GetRVAFieldInfo")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] internal static partial bool GetRVAFieldInfo(RuntimeFieldHandleInternal field, out void* address, out uint size); @@ -1624,6 +1646,7 @@ private static partial void GetValue( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeFieldHandle_GetValueDirect")] + [RequiresUnsafe] private static partial void GetValueDirect( IntPtr fieldDesc, void* pTypedRef, @@ -1665,6 +1688,7 @@ internal static void SetValue(RtFieldInfo field, object? obj, object? value, Run } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeFieldHandle_SetValueDirect")] + [RequiresUnsafe] private static partial void SetValueDirect( IntPtr fieldDesc, void* pTypedRef, @@ -1684,6 +1708,7 @@ internal static void SetValueDirect(RtFieldInfo field, RuntimeType fieldType, Ty } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, MethodTable* pMT); internal static RuntimeFieldHandleInternal GetStaticFieldForGenericType(RuntimeFieldHandleInternal field, RuntimeType declaringType) @@ -1718,12 +1743,14 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeFieldHandle_GetEnCFieldAddr")] + [RequiresUnsafe] private static partial void* GetEnCFieldAddr(ObjectHandleOnStack tgt, void* pFD); // implementation of CORINFO_HELP_GETFIELDADDR [StackTraceHidden] [DebuggerStepThrough] [DebuggerHidden] + [RequiresUnsafe] internal static unsafe void* GetFieldAddr(object tgt, void* pFD) { void* addr = GetEnCFieldAddr(ObjectHandleOnStack.Create(ref tgt), pFD); @@ -1736,6 +1763,7 @@ public void GetObjectData(SerializationInfo info, StreamingContext context) [StackTraceHidden] [DebuggerStepThrough] [DebuggerHidden] + [RequiresUnsafe] internal static unsafe void* GetStaticFieldAddr(void* pFD) { object? nullTarget = null; @@ -1882,6 +1910,7 @@ public RuntimeTypeHandle ResolveTypeHandle(int typeToken, RuntimeTypeHandle[]? t } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveType")] + [RequiresUnsafe] private static partial void ResolveType(QCallModule module, int typeToken, IntPtr* typeInstArgs, @@ -1934,6 +1963,7 @@ internal static RuntimeMethodHandleInternal ResolveMethodHandleInternal(RuntimeM } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveMethod")] + [RequiresUnsafe] private static partial RuntimeMethodHandleInternal ResolveMethod(QCallModule module, int methodToken, IntPtr* typeInstArgs, @@ -1988,6 +2018,7 @@ public RuntimeFieldHandle ResolveFieldHandle(int fieldToken, RuntimeTypeHandle[] } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_ResolveField")] + [RequiresUnsafe] private static partial void ResolveField(QCallModule module, int fieldToken, IntPtr* typeInstArgs, @@ -2007,6 +2038,7 @@ internal static RuntimeType GetModuleType(RuntimeModule module) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ModuleHandle_GetPEKind")] + [RequiresUnsafe] private static partial void GetPEKind(QCallModule handle, int* peKind, int* machine); // making this internal, used by Module.GetPEKind @@ -2050,6 +2082,7 @@ internal sealed unsafe partial class Signature #endregion [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Signature_Init")] + [RequiresUnsafe] private static partial void Init( ObjectHandleOnStack _this, void* pCorSig, int cCorSig, @@ -2057,6 +2090,7 @@ private static partial void Init( RuntimeMethodHandleInternal methodHandle); [MemberNotNull(nameof(_returnTypeORfieldType))] + [RequiresUnsafe] private void Init( void* pCorSig, int cCorSig, RuntimeFieldHandleInternal fieldHandle, @@ -2102,6 +2136,7 @@ public Signature(IRuntimeFieldInfo fieldHandle, RuntimeType declaringType) GC.KeepAlive(fieldHandle); } + [RequiresUnsafe] public Signature(void* pCorSig, int cCorSig, RuntimeType declaringType) { _declaringType = declaringType; @@ -2123,6 +2158,7 @@ internal RuntimeType[] Arguments internal RuntimeType FieldType => _returnTypeORfieldType; [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "Signature_AreEqual")] + [RequiresUnsafe] private static partial Interop.BOOL AreEqual( void* sig1, int csig1, QCallTypeHandle type1, void* sig2, int csig2, QCallTypeHandle type2); @@ -2135,6 +2171,7 @@ internal static bool AreEqual(Signature sig1, Signature sig2) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetParameterOffsetInternal(void* sig, int csig, int parameterIndex); internal int GetParameterOffset(int parameterIndex) @@ -2147,6 +2184,7 @@ internal int GetParameterOffset(int parameterIndex) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetTypeParameterOffsetInternal(void* sig, int csig, int offset, int index); internal int GetTypeParameterOffset(int offset, int index) @@ -2165,6 +2203,7 @@ internal int GetTypeParameterOffset(int offset, int index) } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int GetCallingConventionFromFunctionPointerAtOffsetInternal(void* sig, int csig, int offset); internal SignatureCallingConvention GetCallingConventionFromFunctionPointerAtOffset(int offset) @@ -2222,6 +2261,7 @@ internal struct CORINFO_EH_CLAUSE internal abstract RuntimeType? GetJitContext(out int securityControlFlags); internal abstract byte[] GetCodeInfo(out int stackSize, out int initLocals, out int EHCount); internal abstract byte[] GetLocalsSignature(); + [RequiresUnsafe] internal abstract unsafe void GetEHInfo(int EHNumber, void* exception); internal abstract byte[]? GetRawEHInfo(); // token resolution @@ -2232,6 +2272,7 @@ internal struct CORINFO_EH_CLAUSE internal abstract MethodInfo GetDynamicMethod(); [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void GetJitContext(Resolver* pResolver, int* pSecurityControlFlags, RuntimeType* ppResult, Exception* pException) { try @@ -2245,6 +2286,7 @@ internal static unsafe void GetJitContext(Resolver* pResolver, int* pSecurityCon } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void GetCodeInfo(Resolver* pResolver, int* pStackSize, int* pInitLocals, int* pEHCount, byte[]* ppResult, Exception* pException) { try @@ -2258,6 +2300,7 @@ internal static unsafe void GetCodeInfo(Resolver* pResolver, int* pStackSize, in } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void GetLocalsSignature(Resolver* pResolver, byte[]* ppResult, Exception* pException) { try @@ -2271,6 +2314,7 @@ internal static unsafe void GetLocalsSignature(Resolver* pResolver, byte[]* ppRe } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void GetStringLiteral(Resolver* pResolver, int token, string* ppResult, Exception* pException) { try @@ -2284,6 +2328,7 @@ internal static unsafe void GetStringLiteral(Resolver* pResolver, int token, str } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void ResolveToken(Resolver* pResolver, int token, IntPtr* pTypeHandle, IntPtr* pMethodHandle, IntPtr* pFieldHandle, Exception* pException) { try @@ -2297,6 +2342,7 @@ internal static unsafe void ResolveToken(Resolver* pResolver, int token, IntPtr* } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void ResolveSignature(Resolver* pResolver, int token, int fromMethod, byte[]* ppResult, Exception* pException) { try @@ -2310,6 +2356,7 @@ internal static unsafe void ResolveSignature(Resolver* pResolver, int token, int } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void GetEHInfo(Resolver* pResolver, int EHNumber, byte[]* ppRawEHInfo, void* parsedEHInfo, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.BoxCache.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.BoxCache.cs index b4c49c3a3ba34d..169d26a76cde88 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.BoxCache.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.BoxCache.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -104,6 +105,7 @@ private BoxCache(RuntimeType rt) /// Given a RuntimeType, returns information about how to box instances /// of it via calli semantics. /// + [RequiresUnsafe] private static void GetBoxInfo( RuntimeType rt, out delegate* pfnAllocator, @@ -130,6 +132,7 @@ private static void GetBoxInfo( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_GetBoxInfo")] + [RequiresUnsafe] private static partial void GetBoxInfo( QCallTypeHandle type, delegate** ppfnAllocator, diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs index 4ad338f0dc6a6d..9b8f2d0268c7a0 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs @@ -150,6 +150,7 @@ private readonly struct Filter private readonly MdUtf8String m_name; private readonly MemberListType m_listType; + [RequiresUnsafe] public unsafe Filter(byte* pUtf8Name, int cUtf8Name, MemberListType listType) { m_name = new MdUtf8String(pUtf8Name, cUtf8Name); @@ -3415,6 +3416,7 @@ public override unsafe Guid GUID } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionInvocation_GetGuid")] + [RequiresUnsafe] private static unsafe partial void GetGuid(MethodTable* pMT, Guid* result); #if FEATURE_COMINTEROP @@ -4342,12 +4344,14 @@ private enum DispatchWrapperType : int internal readonly unsafe partial struct MdUtf8String { [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MdUtf8String_EqualsCaseInsensitive")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static partial bool EqualsCaseInsensitive(void* szLhs, void* szRhs, int cSz); private readonly byte* m_pStringHeap; // This is the raw UTF8 string. private readonly int m_StringHeapByteLength; + [RequiresUnsafe] internal MdUtf8String(void* pStringHeap) { byte* pStringBytes = (byte*)pStringHeap; @@ -4363,6 +4367,7 @@ internal MdUtf8String(void* pStringHeap) m_pStringHeap = pStringBytes; } + [RequiresUnsafe] internal MdUtf8String(byte* pUtf8String, int cUtf8String) { m_pStringHeap = pUtf8String; diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CreateUninitializedCache.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CreateUninitializedCache.CoreCLR.cs index e70078403f89c7..a370eafa5330b5 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CreateUninitializedCache.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CreateUninitializedCache.CoreCLR.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -56,6 +57,7 @@ internal object CreateUninitializedObject(RuntimeType rt) /// Given a RuntimeType, returns information about how to create uninitialized instances /// of it via calli semantics. /// + [RequiresUnsafe] private static void GetCreateUninitializedInfo( RuntimeType rt, out delegate* pfnAllocator, @@ -75,6 +77,7 @@ private static void GetCreateUninitializedInfo( } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ReflectionSerialization_GetCreateUninitializedObjectInfo")] + [RequiresUnsafe] private static partial void GetCreateUninitializedInfo( QCallTypeHandle type, delegate** ppfnAllocator, diff --git a/src/coreclr/System.Private.CoreLib/src/System/StartupHookProvider.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/StartupHookProvider.CoreCLR.cs index c265f91064a843..3cefd78c0e88f8 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/StartupHookProvider.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/StartupHookProvider.CoreCLR.cs @@ -14,6 +14,7 @@ namespace System internal static partial class StartupHookProvider { [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void ManagedStartup(char* pDiagnosticStartupHooks, Exception* pException) { try diff --git a/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs index 3396efc142d0af..002d59ec44e406 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/String.CoreCLR.cs @@ -5,12 +5,14 @@ using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Text; +using System.Diagnostics.CodeAnalysis; namespace System { public partial class String { [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] internal static extern unsafe string FastAllocateString(MethodTable *pMT, nint length); [DebuggerHidden] @@ -49,6 +51,7 @@ internal static unsafe void InternalCopy(string src, IntPtr dest, int len) } } + [RequiresUnsafe] internal unsafe int GetBytesFromEncoding(byte* pbNativeBuffer, int cbNativeBuffer, Encoding encoding) { // encoding == Encoding.UTF8 diff --git a/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs b/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs index b7b1601dfa5f1c..090f8dc293e8fb 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs @@ -833,6 +833,7 @@ internal static void ClearNative(IntPtr pMarshalState, in object pManagedHome, I internal static unsafe partial class MngdRefCustomMarshaler { [UnmanagedCallersOnly] + [RequiresUnsafe] internal static void ConvertContentsToNative(ICustomMarshaler* pMarshaler, object* pManagedHome, IntPtr* pNativeHome, Exception* pException) { try @@ -845,6 +846,7 @@ internal static void ConvertContentsToNative(ICustomMarshaler* pMarshaler, objec } } + [RequiresUnsafe] internal static void ConvertContentsToNative(ICustomMarshaler marshaler, in object pManagedHome, IntPtr* pNativeHome) { // COMPAT: We never pass null to MarshalManagedToNative. @@ -858,6 +860,7 @@ internal static void ConvertContentsToNative(ICustomMarshaler marshaler, in obje } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static void ConvertContentsToManaged(ICustomMarshaler* pMarshaler, object* pManagedHome, IntPtr* pNativeHome, Exception* pException) { try @@ -870,6 +873,7 @@ internal static void ConvertContentsToManaged(ICustomMarshaler* pMarshaler, obje } } + [RequiresUnsafe] internal static void ConvertContentsToManaged(ICustomMarshaler marshaler, ref object? pManagedHome, IntPtr* pNativeHome) { // COMPAT: We never pass null to MarshalNativeToManaged. @@ -883,6 +887,7 @@ internal static void ConvertContentsToManaged(ICustomMarshaler marshaler, ref ob } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static void ClearNative(ICustomMarshaler* pMarshaler, object* pManagedHome, IntPtr* pNativeHome, Exception* pException) { try @@ -895,6 +900,7 @@ internal static void ClearNative(ICustomMarshaler* pMarshaler, object* pManagedH } } + [RequiresUnsafe] internal static void ClearNative(ICustomMarshaler marshaler, ref object _, IntPtr* pNativeHome) { // COMPAT: We never pass null to CleanUpNativeData. @@ -914,6 +920,7 @@ internal static void ClearNative(ICustomMarshaler marshaler, ref object _, IntPt } [UnmanagedCallersOnly] + [RequiresUnsafe] internal static void ClearManaged(ICustomMarshaler* pMarshaler, object* pManagedHome, IntPtr* pNativeHome, Exception* pException) { try @@ -926,6 +933,7 @@ internal static void ClearManaged(ICustomMarshaler* pMarshaler, object* pManaged } } + [RequiresUnsafe] internal static void ClearManaged(ICustomMarshaler marshaler, in object pManagedHome, IntPtr* _) { // COMPAT: We never pass null to CleanUpManagedData. @@ -939,6 +947,7 @@ internal static void ClearManaged(ICustomMarshaler marshaler, in object pManaged [UnmanagedCallersOnly] [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "Custom marshaler GetInstance method is preserved by ILLink (see MarkCustomMarshalerGetInstance).")] + [RequiresUnsafe] internal static void GetCustomMarshalerInstance(void* pMT, byte* pCookie, int cCookieBytes, object* pResult, Exception* pException) { try @@ -1565,9 +1574,11 @@ static IntPtr GetCOMIPFromRCWWorker(object objSrc, IntPtr pCPCMD, out IntPtr ppT // Profiler helpers //------------------------------------------------------- [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "StubHelpers_ProfilerBeginTransitionCallback")] + [RequiresUnsafe] internal static unsafe partial void* ProfilerBeginTransitionCallback(void* pTargetMD); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "StubHelpers_ProfilerEndTransitionCallback")] + [RequiresUnsafe] internal static unsafe partial void ProfilerEndTransitionCallback(void* pTargetMD); #endif // PROFILING_SUPPORTED @@ -1587,6 +1598,7 @@ internal static void CheckStringLength(uint length) } } + [RequiresUnsafe] internal static unsafe void FmtClassUpdateNativeInternal(object obj, byte* pNative, ref CleanupWorkListElement? pCleanupWorkList) { MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj); @@ -1606,6 +1618,7 @@ internal static unsafe void FmtClassUpdateNativeInternal(object obj, byte* pNati } } + [RequiresUnsafe] internal static unsafe void FmtClassUpdateCLRInternal(object obj, byte* pNative) { MethodTable* pMT = RuntimeHelpers.GetMethodTable(obj); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs index 4988ae32548518..e0a7ff46f3e22f 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Text/StringBuilder.CoreCLR.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Text @@ -24,6 +25,7 @@ private int GetReplaceBufferCapacity(int requiredCapacity) return newCapacity; } + [RequiresUnsafe] internal unsafe void ReplaceBufferInternal(char* newBuffer, int newLength) { ArgumentOutOfRangeException.ThrowIfGreaterThan(newLength, m_MaxCapacity, "capacity"); @@ -54,6 +56,7 @@ internal void ReplaceBufferUtf8Internal(ReadOnlySpan source) m_ChunkOffset = 0; } + [RequiresUnsafe] internal unsafe void ReplaceBufferAnsiInternal(sbyte* newBuffer, int newLength) { ArgumentOutOfRangeException.ThrowIfGreaterThan(newLength, m_MaxCapacity, "capacity"); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs index 5fb05077081bbb..1596d9dbc462df 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs @@ -135,6 +135,7 @@ public static int CompareExchange(ref int location1, int value, int comparand) // return type of the method. // The important part is avoiding `ref *location` that is reported as byref to the GC. [Intrinsic] + [RequiresUnsafe] internal static unsafe int CompareExchange(int* location1, int value, int comparand) { #if TARGET_X86 || TARGET_AMD64 || TARGET_ARM64 || TARGET_RISCV64 @@ -146,6 +147,7 @@ internal static unsafe int CompareExchange(int* location1, int value, int compar } [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] private static extern unsafe int CompareExchange32Pointer(int* location1, int value, int comparand); /// Compares two 64-bit signed integers for equality and, if they are equal, replaces the first value. diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs index f4348e33595760..dc0bab6e328107 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -108,6 +109,7 @@ private unsafe void StartCore() } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_Start")] + [RequiresUnsafe] private static unsafe partial Interop.BOOL StartInternal(ThreadHandle t, int stackSize, int priority, Interop.BOOL isThreadPool, char* pThreadName, ObjectHandleOnStack exception); // Called from the runtime @@ -584,6 +586,7 @@ private void OnThreadExiting() } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_ReentrantWaitAny")] + [RequiresUnsafe] internal static unsafe partial int ReentrantWaitAny([MarshalAs(UnmanagedType.Bool)] bool alertable, int timeout, int count, IntPtr* handles); internal static void CheckForPendingInterrupt() diff --git a/src/coreclr/System.Private.CoreLib/src/System/ValueType.cs b/src/coreclr/System.Private.CoreLib/src/System/ValueType.cs index f4c3acb31adf88..7f7a3ce067e047 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/ValueType.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/ValueType.cs @@ -70,6 +70,7 @@ ref RuntimeHelpers.GetRawData(obj), // Return true if the valuetype does not contain pointer, is tightly packed, // does not have floating point number field and does not override Equals method. + [RequiresUnsafe] private static unsafe bool CanCompareBitsOrUseFastGetHashCode(MethodTable* pMT) { MethodTableAuxiliaryData* pAuxData = pMT->AuxiliaryData; @@ -83,6 +84,7 @@ private static unsafe bool CanCompareBitsOrUseFastGetHashCode(MethodTable* pMT) } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "MethodTable_CanCompareBitsOrUseFastGetHashCode")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] private static unsafe partial bool CanCompareBitsOrUseFastGetHashCodeHelper(MethodTable* pMT); @@ -162,6 +164,7 @@ private enum ValueTypeHashCodeStrategy } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ValueType_GetHashCodeStrategy")] + [RequiresUnsafe] private static unsafe partial ValueTypeHashCodeStrategy GetHashCodeStrategy( MethodTable* pMT, ObjectHandleOnStack objHandle, out uint fieldOffset, out uint fieldSize, out MethodTable* fieldMT); diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.cs index 76f21fc80496e0..8318d1822c67c0 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Read.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; internal static partial class Interop diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.cs index 749b34b2e0ca72..e6dd4a900837a9 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Write.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; internal static partial class Interop diff --git a/src/libraries/Microsoft.Bcl.Memory/src/Microsoft.Bcl.Memory.csproj b/src/libraries/Microsoft.Bcl.Memory/src/Microsoft.Bcl.Memory.csproj index 7aac2e95bd52e4..e7767fa9b93597 100644 --- a/src/libraries/Microsoft.Bcl.Memory/src/Microsoft.Bcl.Memory.csproj +++ b/src/libraries/Microsoft.Bcl.Memory/src/Microsoft.Bcl.Memory.csproj @@ -25,6 +25,7 @@ + diff --git a/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs b/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs index 7ee23e01a469db..c3c448407b6ff0 100644 --- a/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs +++ b/src/libraries/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComponentActivator.cs @@ -178,6 +178,7 @@ private static void LoadAssemblyImpl(string assemblyPath) [UnsupportedOSPlatform("maccatalyst")] [UnsupportedOSPlatform("tvos")] [UnmanagedCallersOnly] + [RequiresUnsafe] public static unsafe int LoadAssemblyBytes(byte* assembly, nint assemblyByteLength, byte* symbols, nint symbolsByteLength, IntPtr loadContext, IntPtr reserved) { if (!IsSupported) diff --git a/src/libraries/System.Private.CoreLib/src/System/AppContext.cs b/src/libraries/System.Private.CoreLib/src/System/AppContext.cs index b857dca79198e5..2e92c5def7c7c1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/AppContext.cs +++ b/src/libraries/System.Private.CoreLib/src/System/AppContext.cs @@ -197,6 +197,7 @@ internal static unsafe void Setup(char** pNames, uint* pNameLengths, char** pVal } #elif !NATIVEAOT [UnmanagedCallersOnly] + [RequiresUnsafe] internal static unsafe void Setup(char** pNames, char** pValues, int count, Exception* pException) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffer.cs b/src/libraries/System.Private.CoreLib/src/System/Buffer.cs index 49a90bce422fbd..1276d5eef852e9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffer.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffer.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; @@ -100,6 +101,7 @@ public static void SetByte(Array array, int index, byte value) // Please do not edit unless intentional. [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void MemoryCopy(void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy) { if (sourceBytesToCopy > destinationSizeInBytes) @@ -114,6 +116,7 @@ public static unsafe void MemoryCopy(void* source, void* destination, long desti // Please do not edit unless intentional. [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void MemoryCopy(void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy) { if (sourceBytesToCopy > destinationSizeInBytes) diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64DecoderHelper.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64DecoderHelper.cs index 677190b332f7fc..0f35e0087ff381 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64DecoderHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64DecoderHelper.cs @@ -5,6 +5,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; +using System.Diagnostics.CodeAnalysis; + #if NET using System.Runtime.Intrinsics.Arm; using System.Runtime.Intrinsics.X86; @@ -792,6 +794,7 @@ private static OperationStatus DecodeWithWhiteSpaceFromUtf8InPlace(TBase64Decoder decoder, ref T* srcBytes, ref byte* destBytes, T* srcEnd, int sourceLength, int destLength, T* srcStart, byte* destStart) where TBase64Decoder : IBase64Decoder where T : unmanaged @@ -859,6 +862,7 @@ private static unsafe void Avx512Decode(TBase64Decoder decode [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] + [RequiresUnsafe] private static unsafe void Avx2Decode(TBase64Decoder decoder, ref T* srcBytes, ref byte* destBytes, T* srcEnd, int sourceLength, int destLength, T* srcStart, byte* destStart) where TBase64Decoder : IBase64Decoder where T : unmanaged @@ -980,6 +984,7 @@ internal static Vector128 SimdShuffle(Vector128 left, Vector128(TBase64Decoder decoder, ref T* srcBytes, ref byte* destBytes, T* srcEnd, int sourceLength, int destLength, T* srcStart, byte* destStart) where TBase64Decoder : IBase64Decoder where T : unmanaged @@ -1121,6 +1126,7 @@ private static unsafe void AdvSimdDecode(TBase64Decoder decod [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] [CompExactlyDependsOn(typeof(Ssse3))] + [RequiresUnsafe] private static unsafe void Vector128Decode(TBase64Decoder decoder, ref T* srcBytes, ref byte* destBytes, T* srcEnd, int sourceLength, int destLength, T* srcStart, byte* destStart) where TBase64Decoder : IBase64Decoder where T : unmanaged @@ -1300,6 +1306,7 @@ private static unsafe void Vector128Decode(TBase64Decoder dec #endif [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe void WriteThreeLowOrderBytes(byte* destination, int value) { destination[0] = (byte)(value >> 16); @@ -1477,6 +1484,7 @@ public bool TryDecode256Core( } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe bool TryLoadVector512(byte* src, byte* srcStart, int sourceLength, out Vector512 str) { AssertRead>(src, srcStart, sourceLength); @@ -1486,6 +1494,7 @@ public unsafe bool TryLoadVector512(byte* src, byte* srcStart, int sourceLength, [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] + [RequiresUnsafe] public unsafe bool TryLoadAvxVector256(byte* src, byte* srcStart, int sourceLength, out Vector256 str) { AssertRead>(src, srcStart, sourceLength); @@ -1494,6 +1503,7 @@ public unsafe bool TryLoadAvxVector256(byte* src, byte* srcStart, int sourceLeng } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe bool TryLoadVector128(byte* src, byte* srcStart, int sourceLength, out Vector128 str) { AssertRead>(src, srcStart, sourceLength); @@ -1503,6 +1513,7 @@ public unsafe bool TryLoadVector128(byte* src, byte* srcStart, int sourceLength, [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] public unsafe bool TryLoadArmVector128x4(byte* src, byte* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4) { @@ -1514,6 +1525,7 @@ public unsafe bool TryLoadArmVector128x4(byte* src, byte* srcStart, int sourceLe #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe int DecodeFourElements(byte* source, ref sbyte decodingMap) { // The 'source' span expected to have at least 4 elements, and the 'decodingMap' consists 256 sbytes @@ -1539,6 +1551,7 @@ public unsafe int DecodeFourElements(byte* source, ref sbyte decodingMap) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe int DecodeRemaining(byte* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3) { uint t0; @@ -1646,6 +1659,7 @@ public bool TryDecode256Core(Vector256 str, Vector256 hiNibbles, V default(Base64DecoderByte).TryDecode256Core(str, hiNibbles, maskSlashOrUnderscore, lutLow, lutHigh, lutShift, shiftForUnderscore, out result); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe bool TryLoadVector512(ushort* src, ushort* srcStart, int sourceLength, out Vector512 str) { AssertRead>(src, srcStart, sourceLength); @@ -1663,6 +1677,7 @@ public unsafe bool TryLoadVector512(ushort* src, ushort* srcStart, int sourceLen [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] + [RequiresUnsafe] public unsafe bool TryLoadAvxVector256(ushort* src, ushort* srcStart, int sourceLength, out Vector256 str) { AssertRead>(src, srcStart, sourceLength); @@ -1680,6 +1695,7 @@ public unsafe bool TryLoadAvxVector256(ushort* src, ushort* srcStart, int source } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe bool TryLoadVector128(ushort* src, ushort* srcStart, int sourceLength, out Vector128 str) { AssertRead>(src, srcStart, sourceLength); @@ -1697,6 +1713,7 @@ public unsafe bool TryLoadVector128(ushort* src, ushort* srcStart, int sourceLen [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] public unsafe bool TryLoadArmVector128x4(ushort* src, ushort* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4) { @@ -1720,6 +1737,7 @@ public unsafe bool TryLoadArmVector128x4(ushort* src, ushort* srcStart, int sour #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe int DecodeFourElements(ushort* source, ref sbyte decodingMap) { // The 'source' span expected to have at least 4 elements, and the 'decodingMap' consists 256 sbytes @@ -1750,6 +1768,7 @@ public unsafe int DecodeFourElements(ushort* source, ref sbyte decodingMap) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe int DecodeRemaining(ushort* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3) { uint t0; diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64EncoderHelper.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64EncoderHelper.cs index 2afe15475c236b..b4757d8d2f058e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64EncoderHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64EncoderHelper.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if NET @@ -134,6 +135,7 @@ internal static unsafe OperationStatus EncodeTo(TBase64Encode [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx512BW))] [CompExactlyDependsOn(typeof(Avx512Vbmi))] + [RequiresUnsafe] private static unsafe void Avx512Encode(TBase64Encoder encoder, ref byte* srcBytes, ref T* destBytes, byte* srcEnd, int sourceLength, int destLength, byte* srcStart, T* destStart) where TBase64Encoder : IBase64Encoder where T : unmanaged @@ -208,6 +210,7 @@ private static unsafe void Avx512Encode(TBase64Encoder encode [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] + [RequiresUnsafe] private static unsafe void Avx2Encode(TBase64Encoder encoder, ref byte* srcBytes, ref T* destBytes, byte* srcEnd, int sourceLength, int destLength, byte* srcStart, T* destStart) where TBase64Encoder : IBase64Encoder where T : unmanaged @@ -380,6 +383,7 @@ private static unsafe void Avx2Encode(TBase64Encoder encoder, [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] private static unsafe void AdvSimdEncode(TBase64Encoder encoder, ref byte* srcBytes, ref T* destBytes, byte* srcEnd, int sourceLength, int destLength, byte* srcStart, T* destStart) where TBase64Encoder : IBase64Encoder where T : unmanaged @@ -440,6 +444,7 @@ private static unsafe void AdvSimdEncode(TBase64Encoder encod [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Ssse3))] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] private static unsafe void Vector128Encode(TBase64Encoder encoder, ref byte* srcBytes, ref T* destBytes, byte* srcEnd, int sourceLength, int destLength, byte* srcStart, T* destStart) where TBase64Encoder : IBase64Encoder where T : unmanaged @@ -629,6 +634,7 @@ internal static unsafe OperationStatus EncodeToUtf8InPlace(TBase } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe uint Encode(byte* threeBytes, ref byte encodingMap) { uint t0 = threeBytes[0]; @@ -659,6 +665,7 @@ private static uint ConstructResult(uint i0, uint i1, uint i2, uint i3) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, ref byte encodingMap) { uint t0 = oneByte[0]; @@ -683,6 +690,7 @@ public static unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, ushort* dest, ref byte encodingMap) { uint t0 = twoBytes[0]; @@ -729,6 +737,7 @@ public int GetMaxSrcLength(int srcLength, int destLength) => public int GetMaxEncodedLength(int srcLength) => Base64.GetMaxEncodedToUtf8Length(srcLength); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, byte* dest, ref byte encodingMap) { uint t0 = oneByte[0]; @@ -743,6 +752,7 @@ public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, byte* dest, ref byte } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, byte* dest, ref byte encodingMap) { uint t0 = twoBytes[0]; @@ -760,6 +770,7 @@ public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, byte* dest, ref byt #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector512ToDestination(byte* dest, byte* destStart, int destLength, Vector512 str) { AssertWrite>(dest, destStart, destLength); @@ -768,6 +779,7 @@ public unsafe void StoreVector512ToDestination(byte* dest, byte* destStart, int [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] + [RequiresUnsafe] public unsafe void StoreVector256ToDestination(byte* dest, byte* destStart, int destLength, Vector256 str) { AssertWrite>(dest, destStart, destLength); @@ -775,6 +787,7 @@ public unsafe void StoreVector256ToDestination(byte* dest, byte* destStart, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector128ToDestination(byte* dest, byte* destStart, int destLength, Vector128 str) { AssertWrite>(dest, destStart, destLength); @@ -783,6 +796,7 @@ public unsafe void StoreVector128ToDestination(byte* dest, byte* destStart, int [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] public unsafe void StoreArmVector128x4ToDestination(byte* dest, byte* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4) { @@ -792,6 +806,7 @@ public unsafe void StoreArmVector128x4ToDestination(byte* dest, byte* destStart, #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeThreeAndWrite(byte* threeBytes, byte* destination, ref byte encodingMap) { uint result = Encode(threeBytes, ref encodingMap); @@ -823,6 +838,7 @@ public int GetMaxSrcLength(int srcLength, int destLength) => public int GetMaxEncodedLength(int _) => 0; // not used for char encoding [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, ref byte encodingMap) { Base64Helper.EncodeOneOptionallyPadTwo(oneByte, dest, ref encodingMap); @@ -831,6 +847,7 @@ public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, ref by } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, ushort* dest, ref byte encodingMap) { Base64Helper.EncodeTwoOptionallyPadOne(twoBytes, dest, ref encodingMap); @@ -839,6 +856,7 @@ public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, ushort* dest, ref b #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector512ToDestination(ushort* dest, ushort* destStart, int destLength, Vector512 str) { AssertWrite>(dest, destStart, destLength); @@ -848,6 +866,7 @@ public unsafe void StoreVector512ToDestination(ushort* dest, ushort* destStart, } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector256ToDestination(ushort* dest, ushort* destStart, int destLength, Vector256 str) { AssertWrite>(dest, destStart, destLength); @@ -857,6 +876,7 @@ public unsafe void StoreVector256ToDestination(ushort* dest, ushort* destStart, } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector128ToDestination(ushort* dest, ushort* destStart, int destLength, Vector128 str) { AssertWrite>(dest, destStart, destLength); @@ -867,6 +887,7 @@ public unsafe void StoreVector128ToDestination(ushort* dest, ushort* destStart, [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] public unsafe void StoreArmVector128x4ToDestination(ushort* dest, ushort* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4) { @@ -881,6 +902,7 @@ public unsafe void StoreArmVector128x4ToDestination(ushort* dest, ushort* destSt #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeThreeAndWrite(byte* threeBytes, ushort* destination, ref byte encodingMap) { uint t0 = threeBytes[0]; diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64Helper.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64Helper.cs index 28429d9382b81e..a652aff01ab35b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64Helper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Helper/Base64Helper.cs @@ -13,6 +13,7 @@ namespace System.Buffers.Text internal static partial class Base64Helper { [Conditional("DEBUG")] + [RequiresUnsafe] internal static unsafe void AssertRead(byte* src, byte* srcStart, int srcLength) { int vectorElements = Unsafe.SizeOf(); @@ -27,6 +28,7 @@ internal static unsafe void AssertRead(byte* src, byte* srcStart, int s } [Conditional("DEBUG")] + [RequiresUnsafe] internal static unsafe void AssertWrite(byte* dest, byte* destStart, int destLength) { int vectorElements = Unsafe.SizeOf(); @@ -41,6 +43,7 @@ internal static unsafe void AssertWrite(byte* dest, byte* destStart, in } [Conditional("DEBUG")] + [RequiresUnsafe] internal static unsafe void AssertRead(ushort* src, ushort* srcStart, int srcLength) { int vectorElements = Unsafe.SizeOf(); @@ -55,6 +58,7 @@ internal static unsafe void AssertRead(ushort* src, ushort* srcStart, i } [Conditional("DEBUG")] + [RequiresUnsafe] internal static unsafe void AssertWrite(ushort* dest, ushort* destStart, int destLength) { int vectorElements = Unsafe.SizeOf(); @@ -178,15 +182,22 @@ internal interface IBase64Encoder where T : unmanaged int GetMaxSrcLength(int srcLength, int destLength); int GetMaxEncodedLength(int srcLength); uint GetInPlaceDestinationLength(int encodedLength, int leftOver); + [RequiresUnsafe] unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, T* dest, ref byte encodingMap); + [RequiresUnsafe] unsafe void EncodeTwoOptionallyPadOne(byte* oneByte, T* dest, ref byte encodingMap); + [RequiresUnsafe] unsafe void EncodeThreeAndWrite(byte* threeBytes, T* destination, ref byte encodingMap); int IncrementPadTwo { get; } int IncrementPadOne { get; } #if NET + [RequiresUnsafe] unsafe void StoreVector512ToDestination(T* dest, T* destStart, int destLength, Vector512 str); + [RequiresUnsafe] unsafe void StoreVector256ToDestination(T* dest, T* destStart, int destLength, Vector256 str); + [RequiresUnsafe] unsafe void StoreVector128ToDestination(T* dest, T* destStart, int destLength, Vector128 str); + [RequiresUnsafe] unsafe void StoreArmVector128x4ToDestination(T* dest, T* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4); #endif // NET @@ -230,13 +241,19 @@ bool TryDecode256Core( Vector256 lutShift, Vector256 shiftForUnderscore, out Vector256 result); + [RequiresUnsafe] unsafe bool TryLoadVector512(T* src, T* srcStart, int sourceLength, out Vector512 str); + [RequiresUnsafe] unsafe bool TryLoadAvxVector256(T* src, T* srcStart, int sourceLength, out Vector256 str); + [RequiresUnsafe] unsafe bool TryLoadVector128(T* src, T* srcStart, int sourceLength, out Vector128 str); + [RequiresUnsafe] unsafe bool TryLoadArmVector128x4(T* src, T* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4); #endif // NET + [RequiresUnsafe] unsafe int DecodeFourElements(T* source, ref sbyte decodingMap); + [RequiresUnsafe] unsafe int DecodeRemaining(T* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3); int IndexOfAnyExceptWhiteSpace(ReadOnlySpan span); OperationStatus DecodeWithWhiteSpaceBlockwiseWrapper(TTBase64Decoder decoder, ReadOnlySpan source, diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlDecoder.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlDecoder.cs index 7c2439c6e39a35..f2083119c4a22c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlDecoder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlDecoder.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if NET @@ -444,30 +445,36 @@ public bool TryDecode256Core( } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe bool TryLoadVector512(byte* src, byte* srcStart, int sourceLength, out Vector512 str) => default(Base64DecoderByte).TryLoadVector512(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] + [RequiresUnsafe] public unsafe bool TryLoadAvxVector256(byte* src, byte* srcStart, int sourceLength, out Vector256 str) => default(Base64DecoderByte).TryLoadAvxVector256(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe bool TryLoadVector128(byte* src, byte* srcStart, int sourceLength, out Vector128 str) => default(Base64DecoderByte).TryLoadVector128(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] public unsafe bool TryLoadArmVector128x4(byte* src, byte* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4) => default(Base64DecoderByte).TryLoadArmVector128x4(src, srcStart, sourceLength, out str1, out str2, out str3, out str4); #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe int DecodeFourElements(byte* source, ref sbyte decodingMap) => default(Base64DecoderByte).DecodeFourElements(source, ref decodingMap); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe int DecodeRemaining(byte* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3) => default(Base64DecoderByte).DecodeRemaining(srcEnd, ref decodingMap, remaining, out t2, out t3); @@ -529,30 +536,36 @@ public bool TryDecode256Core(Vector256 str, Vector256 hiNibbles, V default(Base64UrlDecoderByte).TryDecode256Core(str, hiNibbles, maskSlashOrUnderscore, lutLow, lutHigh, lutShift, shiftForUnderscore, out result); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe bool TryLoadVector512(ushort* src, ushort* srcStart, int sourceLength, out Vector512 str) => default(Base64DecoderChar).TryLoadVector512(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] + [RequiresUnsafe] public unsafe bool TryLoadAvxVector256(ushort* src, ushort* srcStart, int sourceLength, out Vector256 str) => default(Base64DecoderChar).TryLoadAvxVector256(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe bool TryLoadVector128(ushort* src, ushort* srcStart, int sourceLength, out Vector128 str) => default(Base64DecoderChar).TryLoadVector128(src, srcStart, sourceLength, out str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] public unsafe bool TryLoadArmVector128x4(ushort* src, ushort* srcStart, int sourceLength, out Vector128 str1, out Vector128 str2, out Vector128 str3, out Vector128 str4) => default(Base64DecoderChar).TryLoadArmVector128x4(src, srcStart, sourceLength, out str1, out str2, out str3, out str4); #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe int DecodeFourElements(ushort* source, ref sbyte decodingMap) => default(Base64DecoderChar).DecodeFourElements(source, ref decodingMap); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe int DecodeRemaining(ushort* srcEnd, ref sbyte decodingMap, long remaining, out uint t2, out uint t3) => default(Base64DecoderChar).DecodeRemaining(srcEnd, ref decodingMap, remaining, out t2, out t3); diff --git a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlEncoder.cs b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlEncoder.cs index e0ae10a2953989..7a945367cbe73b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlEncoder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Buffers/Text/Base64Url/Base64UrlEncoder.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; #if NET @@ -243,6 +244,7 @@ public uint GetInPlaceDestinationLength(int encodedLength, int leftOver) => public int GetMaxEncodedLength(int srcLength) => GetEncodedLength(srcLength); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, byte* dest, ref byte encodingMap) { uint t0 = oneByte[0]; @@ -267,6 +269,7 @@ public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, byte* dest, ref byte } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, byte* dest, ref byte encodingMap) { uint t0 = twoBytes[0]; @@ -285,26 +288,31 @@ public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, byte* dest, ref byt #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector512ToDestination(byte* dest, byte* destStart, int destLength, Vector512 str) => default(Base64EncoderByte).StoreVector512ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(Avx2))] + [RequiresUnsafe] public unsafe void StoreVector256ToDestination(byte* dest, byte* destStart, int destLength, Vector256 str) => default(Base64EncoderByte).StoreVector256ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector128ToDestination(byte* dest, byte* destStart, int destLength, Vector128 str) => default(Base64EncoderByte).StoreVector128ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] public unsafe void StoreArmVector128x4ToDestination(byte* dest, byte* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4) => default(Base64EncoderByte).StoreArmVector128x4ToDestination(dest, destStart, destLength, res1, res2, res3, res4); #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeThreeAndWrite(byte* threeBytes, byte* destination, ref byte encodingMap) => default(Base64EncoderByte).EncodeThreeAndWrite(threeBytes, destination, ref encodingMap); } @@ -333,34 +341,41 @@ public int GetMaxSrcLength(int srcLength, int destLength) => public int GetMaxEncodedLength(int _) => 0; // not used for char encoding [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeOneOptionallyPadTwo(byte* oneByte, ushort* dest, ref byte encodingMap) => Base64Helper.EncodeOneOptionallyPadTwo(oneByte, dest, ref encodingMap); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeTwoOptionallyPadOne(byte* twoBytes, ushort* dest, ref byte encodingMap) => Base64Helper.EncodeTwoOptionallyPadOne(twoBytes, dest, ref encodingMap); #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector512ToDestination(ushort* dest, ushort* destStart, int destLength, Vector512 str) => default(Base64EncoderChar).StoreVector512ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector256ToDestination(ushort* dest, ushort* destStart, int destLength, Vector256 str) => default(Base64EncoderChar).StoreVector256ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void StoreVector128ToDestination(ushort* dest, ushort* destStart, int destLength, Vector128 str) => default(Base64EncoderChar).StoreVector128ToDestination(dest, destStart, destLength, str); [MethodImpl(MethodImplOptions.AggressiveInlining)] [CompExactlyDependsOn(typeof(AdvSimd.Arm64))] + [RequiresUnsafe] public unsafe void StoreArmVector128x4ToDestination(ushort* dest, ushort* destStart, int destLength, Vector128 res1, Vector128 res2, Vector128 res3, Vector128 res4) => default(Base64EncoderChar).StoreArmVector128x4ToDestination(dest, destStart, destLength, res1, res2, res3, res4); #endif // NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe void EncodeThreeAndWrite(byte* threeBytes, ushort* destination, ref byte encodingMap) => default(Base64EncoderChar).EncodeThreeAndWrite(threeBytes, destination, ref encodingMap); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs b/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs index 442e00870d4935..cb56695b309fc5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Decimal.DecCalc.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -361,6 +362,7 @@ private static void Unscale(ref uint low, ref ulong high64, ref int scale) /// 64-bit divisor /// Returns quotient. Remainder overwrites lower 64-bits of dividend. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe ulong Div128By64(Buf16* bufNum, ulong den) { Debug.Assert(den > bufNum->High64); @@ -604,6 +606,7 @@ private static void IncreaseScale64(ref Buf12 bufNum, uint power) /// Index of last non-zero value in bufRes /// Scale factor for this value, range 0 - 2 * DEC_SCALE_MAX /// Returns new scale factor. bufRes updated in place, always 3 uints. + [RequiresUnsafe] private static unsafe int ScaleResult(Buf24* bufRes, uint hiRes, int scale) { Debug.Assert(hiRes < Buf24.Length); @@ -765,6 +768,7 @@ private static unsafe int ScaleResult(Buf24* bufRes, uint hiRes, int scale) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe uint DivByConst(uint* result, uint hiRes, out uint quotient, out uint remainder, uint power) { uint high = result[hiRes]; diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/RequiresUnsafeAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/RequiresUnsafeAttribute.cs index 5f893b5048e91f..6ecf050781400a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/RequiresUnsafeAttribute.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/RequiresUnsafeAttribute.cs @@ -11,7 +11,7 @@ namespace System.Diagnostics.CodeAnalysis /// This allows tools to understand which methods are unsafe to call when targeting /// environments that do not support unsafe code. /// - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] [Conditional("DEBUG")] internal sealed class RequiresUnsafeAttribute : Attribute { diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs index 5cb9b11658ee1c..31b3d254a56d1e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -377,6 +378,7 @@ private unsafe void CreateActivityPathGuid(out Guid idRet, out int activityPathG /// sufficient space for this ID. By doing this, we preserve the fact that this activity /// is a child (of unknown depth) from that ancestor. /// + [RequiresUnsafe] private unsafe void CreateOverflowGuid(Guid* outPtr) { // Search backwards for an ancestor that has sufficient space to put the ID. @@ -425,6 +427,7 @@ private enum NumberListCodes : byte /// is the maximum number of bytes that fit in a GUID) if the path did not fit. /// If 'overflow' is true, then the number is encoded as an 'overflow number (which has a /// special (longer prefix) that indicates that this ID is allocated differently + [RequiresUnsafe] private static unsafe int AddIdToGuid(Guid* outPtr, int whereToAddId, uint id, bool overflow = false) { byte* ptr = (byte*)outPtr; @@ -500,6 +503,7 @@ private static unsafe int AddIdToGuid(Guid* outPtr, int whereToAddId, uint id, b /// Thus if it is non-zero it adds to the current byte, otherwise it advances and writes /// the new byte (in the high bits) of the next byte. /// + [RequiresUnsafe] private static unsafe void WriteNibble(ref byte* ptr, byte* endPtr, uint value) { Debug.Assert(value < 16); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.Internal.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.Internal.cs index 9e232905d2ef25..70fba068cf0fa2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.Internal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipe.Internal.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Threading; @@ -14,6 +15,7 @@ internal static partial class EventPipeInternal // These PInvokes are used by the configuration APIs to interact with EventPipe. // [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_Enable")] + [RequiresUnsafe] private static unsafe partial ulong Enable( char* outputFile, EventPipeSerializationFormat format, @@ -28,11 +30,13 @@ private static unsafe partial ulong Enable( // These PInvokes are used by EventSource to interact with the EventPipe. // [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_CreateProvider", StringMarshalling = StringMarshalling.Utf16)] + [RequiresUnsafe] internal static unsafe partial IntPtr CreateProvider(string providerName, delegate* unmanaged callbackFunc, void* callbackContext); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DefineEvent")] + [RequiresUnsafe] internal static unsafe partial IntPtr DefineEvent(IntPtr provHandle, uint eventID, long keywords, uint eventVersion, uint level, void *pMetadata, uint metadataLength); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetProvider", StringMarshalling = StringMarshalling.Utf16)] @@ -45,16 +49,19 @@ internal static unsafe partial IntPtr CreateProvider(string providerName, internal static partial int EventActivityIdControl(uint controlCode, ref Guid activityId); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_WriteEventData")] + [RequiresUnsafe] internal static unsafe partial void WriteEventData(IntPtr eventHandle, EventProvider.EventData* pEventData, uint dataCount, Guid* activityId, Guid* relatedActivityId); // // These PInvokes are used as part of the EventPipeEventDispatcher. // [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetSessionInfo")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetSessionInfo(ulong sessionID, EventPipeSessionInfo* pSessionInfo); [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_GetNextEvent")] + [RequiresUnsafe] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool GetNextEvent(ulong sessionID, EventPipeEventInstanceData* pInstance); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs index 573581ff9fe8ad..c43a38239ec225 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeEventProvider.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Diagnostics.Tracing @@ -17,6 +18,7 @@ internal EventPipeEventProvider(EventProvider eventProvider) _eventProvider = new WeakReference(eventProvider); } + [RequiresUnsafe] protected override unsafe void HandleEnableNotification( EventProvider target, byte* additionalData, @@ -59,6 +61,7 @@ protected override unsafe void HandleEnableNotification( } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void Callback(byte* sourceId, int isEnabled, byte level, long matchAnyKeywords, long matchAllKeywords, Interop.Advapi32.EVENT_FILTER_DESCRIPTOR* filterData, void* callbackContext) { @@ -99,6 +102,7 @@ internal override void Unregister() } // Write an event. + [RequiresUnsafe] internal override unsafe EventProvider.WriteEventErrorCode EventWriteTransfer( in EventDescriptor eventDescriptor, IntPtr eventHandle, @@ -137,6 +141,7 @@ internal override int ActivityIdControl(Interop.Advapi32.ActivityControl control } // Define an EventPipeEvent handle. + [RequiresUnsafe] internal override unsafe IntPtr DefineEventHandle(uint eventID, string eventName, long keywords, uint eventVersion, uint level, byte* pMetadata, uint metadataLength) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeMetadataGenerator.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeMetadataGenerator.cs index fafb2d0be3f1b9..b549cb14974ea4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeMetadataGenerator.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventPipeMetadataGenerator.cs @@ -1,5 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Reflection; using EventMetadata = System.Diagnostics.Tracing.EventSource.EventMetadata; @@ -220,6 +221,7 @@ private EventPipeMetadataGenerator() { } // Copy src to buffer and modify the offset. // Note: We know the buffer size ahead of time to make sure no buffer overflow. + [RequiresUnsafe] internal static unsafe void WriteToBuffer(byte* buffer, uint bufferLength, ref uint offset, byte* src, uint srcLength) { Debug.Assert(bufferLength >= (offset + srcLength)); @@ -230,6 +232,7 @@ internal static unsafe void WriteToBuffer(byte* buffer, uint bufferLength, ref u offset += srcLength; } + [RequiresUnsafe] internal static unsafe void WriteToBuffer(byte* buffer, uint bufferLength, ref uint offset, T value) where T : unmanaged { Debug.Assert(bufferLength >= (offset + sizeof(T))); @@ -251,6 +254,7 @@ internal void SetInfo(string name, Type type, TraceLoggingTypeInfo? typeInfo = n TypeInfo = typeInfo; } + [RequiresUnsafe] internal unsafe bool GenerateMetadata(byte* pMetadataBlob, ref uint offset, uint blobSize) { TypeCode typeCode = GetTypeCodeExtended(ParameterType); @@ -306,6 +310,7 @@ internal unsafe bool GenerateMetadata(byte* pMetadataBlob, ref uint offset, uint return true; } + [RequiresUnsafe] private static unsafe bool GenerateMetadataForProperty(PropertyAnalysis property, byte* pMetadataBlob, ref uint offset, uint blobSize) { Debug.Assert(property != null); @@ -373,6 +378,7 @@ private static unsafe bool GenerateMetadataForProperty(PropertyAnalysis property return true; } + [RequiresUnsafe] internal unsafe bool GenerateMetadataV2(byte* pMetadataBlob, ref uint offset, uint blobSize) { if (TypeInfo == null) @@ -380,6 +386,7 @@ internal unsafe bool GenerateMetadataV2(byte* pMetadataBlob, ref uint offset, ui return GenerateMetadataForNamedTypeV2(ParameterName, TypeInfo, pMetadataBlob, ref offset, blobSize); } + [RequiresUnsafe] private static unsafe bool GenerateMetadataForNamedTypeV2(string name, TraceLoggingTypeInfo typeInfo, byte* pMetadataBlob, ref uint offset, uint blobSize) { Debug.Assert(pMetadataBlob != null); @@ -400,6 +407,7 @@ private static unsafe bool GenerateMetadataForNamedTypeV2(string name, TraceLogg return GenerateMetadataForTypeV2(typeInfo, pMetadataBlob, ref offset, blobSize); } + [RequiresUnsafe] private static unsafe bool GenerateMetadataForTypeV2(TraceLoggingTypeInfo? typeInfo, byte* pMetadataBlob, ref uint offset, uint blobSize) { Debug.Assert(typeInfo != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs index a690f3256aed20..a5b1c3aa88e5be 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventProvider.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Numerics; using System.Runtime.CompilerServices; @@ -236,6 +237,7 @@ private static void SetLastError(WriteEventErrorCode error) s_returnCode = error; } + [RequiresUnsafe] private static unsafe object? EncodeObject(ref object? data, ref EventData* dataDescriptor, ref byte* dataBuffer, ref uint totalEventSize) /*++ @@ -461,6 +463,7 @@ to fill the passed in ETW data descriptor. /// /// Payload for the ETW event. /// + [RequiresUnsafe] internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid* activityID, Guid* childActivityID, object?[] eventPayload) { WriteEventErrorCode status = WriteEventErrorCode.NoError; @@ -671,6 +674,7 @@ internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr even /// /// pointer do the event data /// + [RequiresUnsafe] protected internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid* activityID, Guid* childActivityID, int dataCount, IntPtr data) { if (childActivityID != null) @@ -692,6 +696,7 @@ protected internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, I return true; } + [RequiresUnsafe] internal unsafe bool WriteEventRaw( ref EventDescriptor eventDescriptor, IntPtr eventHandle, @@ -764,6 +769,7 @@ internal override void Disable() _liveSessions = null; } + [RequiresUnsafe] protected override unsafe void HandleEnableNotification( EventProvider target, byte *additionalData, @@ -864,6 +870,7 @@ internal override void Unregister() } // Write an event. + [RequiresUnsafe] internal override unsafe EventProvider.WriteEventErrorCode EventWriteTransfer( in EventDescriptor eventDescriptor, IntPtr eventHandle, @@ -897,6 +904,7 @@ internal override int ActivityIdControl(Interop.Advapi32.ActivityControl Control } // Define an EventPipeEvent handle. + [RequiresUnsafe] internal override unsafe IntPtr DefineEventHandle(uint eventID, string eventName, long keywords, uint eventVersion, uint level, byte* pMetadata, uint metadataLength) { @@ -1145,6 +1153,7 @@ internal EventKeywords MatchAllKeyword set => _allKeywordMask = unchecked((long)value); } + [RequiresUnsafe] protected virtual unsafe void HandleEnableNotification( EventProvider target, byte *additionalData, @@ -1225,6 +1234,7 @@ internal virtual void Unregister() { } + [RequiresUnsafe] internal virtual unsafe EventProvider.WriteEventErrorCode EventWriteTransfer( in EventDescriptor eventDescriptor, IntPtr eventHandle, @@ -1242,12 +1252,14 @@ internal virtual int ActivityIdControl(Interop.Advapi32.ActivityControl ControlC } // Define an EventPipeEvent handle. + [RequiresUnsafe] internal virtual unsafe IntPtr DefineEventHandle(uint eventID, string eventName, long keywords, uint eventVersion, uint level, byte* pMetadata, uint metadataLength) { return IntPtr.Zero; } + [RequiresUnsafe] protected unsafe void ProviderCallback( EventProvider target, byte *additionalData, @@ -1329,6 +1341,7 @@ private static int FindNull(byte[] buffer, int idx) return args; } + [RequiresUnsafe] protected unsafe bool MarshalFilterData(Interop.Advapi32.EVENT_FILTER_DESCRIPTOR* filterData, out ControllerCommand command, out byte[]? data) { Debug.Assert(filterData != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs index 484293f89d25aa..2761e0037e20a9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs @@ -1264,7 +1264,7 @@ internal int Reserved set => m_Reserved = value; } -#region private + #region private /// /// Initializes the members of this EventData object to point at a previously-pinned /// tracelogging-compatible metadata blob. @@ -1272,6 +1272,7 @@ internal int Reserved /// Pinned tracelogging-compatible metadata blob. /// The size of the metadata blob. /// Value for reserved: 2 for per-provider metadata, 1 for per-event metadata + [RequiresUnsafe] internal unsafe void SetMetadata(byte* pointer, int size, int reserved) { this.m_Ptr = (ulong)pointer; @@ -1320,6 +1321,7 @@ internal unsafe void SetMetadata(byte* pointer, int size, int reserved) "requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")] [RequiresUnreferencedCode(EventSourceRequiresUnreferenceMessage)] [CLSCompliant(false)] + [RequiresUnsafe] protected unsafe void WriteEventCore(int eventId, int eventDataCount, EventData* data) { WriteEventWithRelatedActivityIdCore(eventId, null, eventDataCount, data); @@ -1355,6 +1357,7 @@ protected unsafe void WriteEventCore(int eventId, int eventDataCount, EventData* "requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")] [RequiresUnreferencedCode(EventSourceRequiresUnreferenceMessage)] [CLSCompliant(false)] + [RequiresUnsafe] protected unsafe void WriteEventWithRelatedActivityIdCore(int eventId, Guid* relatedActivityId, int eventDataCount, EventData* data) { if (IsEnabled()) @@ -1566,10 +1569,11 @@ protected virtual void Dispose(bool disposing) // NOTE: we nop out this method body if !IsSupported using ILLink.Substitutions. this.Dispose(false); } -#endregion + #endregion -#region private + #region private + [RequiresUnsafe] private unsafe void WriteEventRaw( string? eventName, ref EventDescriptor eventDescriptor, @@ -1787,6 +1791,7 @@ private static Guid GenerateGuidFromName(string name) return new Guid(bytes.Slice(0, 16)); } + [RequiresUnsafe] private static unsafe void DecodeObjects(object?[] decodedObjects, Type[] parameterTypes, EventData* data) { for (int i = 0; i < decodedObjects.Length; i++, data++) @@ -1955,6 +1960,7 @@ private static unsafe void DecodeObjects(object?[] decodedObjects, Type[] parame } [Conditional("DEBUG")] + [RequiresUnsafe] private static unsafe void AssertValidString(EventData* data) { Debug.Assert(data->Size >= 0 && data->Size % 2 == 0, "String size should be even"); @@ -1985,6 +1991,7 @@ private static unsafe void AssertValidString(EventData* data) Justification = "EnsureDescriptorsInitialized's use of GetType preserves this method which " + "requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")] [RequiresUnreferencedCode(EventSourceRequiresUnreferenceMessage)] + [RequiresUnsafe] private unsafe void WriteEventVarargs(int eventId, Guid* childActivityID, object?[] args) { if (IsEnabled()) @@ -2148,6 +2155,7 @@ private void LogEventArgsMismatches(int eventId, object?[] args) } } + [RequiresUnsafe] private unsafe void WriteToAllListeners(EventWrittenEventArgs eventCallbackArgs, int eventDataCount, EventData* data) { Debug.Assert(m_eventData != null); @@ -3914,6 +3922,7 @@ internal static void InitializeDefaultEventSources() #if CORECLR [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void InitializeDefaultEventSources(Exception* pException) { try @@ -4317,6 +4326,7 @@ internal EventWrittenEventArgs(EventSource eventSource, int eventId) TimeStamp = DateTime.UtcNow; } + [RequiresUnsafe] internal unsafe EventWrittenEventArgs(EventSource eventSource, int eventId, Guid* pActivityID, Guid* pChildActivityID) : this(eventSource, eventId) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs index 1fc333603fdd0a..2e03275ddbf86a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs @@ -224,6 +224,7 @@ private void ThreadPoolIOEnqueue( [NonEvent] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] public unsafe void ThreadPoolIOEnqueue(NativeOverlapped* nativeOverlapped) { if (IsEnabled(EventLevel.Verbose, Keywords.ThreadingKeyword | Keywords.ThreadTransferKeyword)) @@ -265,6 +266,7 @@ private void ThreadPoolIODequeue( [NonEvent] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] public unsafe void ThreadPoolIODequeue(NativeOverlapped* nativeOverlapped) { if (IsEnabled(EventLevel.Verbose, Keywords.ThreadingKeyword | Keywords.ThreadTransferKeyword)) @@ -304,6 +306,7 @@ public void ThreadPoolWorkingThreadCount(uint Count, ushort ClrInstanceID = Defa [NonEvent] [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] public unsafe void ThreadPoolIOPack(NativeOverlapped* nativeOverlapped) { if (IsEnabled(EventLevel.Verbose, Keywords.ThreadingKeyword)) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs index ff07006940f4a3..d6c02501c5f8ba 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Diagnostics.Tracing @@ -33,6 +34,7 @@ internal unsafe struct DataCollector private int bufferNesting; // We may merge many fields int a single blob. If we are doing this we increment this. private bool writingScalars; + [RequiresUnsafe] internal void Enable( byte* scratch, int scratchSize, @@ -64,12 +66,14 @@ internal void Disable() /// A pointer to the next unused data descriptor, or datasEnd if they were /// all used. (Descriptors may be unused if a string or array was null.) /// + [RequiresUnsafe] internal EventSource.EventData* Finish() { this.ScalarsEnd(); return this.datas; } + [RequiresUnsafe] internal void AddScalar(void* value, int size) { var pb = (byte*)value; diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs index e18a27209475cf..9ef95f7ddff82e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs @@ -325,6 +325,7 @@ public unsafe void Write(string? eventName, EventSourceOptions options) /// the values must match the number and types of the fields described by the /// eventTypes parameter. /// + [RequiresUnsafe] private unsafe void WriteMultiMerge( string? eventName, ref EventSourceOptions options, @@ -385,6 +386,7 @@ private unsafe void WriteMultiMerge( /// the values must match the number and types of the fields described by the /// eventTypes parameter. /// + [RequiresUnsafe] private unsafe void WriteMultiMergeInner( string? eventName, ref EventSourceOptions options, @@ -504,6 +506,7 @@ private unsafe void WriteMultiMergeInner( /// The number and types of the values must match the number and types of the /// fields described by the eventTypes parameter. /// + [RequiresUnsafe] internal unsafe void WriteMultiMerge( string? eventName, ref EventSourceOptions options, @@ -574,6 +577,7 @@ internal unsafe void WriteMultiMerge( } } + [RequiresUnsafe] private unsafe void WriteImpl( string? eventName, ref EventSourceOptions options, @@ -695,6 +699,7 @@ private unsafe void WriteImpl( } } + [RequiresUnsafe] private unsafe void WriteToAllListeners(string? eventName, ref EventDescriptor eventDescriptor, EventTags tags, Guid* pActivityId, Guid* pChildActivityId, EventPayload? payload) { // Self described events do not have an id attached. We mark it internally with -1. @@ -717,6 +722,7 @@ private unsafe void WriteToAllListeners(string? eventName, ref EventDescriptor e } [NonEvent] + [RequiresUnsafe] private static unsafe void WriteCleanup(GCHandle* pPins, int cPins) { DataCollector.ThreadInstance.Disable(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs index 17da3860ec2b01..049650dd662fc5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/XplatEventLogger.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; @@ -21,6 +22,7 @@ public XplatEventLogger() { } private static unsafe string GetClrConfig(string configName) => new string(EventSource_GetClrConfig(configName)); [LibraryImport(RuntimeHelpers.QCall, StringMarshalling = StringMarshalling.Utf16)] + [RequiresUnsafe] private static unsafe partial char* EventSource_GetClrConfig(string configName); private static bool initializedPersistentListener; diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs index d49348f4a7c1d8..399cc58b0b80c2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; @@ -426,6 +427,7 @@ internal static unsafe bool EnumCalendarInfo(string localeName, CalendarId calen return result; } + [RequiresUnsafe] private static unsafe bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, IcuEnumCalendarsData* callbackContext) { #if TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS @@ -437,6 +439,7 @@ private static unsafe bool EnumCalendarInfo(string localeName, CalendarId calend } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void EnumCalendarInfoCallback(char* calendarStringPtr, IntPtr context) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs index d277773ce9646a..bdfd44bd906792 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -59,6 +60,7 @@ private struct EnumData // EnumCalendarInfoExEx callback itself. [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe Interop.BOOL EnumCalendarInfoCallback(char* lpCalendarInfoString, uint calendar, IntPtr pReserved, void* lParam) { EnumData* context = (EnumData*)lParam; @@ -91,6 +93,7 @@ public struct NlsEnumCalendarsData } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe Interop.BOOL EnumCalendarsCallback(char* lpCalendarInfoString, uint calendar, IntPtr reserved, void* lParam) { NlsEnumCalendarsData* context = (NlsEnumCalendarsData*)lParam; diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs index b1442d87b6a3a2..46a89b4b1c2a88 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs @@ -4,6 +4,7 @@ using System.Buffers; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Text; @@ -63,6 +64,7 @@ private unsafe int IcuCompareString(ReadOnlySpan string1, ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) { Debug.Assert(!GlobalizationMode.Invariant); @@ -100,6 +102,7 @@ private unsafe int IcuIndexOfCore(ReadOnlySpan source, ReadOnlySpan /// as the JIT wouldn't be able to optimize the ignoreCase path away. /// /// + [RequiresUnsafe] private unsafe int IndexOfOrdinalIgnoreCaseHelper(ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) { Debug.Assert(!GlobalizationMode.Invariant); @@ -215,6 +218,7 @@ private unsafe int IndexOfOrdinalIgnoreCaseHelper(ReadOnlySpan source, Rea } } + [RequiresUnsafe] private unsafe int IndexOfOrdinalHelper(ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) { Debug.Assert(!GlobalizationMode.Invariant); @@ -310,6 +314,7 @@ private unsafe int IndexOfOrdinalHelper(ReadOnlySpan source, ReadOnlySpan< } // this method sets '*matchLengthPtr' (if not nullptr) only on success + [RequiresUnsafe] private unsafe bool IcuStartsWith(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -339,6 +344,7 @@ private unsafe bool IcuStartsWith(ReadOnlySpan source, ReadOnlySpan } } + [RequiresUnsafe] private unsafe bool StartsWithOrdinalIgnoreCaseHelper(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -421,6 +427,7 @@ private unsafe bool StartsWithOrdinalIgnoreCaseHelper(ReadOnlySpan source, } } + [RequiresUnsafe] private unsafe bool StartsWithOrdinalHelper(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -494,6 +501,7 @@ private unsafe bool StartsWithOrdinalHelper(ReadOnlySpan source, ReadOnlyS } // this method sets '*matchLengthPtr' (if not nullptr) only on success + [RequiresUnsafe] private unsafe bool IcuEndsWith(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -523,6 +531,7 @@ private unsafe bool IcuEndsWith(ReadOnlySpan source, ReadOnlySpan su } } + [RequiresUnsafe] private unsafe bool EndsWithOrdinalIgnoreCaseHelper(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -606,6 +615,7 @@ private unsafe bool EndsWithOrdinalIgnoreCaseHelper(ReadOnlySpan source, R } } + [RequiresUnsafe] private unsafe bool EndsWithOrdinalHelper(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.cs index a54e6bc0bf3568..a4a2449aa51bbf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Nls.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Globalization @@ -242,6 +243,7 @@ private unsafe int NlsCompareString(ReadOnlySpan string1, ReadOnlySpan lpStringSource, @@ -293,6 +295,7 @@ private unsafe int FindString( } } + [RequiresUnsafe] private unsafe int NlsIndexOfCore(ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) { Debug.Assert(!GlobalizationMode.Invariant); @@ -304,6 +307,7 @@ private unsafe int NlsIndexOfCore(ReadOnlySpan source, ReadOnlySpan return FindString(positionFlag | (uint)GetNativeCompareFlags(options), source, target, matchLengthPtr); } + [RequiresUnsafe] private unsafe bool NlsStartsWith(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); @@ -325,6 +329,7 @@ private unsafe bool NlsStartsWith(ReadOnlySpan source, ReadOnlySpan return false; } + [RequiresUnsafe] private unsafe bool NlsEndsWith(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) { Debug.Assert(!GlobalizationMode.Invariant); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs index 25301679bad7e4..bf628417f98e20 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.cs @@ -627,6 +627,7 @@ public unsafe bool IsPrefix(ReadOnlySpan source, ReadOnlySpan prefix return matched; } + [RequiresUnsafe] private unsafe bool StartsWithCore(ReadOnlySpan source, ReadOnlySpan prefix, CompareOptions options, int* matchLengthPtr) => GlobalizationMode.UseNls ? NlsStartsWith(source, prefix, options, matchLengthPtr) : @@ -775,6 +776,7 @@ public bool IsSuffix(string source, string suffix) return IsSuffix(source, suffix, CompareOptions.None); } + [RequiresUnsafe] private unsafe bool EndsWithCore(ReadOnlySpan source, ReadOnlySpan suffix, CompareOptions options, int* matchLengthPtr) => GlobalizationMode.UseNls ? NlsEndsWith(source, suffix, options, matchLengthPtr) : @@ -1043,6 +1045,7 @@ public int IndexOf(ReadOnlySpan source, Rune value, CompareOptions options /// Caller needs to ensure is non-null and points /// to a valid address. This method will validate . /// + [RequiresUnsafe] private unsafe int IndexOf(ReadOnlySpan source, ReadOnlySpan value, int* matchLengthPtr, CompareOptions options, bool fromBeginning) { Debug.Assert(matchLengthPtr != null); @@ -1108,6 +1111,7 @@ private unsafe int IndexOf(ReadOnlySpan source, ReadOnlySpan value, return retVal; } + [RequiresUnsafe] private unsafe int IndexOfCore(ReadOnlySpan source, ReadOnlySpan target, CompareOptions options, int* matchLengthPtr, bool fromBeginning) => GlobalizationMode.UseNls ? NlsIndexOfCore(source, target, options, matchLengthPtr, fromBeginning) : diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs index cb178278d9889a..d2ea6b8ec02f30 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs @@ -37,6 +37,7 @@ internal static unsafe int GetLocaleInfoExInt(string localeName, uint field) return value; } + [RequiresUnsafe] internal static unsafe int GetLocaleInfoEx(string lpLocaleName, uint lcType, char* lpLCData, int cchData) { Debug.Assert(!GlobalizationMode.Invariant); @@ -345,6 +346,7 @@ private struct EnumLocaleData // EnumSystemLocaleEx callback. [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe Interop.BOOL EnumSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle) { EnumLocaleData* context = (EnumLocaleData*)contextHandle; @@ -368,6 +370,7 @@ private static unsafe Interop.BOOL EnumSystemLocalesProc(char* lpLocaleString, u // EnumSystemLocaleEx callback. [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe Interop.BOOL EnumAllSystemLocalesProc(char* lpLocaleString, uint flags, void* contextHandle) { try @@ -389,6 +392,7 @@ private struct EnumData // EnumTimeFormatsEx callback itself. [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe Interop.BOOL EnumTimeCallback(char* lpTimeFormatString, void* lParam) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Icu.cs index 4d0e2c719d011f..05b66058881060 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Icu.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; namespace System.Globalization { @@ -16,6 +17,7 @@ private static bool NeedsTurkishCasing(string localeName) return CultureInfo.GetCultureInfo(localeName).CompareInfo.Compare("\u0131", "I", CompareOptions.IgnoreCase) == 0; } + [RequiresUnsafe] internal unsafe void IcuChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper) { Debug.Assert(!GlobalizationMode.Invariant); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.cs index ca6689f4cef534..819b9b147de207 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.Nls.cs @@ -2,11 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; namespace System.Globalization { public partial class TextInfo { + [RequiresUnsafe] private unsafe void NlsChangeCase(char* pSource, int pSourceLen, char* pResult, int pResultLen, bool toUpper) { Debug.Assert(!GlobalizationMode.Invariant); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs index 9d0fd2a3e8b905..a650aa97c774be 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs @@ -768,6 +768,7 @@ private int AddTitlecaseLetter(ref StringBuilder result, ref string input, int i return inputIndex; } + [RequiresUnsafe] private unsafe void ChangeCaseCore(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper) { if (GlobalizationMode.UseNls) diff --git a/src/libraries/System.Private.CoreLib/src/System/Guid.cs b/src/libraries/System.Private.CoreLib/src/System/Guid.cs index 270da4ab7d0b09..078ceedb0b68cb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Guid.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Guid.cs @@ -1184,6 +1184,7 @@ public int CompareTo(Guid value) public static bool operator !=(Guid a, Guid b) => !EqualsCore(a, b); [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe int HexsToChars(TChar* guidChars, int a, int b) where TChar : unmanaged, IUtfChar { guidChars[0] = TChar.CastFrom(HexConverter.ToCharLower(a >> 4)); diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs index ce1ae318088bed..5859b5535d28eb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Path.cs @@ -791,6 +791,7 @@ private struct JoinInternalState // used to avoid rooting ValueTuple`7 private static ReadOnlySpan Base32Char => "abcdefghijklmnopqrstuvwxyz012345"u8; + [RequiresUnsafe] internal static unsafe void Populate83FileNameFromRandomBytes(byte* bytes, int byteCount, Span chars) { // This method requires bytes of length 8 and chars of length 12. diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/SharedMemoryManager.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/SharedMemoryManager.Unix.cs index 28e1ff19751257..bd8a97d35ee0c9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/SharedMemoryManager.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/SharedMemoryManager.Unix.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Runtime.InteropServices.Marshalling; using System.Threading; @@ -127,6 +128,7 @@ internal sealed unsafe class SharedMemoryProcessDataHeader (void*)addr; } diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStream.cs b/src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStream.cs index 6071585a7e9d40..7d5f57dbd930dd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStream.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/UnmanagedMemoryStream.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; @@ -130,6 +131,7 @@ protected void Initialize(SafeBuffer buffer, long offset, long length, FileAcces /// Creates a stream over a byte*. /// [CLSCompliant(false)] + [RequiresUnsafe] public unsafe UnmanagedMemoryStream(byte* pointer, long length) { Initialize(pointer, length, length, FileAccess.Read); @@ -139,6 +141,7 @@ public unsafe UnmanagedMemoryStream(byte* pointer, long length) /// Creates a stream over a byte*. /// [CLSCompliant(false)] + [RequiresUnsafe] public unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, FileAccess access) { Initialize(pointer, length, capacity, access); @@ -148,6 +151,7 @@ public unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, F /// Subclasses must call this method (or the other overload) to properly initialize all instance fields. /// [CLSCompliant(false)] + [RequiresUnsafe] protected unsafe void Initialize(byte* pointer, long length, long capacity, FileAccess access) { ArgumentNullException.ThrowIfNull(pointer); @@ -293,6 +297,7 @@ public override long Position /// Pointer to memory at the current Position in the stream. /// [CLSCompliant(false)] + [RequiresUnsafe] public unsafe byte* PositionPointer { get diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs index 9b2028fa0f48ff..cb22fababcc07d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Number.Formatting.cs @@ -4,6 +4,7 @@ using System.Buffers.Text; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Numerics; using System.Runtime.CompilerServices; @@ -1521,6 +1522,7 @@ internal static unsafe bool TryInt32ToHexStr(int value, char hexBase, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe TChar* Int32ToHexChars(TChar* buffer, uint value, int hexBase, int digits) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1577,6 +1579,7 @@ private static unsafe bool TryUInt32ToBinaryStr(uint value, int digits, S } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe TChar* UInt32ToBinaryChars(TChar* buffer, uint value, int digits) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1614,6 +1617,7 @@ private static unsafe void UInt32ToNumber(uint value, ref NumberBuffer number) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe void WriteTwoDigits(uint value, TChar* ptr) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1630,6 +1634,7 @@ ref Unsafe.Add(ref GetTwoDigitsBytesRef(typeof(TChar) == typeof(char)), (uint)si /// This method performs best when the starting index is a constant literal. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe void WriteFourDigits(uint value, TChar* ptr) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1651,6 +1656,7 @@ ref Unsafe.Add(ref charsArray, (uint)sizeof(TChar) * 2 * remainder), } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe void WriteDigits(uint value, TChar* ptr, int count) where TChar : unmanaged, IUtfChar { TChar* cur; @@ -1667,6 +1673,7 @@ internal static unsafe void WriteDigits(uint value, TChar* ptr, int count } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe TChar* UInt32ToDecChars(TChar* bufferEnd, uint value) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1696,6 +1703,7 @@ internal static unsafe void WriteDigits(uint value, TChar* ptr, int count } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe TChar* UInt32ToDecChars(TChar* bufferEnd, uint value, int digits) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -1955,6 +1963,7 @@ internal static unsafe bool TryInt64ToHexStr(long value, char hexBase, in #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] #endif private static unsafe TChar* Int64ToHexChars(TChar* buffer, ulong value, int hexBase, int digits) where TChar : unmanaged, IUtfChar { @@ -2027,6 +2036,7 @@ private static unsafe bool TryUInt64ToBinaryStr(ulong value, int digits, #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] #endif private static unsafe TChar* UInt64ToBinaryChars(TChar* buffer, ulong value, int digits) where TChar : unmanaged, IUtfChar { @@ -2088,6 +2098,7 @@ private static uint Int64DivMod1E9(ref ulong value) #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] #endif internal static unsafe TChar* UInt64ToDecChars(TChar* bufferEnd, ulong value) where TChar : unmanaged, IUtfChar { @@ -2127,6 +2138,7 @@ private static uint Int64DivMod1E9(ref ulong value) #if TARGET_64BIT [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] #endif internal static unsafe TChar* UInt64ToDecChars(TChar* bufferEnd, ulong value, int digits) where TChar : unmanaged, IUtfChar { @@ -2388,6 +2400,7 @@ private static unsafe bool TryInt128ToHexStr(Int128 value, char hexBase, } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe TChar* Int128ToHexChars(TChar* buffer, UInt128 value, int hexBase, int digits) where TChar : unmanaged, IUtfChar { ulong lower = value.Lower; @@ -2451,6 +2464,7 @@ private static unsafe bool TryUInt128ToBinaryStr(Int128 value, int digits } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe TChar* UInt128ToBinaryChars(TChar* buffer, UInt128 value, int digits) where TChar : unmanaged, IUtfChar { ulong lower = value.Lower; @@ -2499,6 +2513,7 @@ private static ulong Int128DivMod1E19(ref UInt128 value) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe TChar* UInt128ToDecChars(TChar* bufferEnd, UInt128 value) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); @@ -2511,6 +2526,7 @@ private static ulong Int128DivMod1E19(ref UInt128 value) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe TChar* UInt128ToDecChars(TChar* bufferEnd, UInt128 value, int digits) where TChar : unmanaged, IUtfChar { Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); diff --git a/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs b/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs index 92535633232725..f852449fb22abe 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Number.NumberToFloatingPointBits.cs @@ -3,6 +3,7 @@ using System.Buffers.Binary; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; @@ -890,6 +891,7 @@ private static ulong ConvertBigIntegerToFloatingPointBits(ref BigInteger } // get 32-bit integer from at most 9 digits + [RequiresUnsafe] private static uint DigitsToUInt32(byte* p, int count) { Debug.Assert((1 <= count) && (count <= 9)); @@ -914,6 +916,7 @@ private static uint DigitsToUInt32(byte* p, int count) } // get 64-bit integer from at most 19 digits + [RequiresUnsafe] private static ulong DigitsToUInt64(byte* p, int count) { Debug.Assert((1 <= count) && (count <= 19)); @@ -942,6 +945,7 @@ private static ulong DigitsToUInt64(byte* p, int count) /// https://lemire.me/blog/2022/01/21/swar-explained-parsing-eight-digits/ /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static uint ParseEightDigitsUnrolled(byte* chars) { // let's take the following value (byte*) 12345678 and read it unaligned : diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs index ceccc9aebd9305..bb14e36a8be3d5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; @@ -1941,6 +1942,7 @@ public static bool LessThanOrEqualAny(Vector left, Vector right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -1951,6 +1953,7 @@ public static bool LessThanOrEqualAny(Vector left, Vector right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); @@ -1971,6 +1974,7 @@ public static unsafe Vector LoadAligned(T* source) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -2987,6 +2991,7 @@ public static Vector SquareRoot(Vector value) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void Store(this Vector source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -2997,6 +3002,7 @@ public static Vector SquareRoot(Vector value) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe void StoreAligned(this Vector source, T* destination) { ThrowHelper.ThrowForUnsupportedNumericsVectorBaseType(); @@ -3017,6 +3023,7 @@ public static unsafe void StoreAligned(this Vector source, T* destination) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector source, T* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.Extensions.cs index 94134a583c42fb..0ed6452af84630 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.Extensions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; @@ -49,6 +50,7 @@ public static float GetElement(this Vector2 vector, int index) /// The vector that will be stored. /// The destination at which will be stored. [CLSCompliant(false)] + [RequiresUnsafe] public static void Store(this Vector2 source, float* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given 8-byte aligned destination. @@ -57,6 +59,7 @@ public static float GetElement(this Vector2 vector, int index) /// is not 8-byte aligned. [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void StoreAligned(this Vector2 source, float* destination) { if (((nuint)destination % (uint)(Vector2.Alignment)) != 0) @@ -73,6 +76,7 @@ public static void StoreAligned(this Vector2 source, float* destination) /// is not 8-byte aligned. /// This method may bypass the cache on certain platforms. [CLSCompliant(false)] + [RequiresUnsafe] public static void StoreAlignedNonTemporal(this Vector2 source, float* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs index 62d7e9e3490310..94d2f0eb113548 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2.cs @@ -675,12 +675,14 @@ public static float Cross(Vector2 value1, Vector2 value2) /// [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector2 Load(float* source) => LoadUnsafe(in *source); /// [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector2 LoadAligned(float* source) { if (((nuint)(source) % Alignment) != 0) @@ -694,6 +696,7 @@ public static unsafe Vector2 LoadAligned(float* source) /// [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector2 LoadAlignedNonTemporal(float* source) => LoadAligned(source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.Extensions.cs index dfaf6dca80891d..16686ca631c655 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.Extensions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; @@ -44,6 +45,7 @@ public static float GetElement(this Vector3 vector, int index) /// The vector that will be stored. /// The destination at which will be stored. [CLSCompliant(false)] + [RequiresUnsafe] public static void Store(this Vector3 source, float* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given 8-byte aligned destination. @@ -52,6 +54,7 @@ public static float GetElement(this Vector3 vector, int index) /// is not 8-byte aligned. [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void StoreAligned(this Vector3 source, float* destination) { if (((nuint)destination % (uint)(Vector3.Alignment)) != 0) @@ -68,6 +71,7 @@ public static void StoreAligned(this Vector3 source, float* destination) /// is not 8-byte aligned. /// This method may bypass the cache on certain platforms. [CLSCompliant(false)] + [RequiresUnsafe] public static void StoreAlignedNonTemporal(this Vector3 source, float* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs index 9bc2b354f1399c..42e01de9993548 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3.cs @@ -705,12 +705,14 @@ public static Vector3 Cross(Vector3 vector1, Vector3 vector2) /// [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector3 Load(float* source) => LoadUnsafe(in *source); /// [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector3 LoadAligned(float* source) { if (((nuint)(source) % Alignment) != 0) @@ -724,6 +726,7 @@ public static unsafe Vector3 LoadAligned(float* source) /// [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector3 LoadAlignedNonTemporal(float* source) => LoadAligned(source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs index b6d9fa2ef48356..93015433b5e40d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.Extensions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; @@ -42,6 +43,7 @@ public static unsafe partial class Vector /// The vector that will be stored. /// The destination at which will be stored. [CLSCompliant(false)] + [RequiresUnsafe] public static void Store(this Vector4 source, float* destination) => source.AsVector128().Store(destination); /// Stores a vector at the given 16-byte aligned destination. @@ -50,6 +52,7 @@ public static unsafe partial class Vector /// is not 16-byte aligned. [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void StoreAligned(this Vector4 source, float* destination) => source.AsVector128().StoreAligned(destination); /// Stores a vector at the given 16-byte aligned destination. @@ -58,6 +61,7 @@ public static unsafe partial class Vector /// is not 16-byte aligned. /// This method may bypass the cache on certain platforms. [CLSCompliant(false)] + [RequiresUnsafe] public static void StoreAlignedNonTemporal(this Vector4 source, float* destination) => source.AsVector128().StoreAlignedNonTemporal(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs index 4608e9a7d48e7b..09fd54ff8abc8e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4.cs @@ -770,18 +770,21 @@ public static Vector4 Cross(Vector4 vector1, Vector4 vector2) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector4 Load(float* source) => Vector128.Load(source).AsVector4(); /// [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector4 LoadAligned(float* source) => Vector128.LoadAligned(source).AsVector4(); /// [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector4 LoadAlignedNonTemporal(float* source) => Vector128.LoadAlignedNonTemporal(source).AsVector4(); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs index f1838df4caedae..0dd762c866e312 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs @@ -1073,14 +1073,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static Vector ISimdVector, T>.Load(T* source) => Vector.Load(source); /// [Intrinsic] + [RequiresUnsafe] static Vector ISimdVector, T>.LoadAligned(T* source) => Vector.LoadAligned(source); /// [Intrinsic] + [RequiresUnsafe] static Vector ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector.LoadAlignedNonTemporal(source); /// @@ -1181,14 +1184,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.Store(Vector source, T* destination) => source.Store(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs b/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs index 6a8bbba58ff383..4f5109f6fba647 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ReadOnlySpan.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.InteropServices.Marshalling; @@ -100,6 +101,7 @@ public ReadOnlySpan(T[]? array, int start, int length) /// [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe ReadOnlySpan(void* pointer, int length) { if (RuntimeHelpers.IsReferenceOrContainsReferences()) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs index 84c16f22ae6f01..b4b4ff1105f62a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs @@ -3,6 +3,7 @@ // Wrappers used to pass objects to and from QCalls. +using System.Diagnostics.CodeAnalysis; using System.Threading; namespace System.Runtime.CompilerServices @@ -23,6 +24,7 @@ internal unsafe ref struct ObjectHandleOnStack { private object* _ptr; + [RequiresUnsafe] private ObjectHandleOnStack(object* pObject) { _ptr = pObject; @@ -50,6 +52,7 @@ internal ByteRef(ref byte byteReference) internal unsafe ref struct ByteRefOnStack { private readonly void* _pByteRef; + private ByteRefOnStack(void* pByteRef) { _pByteRef = pByteRef; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs index 04c6d569fef89f..ab7a9d30b74153 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.InteropServices; @@ -183,6 +184,7 @@ public static ReadOnlySpan CreateSpan(RuntimeFieldHandle fldHandle) public static bool IsReferenceOrContainsReferences() where T: allows ref struct => IsReferenceOrContainsReferences(); [Intrinsic] + [RequiresUnsafe] internal static unsafe void SetNextCallGenericContext(void* value) => throw new UnreachableException(); // Unconditionally expanded intrinsic [Intrinsic] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs index 154cd64a421e88..5effb8beaeabe5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs @@ -281,6 +281,7 @@ public static TTo BitCast(TFrom source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void Copy(void* destination, ref readonly T source) where T : allows ref struct { @@ -301,6 +302,7 @@ public static void Copy(void* destination, ref readonly T source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void Copy(ref T destination, void* source) where T : allows ref struct { @@ -321,6 +323,7 @@ public static void Copy(ref T destination, void* source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void CopyBlock(void* destination, void* source, uint byteCount) { throw new PlatformNotSupportedException(); @@ -359,6 +362,7 @@ public static void CopyBlock(ref byte destination, ref readonly byte source, uin [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void CopyBlockUnaligned(void* destination, void* source, uint byteCount) { throw new PlatformNotSupportedException(); @@ -479,6 +483,7 @@ public static bool IsAddressLessThanOrEqualTo([AllowNull] ref readonly T left [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void InitBlock(void* startAddress, byte value, uint byteCount) { throw new PlatformNotSupportedException(); @@ -518,6 +523,7 @@ public static void InitBlock(ref byte startAddress, byte value, uint byteCount) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void InitBlockUnaligned(void* startAddress, byte value, uint byteCount) { throw new PlatformNotSupportedException(); @@ -566,6 +572,7 @@ public static void InitBlockUnaligned(ref byte startAddress, byte value, uint by [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static T ReadUnaligned(void* source) where T : allows ref struct { @@ -617,6 +624,7 @@ public static T ReadUnaligned(scoped ref readonly byte source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void WriteUnaligned(void* destination, T value) where T : allows ref struct { @@ -689,6 +697,7 @@ public static ref T AddByteOffset(ref T source, nint byteOffset) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static T Read(void* source) where T : allows ref struct { @@ -702,6 +711,7 @@ public static T Read(void* source) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static void Write(void* destination, T value) where T : allows ref struct { @@ -715,6 +725,7 @@ public static void Write(void* destination, T value) [NonVersionable] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static ref T AsRef(void* source) where T : allows ref struct { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/GCFrameRegistration.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/GCFrameRegistration.cs index c9be1db3cc805c..d29c1797d977aa 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/GCFrameRegistration.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/GCFrameRegistration.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -18,6 +19,7 @@ internal unsafe struct GCFrameRegistration private nuint _osStackLocation; #endif + [RequiresUnsafe] public GCFrameRegistration(void** allocation, uint elemCount, bool areByRefs = true) { _reserved1 = 0; @@ -32,9 +34,11 @@ public GCFrameRegistration(void** allocation, uint elemCount, bool areByRefs = t #if CORECLR [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] internal static extern void RegisterForGCReporting(GCFrameRegistration* pRegistration); [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] internal static extern void UnregisterForGCReporting(GCFrameRegistration* pRegistration); #endif } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComAwareWeakReference.ComWrappers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComAwareWeakReference.ComWrappers.cs index 2aae61b9390df9..86400b6d8c7a9b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComAwareWeakReference.ComWrappers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComAwareWeakReference.ComWrappers.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System @@ -16,6 +17,7 @@ internal sealed partial class ComAwareWeakReference private static unsafe delegate* s_possiblyComObjectCallback; private static unsafe delegate* s_objectToComWeakRefCallback; + [RequiresUnsafe] internal static unsafe void InitializeCallbacks( delegate* comWeakRefToObject, delegate* possiblyComObject, diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs index fb2210d780173f..eee7f614e68d75 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs @@ -129,12 +129,14 @@ public partial struct ComInterfaceDispatch /// Desired type. /// Pointer supplied to Vtable function entry. /// Instance of type associated with dispatched function call. + [RequiresUnsafe] public static unsafe T GetInstance(ComInterfaceDispatch* dispatchPtr) where T : class { ManagedObjectWrapper* comInstance = ToManagedObjectWrapper(dispatchPtr); return Unsafe.As(comInstance->Holder!.WrappedObject); } + [RequiresUnsafe] internal static unsafe ManagedObjectWrapper* ToManagedObjectWrapper(ComInterfaceDispatch* dispatchPtr) { InternalComInterfaceDispatch* dispatch = (InternalComInterfaceDispatch*)unchecked((nuint)dispatchPtr & (nuint)InternalComInterfaceDispatch.DispatchAlignmentMask); @@ -486,6 +488,7 @@ static ManagedObjectWrapperHolder() private readonly ManagedObjectWrapper* _wrapper; + [RequiresUnsafe] public ManagedObjectWrapperHolder(ManagedObjectWrapper* wrapper, object wrappedObject) { _wrapper = wrapper; @@ -502,6 +505,7 @@ public ManagedObjectWrapperHolder(ManagedObjectWrapper* wrapper, object wrappedO public bool IsActivated => _wrapper->Flags.HasFlag(CreateComInterfaceFlagsEx.IsComActivated); + [RequiresUnsafe] internal ManagedObjectWrapper* Wrapper => _wrapper; } @@ -509,6 +513,7 @@ internal sealed unsafe class ManagedObjectWrapperReleaser { private ManagedObjectWrapper* _wrapper; + [RequiresUnsafe] public ManagedObjectWrapperReleaser(ManagedObjectWrapper* wrapper) { _wrapper = wrapper; @@ -826,6 +831,7 @@ private static nuint AlignUp(nuint value, nuint alignment) return (nuint)((value + alignMask) & ~alignMask); } + [RequiresUnsafe] private unsafe ManagedObjectWrapper* CreateManagedObjectWrapper(object instance, CreateComInterfaceFlags flags) { ComInterfaceEntry* userDefined = ComputeVtables(instance, flags, out int userDefinedCount); @@ -985,6 +991,7 @@ public object GetOrRegisterObjectForComInstance(IntPtr externalComObject, Create return obj; } + [RequiresUnsafe] private static unsafe ComInterfaceDispatch* TryGetComInterfaceDispatch(IntPtr comObject) { // If the first Vtable entry is part of a ManagedObjectWrapper impl, @@ -1473,11 +1480,12 @@ public static void RegisterForMarshalling(ComWrappers instance) /// pointer containing memory for all COM interface entries. /// /// All memory returned from this function must either be unmanaged memory, pinned managed memory, or have been - /// allocated with the API. + /// allocated with the API. /// /// If the interface entries cannot be created and a negative or null and a non-zero are returned, /// the call to will throw a . /// + [RequiresUnsafe] protected abstract unsafe ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs index 630d8b19b82d53..bdabc22c989bdf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Runtime.InteropServices @@ -24,6 +25,7 @@ public static class GCHandleExtensions /// If the handle is not initialized or already disposed. /// The element type of the pinned array. [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe T* GetAddressOfArrayData( #nullable disable // Nullable oblivious because no covariance between PinnedGCHandle and PinnedGCHandle this PinnedGCHandle handle) @@ -47,6 +49,7 @@ public static class GCHandleExtensions /// /// If the handle is not initialized or already disposed. [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe char* GetAddressOfStringData( #nullable disable // Nullable oblivious because no covariance between PinnedGCHandle and PinnedGCHandle this PinnedGCHandle handle) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Unix.cs index 64c541af07e992..6abfe8d8c6219a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Unix.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Text; namespace System.Runtime.InteropServices @@ -32,6 +33,7 @@ public static IntPtr StringToCoTaskMemAuto(string? s) private static bool IsNullOrWin32Atom(IntPtr ptr) => ptr == IntPtr.Zero; + [RequiresUnsafe] internal static unsafe int StringToAnsiString(string s, byte* buffer, int bufferLength, bool bestFit = false, bool throwOnUnmappableChar = false) { Debug.Assert(bufferLength >= (s.Length + 1) * SystemMaxDBCSCharSize, "Insufficient buffer length passed to StringToAnsiString"); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/AnsiStringMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/AnsiStringMarshaller.cs index 34cfccd08755d5..41251a956924be 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/AnsiStringMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/AnsiStringMarshaller.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Runtime.InteropServices.Marshalling @@ -18,6 +19,7 @@ public static unsafe class AnsiStringMarshaller /// /// The managed string to convert. /// An unmanaged string. + [RequiresUnsafe] public static byte* ConvertToUnmanaged(string? managed) { if (managed is null) @@ -36,6 +38,7 @@ public static unsafe class AnsiStringMarshaller /// /// The unmanaged string to convert. /// A managed string. + [RequiresUnsafe] public static string? ConvertToManaged(byte* unmanaged) => Marshal.PtrToStringAnsi((IntPtr)unmanaged); @@ -43,6 +46,7 @@ public static unsafe class AnsiStringMarshaller /// Frees the memory for the unmanaged string. /// /// The memory allocated for the unmanaged string. + [RequiresUnsafe] public static void Free(byte* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -97,6 +101,7 @@ public void FromManaged(string? managed, Span buffer) /// Converts the current managed string to an unmanaged string. /// /// The converted unmanaged string. + [RequiresUnsafe] public byte* ToUnmanaged() => _unmanagedValue; /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ArrayMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ArrayMarshaller.cs index 54fbcbc210a0e4..2d7731c1220232 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ArrayMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ArrayMarshaller.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Runtime.InteropServices.Marshalling @@ -28,6 +29,7 @@ public static unsafe class ArrayMarshaller /// The managed array. /// The unmanaged element count. /// The unmanaged pointer to the allocated memory. + [RequiresUnsafe] public static TUnmanagedElement* AllocateContainerForUnmanagedElements(T[]? managed, out int numElements) { if (managed is null) @@ -57,6 +59,7 @@ public static ReadOnlySpan GetManagedValuesSource(T[]? managed) /// The unmanaged allocation. /// The unmanaged element count. /// The of unmanaged elements. + [RequiresUnsafe] public static Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged is null) @@ -93,6 +96,7 @@ public static Span GetManagedValuesDestination(T[]? managed) /// The unmanaged array. /// The unmanaged element count. /// The containing the unmanaged elements to marshal. + [RequiresUnsafe] public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanagedElement* unmanagedValue, int numElements) { if (unmanagedValue is null) @@ -105,6 +109,7 @@ public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanage /// Frees memory for the unmanaged array. /// /// The unmanaged array. + [RequiresUnsafe] public static void Free(TUnmanagedElement* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -183,6 +188,7 @@ public void FromManaged(T[]? array, Span buffer) /// Returns the unmanaged value representing the array. /// /// A pointer to the beginning of the unmanaged value. + [RequiresUnsafe] public TUnmanagedElement* ToUnmanaged() { // Unsafe.AsPointer is safe since buffer must be pinned diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/BStrStringMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/BStrStringMarshaller.cs index 561f8ce8de3121..c636d1d8164e80 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/BStrStringMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/BStrStringMarshaller.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Text; @@ -28,6 +29,7 @@ public static unsafe class BStrStringMarshaller /// /// An unmanaged string to convert. /// The converted managed string. + [RequiresUnsafe] public static string? ConvertToManaged(ushort* unmanaged) { if (unmanaged is null) @@ -40,6 +42,7 @@ public static unsafe class BStrStringMarshaller /// Frees the memory for the unmanaged string. /// /// The memory allocated for the unmanaged string. + [RequiresUnsafe] public static void Free(ushort* unmanaged) => Marshal.FreeBSTR((IntPtr)unmanaged); @@ -105,6 +108,7 @@ public void FromManaged(string? managed, Span buffer) /// Converts the current managed string to an unmanaged string. /// /// The converted unmanaged string. + [RequiresUnsafe] public ushort* ToUnmanaged() => _ptrToFirstChar; /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/PointerArrayMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/PointerArrayMarshaller.cs index d0a3dfae3e8db4..585648b78a1693 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/PointerArrayMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/PointerArrayMarshaller.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Runtime.InteropServices.Marshalling @@ -58,6 +59,7 @@ public static ReadOnlySpan GetManagedValuesSource(T*[]? managed) /// The unmanaged allocation to get a destination for. /// The unmanaged element count. /// The of unmanaged elements. + [RequiresUnsafe] public static Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged is null) @@ -72,6 +74,7 @@ public static Span GetUnmanagedValuesDestination(TUnmanagedEl /// The unmanaged array. /// The unmanaged element count. /// The managed array. + [RequiresUnsafe] public static T*[]? AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged is null) @@ -94,6 +97,7 @@ public static Span GetManagedValuesDestination(T*[]? managed) /// The unmanaged array to get a source for. /// The unmanaged element count. /// The containing the unmanaged elements to marshal. + [RequiresUnsafe] public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanagedElement* unmanagedValue, int numElements) { if (unmanagedValue is null) @@ -106,6 +110,7 @@ public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanage /// Frees memory for the unmanaged array. /// /// The unmanaged array. + [RequiresUnsafe] public static void Free(TUnmanagedElement* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -184,6 +189,7 @@ public void FromManaged(T*[]? array, Span buffer) /// Returns the unmanaged value representing the array. /// /// A pointer to the beginning of the unmanaged value. + [RequiresUnsafe] public TUnmanagedElement* ToUnmanaged() { // Unsafe.AsPointer is safe since buffer must be pinned diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ReadOnlySpanMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ReadOnlySpanMarshaller.cs index 6e9bd465da0abc..68b8f006982c01 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ReadOnlySpanMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ReadOnlySpanMarshaller.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Text; @@ -37,6 +38,7 @@ public static class UnmanagedToManagedOut /// The managed span. /// The number of elements in the span. /// A pointer to the block of memory for the unmanaged elements. + [RequiresUnsafe] public static TUnmanagedElement* AllocateContainerForUnmanagedElements(ReadOnlySpan managed, out int numElements) { // Emulate the pinning behavior: @@ -68,6 +70,7 @@ public static ReadOnlySpan GetManagedValuesSource(ReadOnlySpan managed) /// The pointer to the block of memory for the unmanaged elements. /// The number of elements that will be copied into the memory block. /// A span over the unmanaged memory that can contain the specified number of elements. + [RequiresUnsafe] public static Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged == null) @@ -148,6 +151,7 @@ public void FromManaged(ReadOnlySpan managed, Span buffer) /// /// Returns the unmanaged value representing the array. /// + [RequiresUnsafe] public TUnmanagedElement* ToUnmanaged() { // Unsafe.AsPointer is safe since buffer must be pinned @@ -185,6 +189,7 @@ public struct ManagedToUnmanagedOut /// Initializes the marshaller. /// /// A pointer to the array to be unmarshalled from native to managed. + [RequiresUnsafe] public void FromUnmanaged(TUnmanagedElement* unmanaged) { _unmanagedArray = unmanaged; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/SpanMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/SpanMarshaller.cs index 2ff52a27e373cf..45c0f01969ed5c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/SpanMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/SpanMarshaller.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Text; @@ -62,6 +63,7 @@ public static ReadOnlySpan GetManagedValuesSource(Span managed) /// The pointer to the block of memory for the unmanaged elements. /// The number of elements that will be copied into the memory block. /// A span over the unmanaged memory that can contain the specified number of elements. + [RequiresUnsafe] public static Span GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged == null) @@ -76,6 +78,7 @@ public static Span GetUnmanagedValuesDestination(TUnmanagedEl /// The unmanaged value. /// The number of elements in the unmanaged collection. /// A span over enough memory to contain elements. + [RequiresUnsafe] public static Span AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged is null) @@ -98,6 +101,7 @@ public static Span GetManagedValuesDestination(Span managed) /// The unmanaged value. /// The number of elements in the unmanaged collection. /// A span over the native collection elements. + [RequiresUnsafe] public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanagedElement* unmanaged, int numElements) { if (unmanaged == null) @@ -110,6 +114,7 @@ public static ReadOnlySpan GetUnmanagedValuesSource(TUnmanage /// Frees the allocated unmanaged memory. /// /// A pointer to the allocated unmanaged memory. + [RequiresUnsafe] public static void Free(TUnmanagedElement* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -180,6 +185,7 @@ public void FromManaged(Span managed, Span buffer) /// /// Returns the unmanaged value representing the array. /// + [RequiresUnsafe] public TUnmanagedElement* ToUnmanaged() { // Unsafe.AsPointer is safe since buffer must be pinned diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf16StringMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf16StringMarshaller.cs index 55bb892c95064b..d33e3ee11ed261 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf16StringMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf16StringMarshaller.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Runtime.InteropServices.Marshalling @@ -25,6 +26,7 @@ public static unsafe class Utf16StringMarshaller /// /// The unmanaged string to convert. /// A managed string. + [RequiresUnsafe] public static string? ConvertToManaged(ushort* unmanaged) => Marshal.PtrToStringUni((IntPtr)unmanaged); @@ -32,6 +34,7 @@ public static unsafe class Utf16StringMarshaller /// Frees the memory for the unmanaged string. /// /// The memory allocated for the unmanaged string. + [RequiresUnsafe] public static void Free(ushort* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf8StringMarshaller.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf8StringMarshaller.cs index ee231616eaad23..842d9140f5a6a8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf8StringMarshaller.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/Utf8StringMarshaller.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Text; @@ -19,6 +20,7 @@ public static unsafe class Utf8StringMarshaller /// /// The managed string to convert. /// An unmanaged string. + [RequiresUnsafe] public static byte* ConvertToUnmanaged(string? managed) { if (managed is null) @@ -38,6 +40,7 @@ public static unsafe class Utf8StringMarshaller /// /// The unmanaged string to convert. /// A managed string. + [RequiresUnsafe] public static string? ConvertToManaged(byte* unmanaged) => Marshal.PtrToStringUTF8((IntPtr)unmanaged); @@ -45,6 +48,7 @@ public static unsafe class Utf8StringMarshaller /// Free the memory for a specified unmanaged string. /// /// The memory allocated for the unmanaged string. + [RequiresUnsafe] public static void Free(byte* unmanaged) => Marshal.FreeCoTaskMem((IntPtr)unmanaged); @@ -102,6 +106,7 @@ public void FromManaged(string? managed, Span buffer) /// Converts the current managed string to an unmanaged string. /// /// An unmanaged string. + [RequiresUnsafe] public byte* ToUnmanaged() => _unmanagedValue; /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs index 3a2929b1ab5781..2c2d829c62fb3e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/MemoryMarshal.cs @@ -249,6 +249,7 @@ public static ReadOnlySpan CreateReadOnlySpan(scoped ref readonly T refere /// The returned span does not include the null terminator. /// The string is longer than . [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(char* value) => value != null ? new ReadOnlySpan(value, string.wcslen(value)) : default; @@ -259,6 +260,7 @@ public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(cha /// The returned span does not include the null terminator, nor does it validate the well-formedness of the UTF-8 data. /// The string is longer than . [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe ReadOnlySpan CreateReadOnlySpanFromNullTerminated(byte* value) => value != null ? new ReadOnlySpan(value, string.strlen(value)) : default; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs index dfc3692d1d7416..14cd2eadb49045 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; @@ -60,6 +61,7 @@ public static unsafe partial class NativeMemory /// This method is a thin wrapper over the C free API or a platform dependent aligned free API such as _aligned_free on Win32. /// [CLSCompliant(false)] + [RequiresUnsafe] public static void AlignedFree(void* ptr) { if (ptr != null) @@ -82,6 +84,7 @@ public static void AlignedFree(void* ptr) /// This method is not compatible with or , instead or should be called. /// [CLSCompliant(false)] + [RequiresUnsafe] public static void* AlignedRealloc(void* ptr, nuint byteCount, nuint alignment) { if (!BitOperations.IsPow2(alignment)) @@ -175,6 +178,7 @@ public static void AlignedFree(void* ptr) /// This method is a thin wrapper over the C free API. /// [CLSCompliant(false)] + [RequiresUnsafe] public static void Free(void* ptr) { if (ptr != null) @@ -194,6 +198,7 @@ public static void Free(void* ptr) /// This method is a thin wrapper over the C realloc API. /// [CLSCompliant(false)] + [RequiresUnsafe] public static void* Realloc(void* ptr, nuint byteCount) { // The C standard does not define what happens when size == 0, we want an "empty" allocation diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.cs index 988e43ca3d4fa7..7008f9286e2473 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; @@ -46,6 +47,7 @@ public static unsafe partial class NativeMemory /// The behavior when is and is greater than 0 is undefined. /// [CLSCompliant(false)] + [RequiresUnsafe] public static void Clear(void* ptr, nuint byteCount) { SpanHelpers.ClearWithoutReferences(ref *(byte*)ptr, byteCount); @@ -59,6 +61,7 @@ public static void Clear(void* ptr, nuint byteCount) /// A pointer to the destination memory block where the data is to be copied. /// The size, in bytes, to be copied from the source location to the destination. [CLSCompliant(false)] + [RequiresUnsafe] public static void Copy(void* source, void* destination, nuint byteCount) { SpanHelpers.Memmove(ref *(byte*)destination, ref *(byte*)source, byteCount); @@ -72,6 +75,7 @@ public static void Copy(void* source, void* destination, nuint byteCount) /// The number of bytes to be set to . /// The value to be set. [CLSCompliant(false)] + [RequiresUnsafe] public static void Fill(void* ptr, nuint byteCount, byte value) { SpanHelpers.Fill(ref *(byte*)ptr, byteCount, value); diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.PlatformNotSupported.cs index 598be904337a94..c1418ec26c1a7a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ObjectiveC/ObjectiveCMarshal.PlatformNotSupported.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.Versioning; @@ -55,6 +56,7 @@ public static class ObjectiveCMarshal /// The should return 0 for not reference or 1 for /// referenced. Any other value has undefined behavior. /// + [RequiresUnsafe] public static unsafe void Initialize( delegate* unmanaged beginEndCallback, delegate* unmanaged isReferencedCallback, diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ReferenceTrackerHost.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ReferenceTrackerHost.cs index 82b8a862a117d8..dbdb8d9fd9546f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ReferenceTrackerHost.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ReferenceTrackerHost.cs @@ -3,6 +3,7 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Threading; @@ -74,6 +75,7 @@ internal static int IReferenceTrackerHost_NotifyEndOfReferenceTrackingOnThread(I #pragma warning disable IDE0060, CS3016 [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] + [RequiresUnsafe] internal static unsafe int IReferenceTrackerHost_GetTrackerTarget(IntPtr pThis, IntPtr punk, IntPtr* ppNewReference) #pragma warning restore IDE0060, CS3016 { @@ -133,6 +135,7 @@ internal static int IReferenceTrackerHost_RemoveMemoryPressure(IntPtr pThis, lon #pragma warning disable CS3016 [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] + [RequiresUnsafe] internal static unsafe int IReferenceTrackerHost_QueryInterface(IntPtr pThis, Guid* guid, IntPtr* ppObject) #pragma warning restore CS3016 { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/TypeMapLazyDictionary.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/TypeMapLazyDictionary.cs index 048b0a4679f83f..d245e8f2639d25 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/TypeMapLazyDictionary.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/TypeMapLazyDictionary.cs @@ -73,6 +73,7 @@ public unsafe struct ProcessAttributesCallbackArg } [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "TypeMapLazyDictionary_ProcessAttributes")] + [RequiresUnsafe] private static unsafe partial void ProcessAttributes( QCallAssembly assembly, QCallTypeHandle groupType, @@ -119,6 +120,7 @@ private static void ConvertUtf8ToUtf16(ReadOnlySpan utf8TypeName, out Utf1 } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe Interop.BOOL NewExternalTypeEntry(CallbackContext* context, ProcessAttributesCallbackArg* arg) { Debug.Assert(context != null); @@ -146,6 +148,7 @@ private static unsafe Interop.BOOL NewExternalTypeEntry(CallbackContext* context } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe Interop.BOOL NewProxyTypeEntry(CallbackContext* context, ProcessAttributesCallbackArg* arg) { Debug.Assert(context != null); @@ -184,6 +187,7 @@ private static unsafe Interop.BOOL NewProxyTypeEntry(CallbackContext* context, P return Interop.BOOL.TRUE; // Continue processing. } + [RequiresUnsafe] private static unsafe CallbackContext CreateMaps( RuntimeType groupType, delegate* unmanaged newExternalTypeEntry, @@ -272,6 +276,7 @@ public Type this[TKey key] private unsafe struct TypeNameUtf8 { + [RequiresUnsafe] public required void* Utf8TypeName { get; init; } public required int Utf8TypeNameLen { get; init; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs index 1e78b13e8a2c5b..31499f7211a606 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs @@ -1550,519 +1550,688 @@ internal Arm64() { } public static Vector128 InsertSelectedScalar(Vector128 result, [ConstantExpected(Max = (byte)(1))] byte resultIndex, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte valueIndex) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// /// float64x2_t vld1q_dup_f64 (float64_t const * ptr) /// A64: LD1R { Vt.2D }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(double* address) { throw new PlatformNotSupportedException(); } /// /// int64x2_t vld1q_dup_s64 (int64_t const * ptr) /// A64: LD1R { Vt.2D }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(long* address) { throw new PlatformNotSupportedException(); } /// /// uint64x2_t vld1q_dup_u64 (uint64_t const * ptr) /// A64: LD1R { Vt.2D }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(short* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(long* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LDP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(short* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(long* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(short* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(long* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairVector64NonTemporal(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64NonTemporal(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64NonTemporal(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadPairScalarVector64NonTemporal(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(double* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(short* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(int* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(long* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(float* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LDNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128AndUnzip(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128AndUnzip(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128AndUnzip(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2) Load2xVector128(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) Load3xVector128(double* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(long* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D}, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) Load4xVector128(double* address) { throw new PlatformNotSupportedException(); } /// @@ -3217,474 +3386,610 @@ internal Arm64() { } public static Vector128 Sqrt(Vector128 value) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(byte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(double* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(short* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(long* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(sbyte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(ushort* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(ulong* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(byte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(double* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(short* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(int* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(long* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(sbyte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(float* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(ushort* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(uint* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePair(ulong* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(byte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(double* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(short* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(long* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(sbyte* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ushort* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Dt1, Dt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ulong* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(byte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(double* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(short* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(int* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(long* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(sbyte* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(float* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ushort* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(uint* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP Qt1, Qt2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairNonTemporal(ulong* address, Vector128 value1, Vector128 value2) { throw new PlatformNotSupportedException(); } /// A64: STP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairScalar(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairScalar(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairScalar(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairScalarNonTemporal(int* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairScalarNonTemporal(float* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// A64: STNP St1, St2, [Xn] + [RequiresUnsafe] public static unsafe void StorePairScalarNonTemporal(uint* address, Vector64 value1, Vector64 value2) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s8 (int8_t * ptr, int8x16x2_t val, const int lane) /// A64: ST2 { Vt.16B, Vt+1.16B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s8 (int8_t * ptr, int8x16x2_t val, const int lane) /// A64: ST2 { Vt.16B, Vt+1.16B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s16 (int16_t * ptr, int16x8x2_t val, const int lane) /// A64: ST2 { Vt.8H, Vt+1.8H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s16 (int16_t * ptr, int16x8x2_t val, const int lane) /// A64: ST2 { Vt.8H, Vt+1.8H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s32 (int32_t * ptr, int32x4x2_t val, const int lane) /// A64: ST2 { Vt.4S, Vt+1.4S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_s32 (int32_t * ptr, int32x4x2_t val, const int lane) /// A64: ST2 { Vt.4S, Vt+1.4S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2D, Vt+1.2D }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2D, Vt+1.2D }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst2_lane_f32 (float32_t * ptr, float32x2x2_t val, const int lane) /// A64: ST2 { Vt.4S, Vt+1.4S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2D, Vt+1.2D }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, (Vector128 value1, Vector128 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s8 (int8_t * ptr, int8x16x3_t val, const int lane) /// A64: ST3 { Vt.16B, Vt+1.16B, Vt+2.16B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s8 (int8_t * ptr, int8x16x3_t val, const int lane) /// A64: ST3 { Vt.16B, Vt+1.16B, Vt+2.16B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s16 (int16_t * ptr, int16x8x3_t val, const int lane) /// A64: ST3 { Vt.8H, Vt+1.8H, Vt+2.8H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s16 (int16_t * ptr, int16x8x3_t val, const int lane) /// A64: ST3 { Vt.8H, Vt+1.8H, Vt+2.8H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s32 (int32_t * ptr, int32x4x3_t val, const int lane) /// A64: ST3 { Vt.4S, Vt+1.4S, Vt+2.4S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_s32 (int32_t * ptr, int32x4x3_t val, const int lane) /// A64: ST3 { Vt.4S, Vt+1.4S, Vt+2.4S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2D, Vt+1.2D, Vt+2.2D }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2D, Vt+1.2D, Vt+2.2D }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst3_lane_f32 (float32_t * ptr, float32x2x3_t val, const int lane) /// A64: ST3 { Vt.4S, Vt+1.4S, Vt+2.4S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2D, Vt+1.2D, Vt+2.2D }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, (Vector128 value1, Vector128 value2, Vector128 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s8 (int8_t * ptr, int8x16x4_t val, const int lane) /// A64: ST4 { Vt.16B, Vt+1.16B, Vt+2.16B, Vt+3.16B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s8 (int8_t * ptr, int8x16x4_t val, const int lane) /// A64: ST4 { Vt.16B, Vt+1.16B, Vt+2.16B, Vt+3.16B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s16 (int16_t * ptr, int16x8x4_t val, const int lane) /// A64: ST4 { Vt.8H, Vt+1.8H, Vt+2.8H, Vt+3.8H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } - /// + /// /// void vst4_lane_s16 (int16_t * ptr, int16x8x4_t val, const int lane) /// A64: ST4 { Vt.8H, Vt+1.8H, Vt+2.8H, Vt+3.8H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s32 (int32_t * ptr, int32x4x4_t val, const int lane) /// A64: ST4 { Vt.4S, Vt+1.4S, Vt+2.4S, Vt+3.4S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_s32 (int32_t * ptr, int32x4x4_t val, const int lane) /// A64: ST4 { Vt.4S, Vt+1.4S, Vt+2.4S, Vt+3.4S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2D, Vt+1.2D, Vt+2.2D, Vt+3.2D }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2D, Vt+1.2D, Vt+2.2D, Vt+3.2D }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// /// void vst4_lane_f32 (float32_t * ptr, float32x2x4_t val, const int lane) /// A64: ST4 { Vt.4S, Vt+1.4S, Vt+2.4S, Vt+3.4S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2D, Vt+1.2D, Vt+2.2D, Vt+3.2D }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, (Vector128 value1, Vector128 value2, Vector128 value3, Vector128 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(long* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ulong* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(double* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(short* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(int* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe void Store(long* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe void Store(ulong* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(float* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D }, [Xn] + [RequiresUnsafe] public static unsafe void Store(double* address, (Vector128 Value1, Vector128 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe void Store(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe void Store(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + [RequiresUnsafe] public static unsafe void Store(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(short* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(int* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe void Store(long* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe void Store(ulong* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(float* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + [RequiresUnsafe] public static unsafe void Store(double* address, (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) value) { throw new PlatformNotSupportedException(); } /// @@ -8485,6 +8790,7 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// @@ -8492,6 +8798,7 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// @@ -8499,6 +8806,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// @@ -8506,6 +8814,7 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -8513,6 +8822,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// @@ -8520,6 +8830,7 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -8527,6 +8838,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndInsertScalar(Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// @@ -8534,6 +8846,7 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// @@ -8541,6 +8854,7 @@ internal Arm64() { } /// A32: VLDR.64 Dd, [Rn] /// A64: LD1 { Vt.D }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// @@ -8548,6 +8862,7 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// @@ -8555,6 +8870,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// @@ -8562,6 +8878,7 @@ internal Arm64() { } /// A32: VLDR.64 Dd, [Rn] /// A64: LD1 { Vt.D }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// @@ -8569,6 +8886,7 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[index] }, [Rn] /// A64: LD1 { Vt.B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -8576,6 +8894,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// @@ -8583,6 +8902,7 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[index] }, [Rn] /// A64: LD1 { Vt.H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -8590,6 +8910,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[index] }, [Rn] /// A64: LD1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// @@ -8597,69 +8918,91 @@ internal Arm64() { } /// A32: VLDR.64 Dd, [Rn] /// A64: LD1 { Vt.D }[index], [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndInsertScalar(Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// @@ -8667,6 +9010,7 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[] }, [Rn] /// A64: LD1R { Vt.8B }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(byte* address) { throw new PlatformNotSupportedException(); } /// @@ -8674,6 +9018,7 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[] }, [Rn] /// A64: LD1R { Vt.4H }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(short* address) { throw new PlatformNotSupportedException(); } /// @@ -8681,6 +9026,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[] }, [Rn] /// A64: LD1R { Vt.2S }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(int* address) { throw new PlatformNotSupportedException(); } /// @@ -8688,6 +9034,7 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[] }, [Rn] /// A64: LD1R { Vt.8B }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -8695,6 +9042,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[] }, [Rn] /// A64: LD1R { Vt.2S }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(float* address) { throw new PlatformNotSupportedException(); } /// @@ -8702,6 +9050,7 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[] }, [Rn] /// A64: LD1R { Vt.4H }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -8709,6 +9058,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[] }, [Rn] /// A64: LD1R { Vt.2S }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadAndReplicateToVector64(uint* address) { throw new PlatformNotSupportedException(); } /// @@ -8716,6 +9066,7 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.16B }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(byte* address) { throw new PlatformNotSupportedException(); } /// @@ -8723,6 +9074,7 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.8H }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(short* address) { throw new PlatformNotSupportedException(); } /// @@ -8730,6 +9082,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.4S }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(int* address) { throw new PlatformNotSupportedException(); } /// @@ -8737,6 +9090,7 @@ internal Arm64() { } /// A32: VLD1.8 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.16B }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -8744,6 +9098,7 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.4S }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(float* address) { throw new PlatformNotSupportedException(); } /// @@ -8751,6 +9106,7 @@ internal Arm64() { } /// A32: VLD1.16 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.8H }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -8758,69 +9114,91 @@ internal Arm64() { } /// A32: VLD1.32 { Dd[], Dd+1[] }, [Rn] /// A64: LD1R { Vt.4S }, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndReplicateToVector128(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(float* address) { throw new PlatformNotSupportedException(); } /// @@ -8828,6 +9206,7 @@ internal Arm64() { } /// A32: VLD1.8 Dd, [Rn] /// A64: LD1 Vt.8B, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(byte* address) { throw new PlatformNotSupportedException(); } /// @@ -8835,6 +9214,7 @@ internal Arm64() { } /// A32: VLD1.64 Dd, [Rn] /// A64: LD1 Vt.1D, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(double* address) { throw new PlatformNotSupportedException(); } /// @@ -8842,6 +9222,7 @@ internal Arm64() { } /// A32: VLD1.16 Dd, [Rn] /// A64: LD1 Vt.4H, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(short* address) { throw new PlatformNotSupportedException(); } /// @@ -8849,6 +9230,7 @@ internal Arm64() { } /// A32: VLD1.32 Dd, [Rn] /// A64: LD1 Vt.2S, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(int* address) { throw new PlatformNotSupportedException(); } /// @@ -8856,6 +9238,7 @@ internal Arm64() { } /// A32: VLD1.64 Dd, [Rn] /// A64: LD1 Vt.1D, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(long* address) { throw new PlatformNotSupportedException(); } /// @@ -8863,6 +9246,7 @@ internal Arm64() { } /// A32: VLD1.8 Dd, [Rn] /// A64: LD1 Vt.8B, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -8870,6 +9254,7 @@ internal Arm64() { } /// A32: VLD1.32 Dd, [Rn] /// A64: LD1 Vt.2S, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(float* address) { throw new PlatformNotSupportedException(); } /// @@ -8877,6 +9262,7 @@ internal Arm64() { } /// A32: VLD1.16 Dd, [Rn] /// A64: LD1 Vt.4H, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -8884,6 +9270,7 @@ internal Arm64() { } /// A32: VLD1.32 Dd, [Rn] /// A64: LD1 Vt.2S, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(uint* address) { throw new PlatformNotSupportedException(); } /// @@ -8891,6 +9278,7 @@ internal Arm64() { } /// A32: VLD1.64 Dd, [Rn] /// A64: LD1 Vt.1D, [Xn] /// + [RequiresUnsafe] public static unsafe Vector64 LoadVector64(ulong* address) { throw new PlatformNotSupportedException(); } /// @@ -8898,6 +9286,7 @@ internal Arm64() { } /// A32: VLD1.8 Dd, Dd+1, [Rn] /// A64: LD1 Vt.16B, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(byte* address) { throw new PlatformNotSupportedException(); } /// @@ -8905,6 +9294,7 @@ internal Arm64() { } /// A32: VLD1.64 Dd, Dd+1, [Rn] /// A64: LD1 Vt.2D, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(double* address) { throw new PlatformNotSupportedException(); } /// @@ -8912,6 +9302,7 @@ internal Arm64() { } /// A32: VLD1.16 Dd, Dd+1, [Rn] /// A64: LD1 Vt.8H, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(short* address) { throw new PlatformNotSupportedException(); } /// @@ -8919,6 +9310,7 @@ internal Arm64() { } /// A32: VLD1.32 Dd, Dd+1, [Rn] /// A64: LD1 Vt.4S, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(int* address) { throw new PlatformNotSupportedException(); } /// @@ -8926,6 +9318,7 @@ internal Arm64() { } /// A32: VLD1.64 Dd, Dd+1, [Rn] /// A64: LD1 Vt.2D, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(long* address) { throw new PlatformNotSupportedException(); } /// @@ -8933,6 +9326,7 @@ internal Arm64() { } /// A32: VLD1.8 Dd, Dd+1, [Rn] /// A64: LD1 Vt.16B, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -8940,6 +9334,7 @@ internal Arm64() { } /// A32: VLD1.32 Dd, Dd+1, [Rn] /// A64: LD1 Vt.4S, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(float* address) { throw new PlatformNotSupportedException(); } /// @@ -8947,6 +9342,7 @@ internal Arm64() { } /// A32: VLD1.16 Dd, Dd+1, [Rn] /// A64: LD1 Vt.8H, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -8954,6 +9350,7 @@ internal Arm64() { } /// A32: VLD1.32 Dd, Dd+1, [Rn] /// A64: LD1 Vt.4S, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(uint* address) { throw new PlatformNotSupportedException(); } /// @@ -8961,132 +9358,175 @@ internal Arm64() { } /// A32: VLD1.64 Dd, Dd+1, [Rn] /// A64: LD1 Vt.2D, [Xn] /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2) Load2xVector64(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) Load3xVector64(float* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(byte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(sbyte* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(short* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(ushort* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(int* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(uint* address) { throw new PlatformNotSupportedException(); } /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) Load4xVector64(float* address) { throw new PlatformNotSupportedException(); } /// @@ -14951,6 +15391,7 @@ internal Arm64() { } /// A32: VST1.8 { Dd }, [Rn] /// A64: ST1 { Vt.8B }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(byte* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -14958,6 +15399,7 @@ internal Arm64() { } /// A32: VST1.64 { Dd }, [Rn] /// A64: ST1 { Vt.1D }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(double* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -14965,6 +15407,7 @@ internal Arm64() { } /// A32: VST1.16 { Dd }, [Rn] /// A64: ST1 {Vt.4H }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(short* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -14972,6 +15415,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd }, [Rn] /// A64: ST1 { Vt.2S }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(int* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -14979,6 +15423,7 @@ internal Arm64() { } /// A32: VST1.64 { Dd }, [Rn] /// A64: ST1 { Vt.1D }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(long* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -14986,6 +15431,7 @@ internal Arm64() { } /// A32: VST1.8 { Dd }, [Rn] /// A64: ST1 { Vt.8B }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -14993,6 +15439,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd }, [Rn] /// A64: ST1 { Vt.2S }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(float* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15000,6 +15447,7 @@ internal Arm64() { } /// A32: VST1.16 { Dd }, [Rn] /// A64: ST1 { Vt.4H }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15007,6 +15455,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd }, [Rn] /// A64: ST1 { Vt.2S }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(uint* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15014,6 +15463,7 @@ internal Arm64() { } /// A32: VST1.64 { Dd }, [Rn] /// A64: ST1 { Vt.1D }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector64 source) { throw new PlatformNotSupportedException(); } /// @@ -15021,6 +15471,7 @@ internal Arm64() { } /// A32: VST1.8 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.16B }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(byte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15028,6 +15479,7 @@ internal Arm64() { } /// A32: VST1.64 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.2D }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15035,6 +15487,7 @@ internal Arm64() { } /// A32: VST1.16 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.8H }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(short* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15042,6 +15495,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.4S }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(int* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15049,6 +15503,7 @@ internal Arm64() { } /// A32: VST1.64 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.2D }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(long* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15056,6 +15511,7 @@ internal Arm64() { } /// A32: VST1.8 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.16B }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15063,6 +15519,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.4S }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15070,6 +15527,7 @@ internal Arm64() { } /// A32: VST1.16 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.8H }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15077,6 +15535,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.4S }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(uint* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15084,6 +15543,7 @@ internal Arm64() { } /// A32: VST1.64 { Dd, Dd+1 }, [Rn] /// A64: ST1 { Vt.2D }, [Xn] /// + [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector128 source) { throw new PlatformNotSupportedException(); } /// @@ -15091,6 +15551,7 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15098,6 +15559,7 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15105,6 +15567,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15112,6 +15575,7 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, Vector64 value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15119,6 +15583,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15126,6 +15591,7 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, Vector64 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15133,6 +15599,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, Vector64 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15140,6 +15607,7 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15147,6 +15615,7 @@ internal Arm64() { } /// A32: VSTR.64 Dd, [Rn] /// A64: ST1 { Vt.D }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15154,6 +15623,7 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15161,6 +15631,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15168,6 +15639,7 @@ internal Arm64() { } /// A32: VSTR.64 Dd, [Rn] /// A64: ST1 { Vt.D }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15175,6 +15647,7 @@ internal Arm64() { } /// A32: VST1.8 { Dd[index] }, [Rn] /// A64: ST1 { Vt.B }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, Vector128 value, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15182,6 +15655,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15189,6 +15663,7 @@ internal Arm64() { } /// A32: VST1.16 { Dd[index] }, [Rn] /// A64: ST1 { Vt.H }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, Vector128 value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15196,6 +15671,7 @@ internal Arm64() { } /// A32: VST1.32 { Dd[index] }, [Rn] /// A64: ST1 { Vt.S }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, Vector128 value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// @@ -15203,195 +15679,259 @@ internal Arm64() { } /// A32: VSTR.64 Dd, [Rn] /// A64: ST1 { Vt.D }[index], [Xn] /// + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, Vector128 value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.8B, Vt+1.8B }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.8B, Vt+1.8B }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.4H, Vt+1.4H }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.4H, Vt+1.4H }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2S, Vt+1.2S }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2S, Vt+1.2S }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2S, Vt+1.2S }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector64 value1, Vector64 value2) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.8B, Vt+1.8B, Vt+2.8B }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.8B, Vt+1.8B, Vt+2.8B }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.4H, Vt+1.4H, Vt+2.4H }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.4H, Vt+1.4H, Vt+2.4H }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2S, Vt+1.2S, Vt+2.2S }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vt.2S, Vt+1.2S, Vt+2.2S }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vt.2S, Vt+1.2S, Vt+2.2S }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector64 value1, Vector64 value2, Vector64 value3) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.8B, Vt+1.8B, Vt+2.8B, Vt+3.8B }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.8B, Vt+1.8B, Vt+2.8B, Vt+3.8B }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.4H, Vt+1.4H, Vt+2.4H, Vt+3.4H }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.4H, Vt+1.4H, Vt+2.4H, Vt+3.4H }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2S, Vt+1.2S, Vt+2.2S, Vt+3.2S }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2S, Vt+1.2S, Vt+2.2S, Vt+3.2S }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vt.2S, Vt+1.2S, Vt+2.2S, Vt+3.2S }[index], [Xn] + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, (Vector64 value1, Vector64 value2, Vector64 value3, Vector64 value4) value, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST2 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe void StoreVectorAndZip(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(short* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(int* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(float* address, (Vector64 Value1, Vector64 Value2) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(byte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] + [RequiresUnsafe] public static unsafe void Store(sbyte* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(short* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] + [RequiresUnsafe] public static unsafe void Store(ushort* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(int* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(uint* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// A64: ST1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] + [RequiresUnsafe] public static unsafe void Store(float* address, (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) value) { throw new PlatformNotSupportedException(); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs index 6e013db76ae088..f4c3b1892ccff4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs @@ -3454,12 +3454,14 @@ internal Arm64() { } /// void svprfh_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfh_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3473,6 +3475,7 @@ internal Arm64() { } /// void svprfh_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3485,18 +3488,21 @@ internal Arm64() { } /// void svprfh_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfh_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfh_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3510,6 +3516,7 @@ internal Arm64() { } /// void svprfh_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3522,6 +3529,7 @@ internal Arm64() { } /// void svprfh_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFH op, Pg, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch16Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -3531,12 +3539,14 @@ internal Arm64() { } /// void svprfw_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, SXTW #2] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfw_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3550,6 +3560,7 @@ internal Arm64() { } /// void svprfw_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, UXTW #2] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3562,18 +3573,21 @@ internal Arm64() { } /// void svprfw_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfw_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, SXTW #2] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfw_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3587,6 +3601,7 @@ internal Arm64() { } /// void svprfw_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.S, UXTW #2] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3599,6 +3614,7 @@ internal Arm64() { } /// void svprfw_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFW op, Pg, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch32Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -3608,12 +3624,14 @@ internal Arm64() { } /// void svprfd_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, SXTW #3] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfd_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3627,6 +3645,7 @@ internal Arm64() { } /// void svprfd_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, UXTW #3] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3639,18 +3658,21 @@ internal Arm64() { } /// void svprfd_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfd_gather_[s32]index(svbool_t pg, const void *base, svint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, SXTW #3] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfd_gather_[s64]index(svbool_t pg, const void *base, svint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3664,6 +3686,7 @@ internal Arm64() { } /// void svprfd_gather_[u32]index(svbool_t pg, const void *base, svuint32_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.S, UXTW #3] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3676,6 +3699,7 @@ internal Arm64() { } /// void svprfd_gather_[u64]index(svbool_t pg, const void *base, svuint64_t indices, enum svprfop op) /// PRFD op, Pg, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch64Bit(Vector mask, void* address, Vector indices, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -3685,12 +3709,14 @@ internal Arm64() { } /// void svprfb_gather_[s32]offset(svbool_t pg, const void *base, svint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfb_gather_[s64]offset(svbool_t pg, const void *base, svint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3704,6 +3730,7 @@ internal Arm64() { } /// void svprfb_gather_[u32]offset(svbool_t pg, const void *base, svuint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3716,18 +3743,21 @@ internal Arm64() { } /// void svprfb_gather_[u64]offset(svbool_t pg, const void *base, svuint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfb_gather_[s32]offset(svbool_t pg, const void *base, svint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// /// void svprfb_gather_[s64]offset(svbool_t pg, const void *base, svint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } // @@ -3741,6 +3771,7 @@ internal Arm64() { } /// void svprfb_gather_[u32]offset(svbool_t pg, const void *base, svuint32_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } /// @@ -3753,6 +3784,7 @@ internal Arm64() { } /// void svprfb_gather_[u64]offset(svbool_t pg, const void *base, svuint64_t offsets, enum svprfop op) /// PRFB op, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void GatherPrefetch8Bit(Vector mask, void* address, Vector offsets, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -3762,6 +3794,7 @@ internal Arm64() { } /// svfloat64_t svld1_gather_[s64]index[_f64](svbool_t pg, const float64_t *base, svint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, double* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -3774,12 +3807,14 @@ internal Arm64() { } /// svfloat64_t svld1_gather_[u64]index[_f64](svbool_t pg, const float64_t *base, svuint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, double* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1_gather_[s32]index[_s32](svbool_t pg, const int32_t *base, svint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -3793,12 +3828,14 @@ internal Arm64() { } /// svint32_t svld1_gather_[u32]index[_s32](svbool_t pg, const int32_t *base, svuint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1_gather_[s64]index[_s64](svbool_t pg, const int64_t *base, svint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, long* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -3811,12 +3848,14 @@ internal Arm64() { } /// svint64_t svld1_gather_[u64]index[_s64](svbool_t pg, const int64_t *base, svuint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, long* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svld1_gather_[s32]index[_f32](svbool_t pg, const float32_t *base, svint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, float* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -3830,12 +3869,14 @@ internal Arm64() { } /// svfloat32_t svld1_gather_[u32]index[_f32](svbool_t pg, const float32_t *base, svuint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, float* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1_gather_[s32]index[_u32](svbool_t pg, const uint32_t *base, svint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -3849,12 +3890,14 @@ internal Arm64() { } /// svuint32_t svld1_gather_[u32]index[_u32](svbool_t pg, const uint32_t *base, svuint32_t indices) /// LD1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1_gather_[s64]index[_u64](svbool_t pg, const uint64_t *base, svint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, ulong* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -3867,6 +3910,7 @@ internal Arm64() { } /// svuint64_t svld1_gather_[u64]index[_u64](svbool_t pg, const uint64_t *base, svuint64_t indices) /// LD1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVector(Vector mask, ulong* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -3876,6 +3920,7 @@ internal Arm64() { } /// svint32_t svld1ub_gather_[s32]offset_s32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -3889,12 +3934,14 @@ internal Arm64() { } /// svint32_t svld1ub_gather_[u32]offset_s32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1ub_gather_[s64]offset_s64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -3907,12 +3954,14 @@ internal Arm64() { } /// svint64_t svld1ub_gather_[u64]offset_s64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1ub_gather_[s32]offset_u32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -3926,12 +3975,14 @@ internal Arm64() { } /// svuint32_t svld1ub_gather_[u32]offset_u32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LD1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1ub_gather_[s64]offset_u64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -3944,6 +3995,7 @@ internal Arm64() { } /// svuint64_t svld1ub_gather_[u64]offset_u64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LD1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtend(Vector mask, byte* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -3953,6 +4005,7 @@ internal Arm64() { } /// svint32_t svldff1ub_gather_[s32]offset_s32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } // @@ -3966,12 +4019,14 @@ internal Arm64() { } /// svint32_t svldff1ub_gather_[u32]offset_s32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1ub_gather_[s64]offset_s64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// @@ -3984,12 +4039,14 @@ internal Arm64() { } /// svint64_t svldff1ub_gather_[u64]offset_s64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1ub_gather_[s32]offset_u32(svbool_t pg, const uint8_t *base, svint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } // @@ -4003,12 +4060,14 @@ internal Arm64() { } /// svuint32_t svldff1ub_gather_[u32]offset_u32(svbool_t pg, const uint8_t *base, svuint32_t offsets) /// LDFF1B Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1ub_gather_[s64]offset_u64(svbool_t pg, const uint8_t *base, svint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// @@ -4021,6 +4080,7 @@ internal Arm64() { } /// svuint64_t svldff1ub_gather_[u64]offset_u64(svbool_t pg, const uint8_t *base, svuint64_t offsets) /// LDFF1B Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorByteZeroExtendFirstFaulting(Vector mask, byte* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4030,6 +4090,7 @@ internal Arm64() { } /// svfloat64_t svldff1_gather_[s64]index[_f64](svbool_t pg, const float64_t *base, svint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, double* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4042,6 +4103,7 @@ internal Arm64() { } /// svfloat64_t svldff1_gather_[u64]index[_f64](svbool_t pg, const float64_t *base, svuint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, double* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4055,12 +4117,14 @@ internal Arm64() { } /// svint32_t svldff1_gather_[s32]index[_s32](svbool_t pg, const int32_t *base, svint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1_gather_[u32]index[_s32](svbool_t pg, const int32_t *base, svuint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4073,18 +4137,21 @@ internal Arm64() { } /// svint64_t svldff1_gather_[s64]index[_s64](svbool_t pg, const int64_t *base, svint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, long* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1_gather_[u64]index[_s64](svbool_t pg, const int64_t *base, svuint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, long* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldff1_gather_[s32]index[_f32](svbool_t pg, const float32_t *base, svint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, float* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4098,6 +4165,7 @@ internal Arm64() { } /// svfloat32_t svldff1_gather_[u32]index[_f32](svbool_t pg, const float32_t *base, svuint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, float* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4111,12 +4179,14 @@ internal Arm64() { } /// svuint32_t svldff1_gather_[s32]index[_u32](svbool_t pg, const uint32_t *base, svint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1_gather_[u32]index[_u32](svbool_t pg, const uint32_t *base, svuint32_t indices) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4129,12 +4199,14 @@ internal Arm64() { } /// svuint64_t svldff1_gather_[s64]index[_u64](svbool_t pg, const uint64_t *base, svint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, ulong* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1_gather_[u64]index[_u64](svbool_t pg, const uint64_t *base, svuint64_t indices) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorFirstFaulting(Vector mask, ulong* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4144,6 +4216,7 @@ internal Arm64() { } /// svint32_t svld1sh_gather_[s32]index_s32(svbool_t pg, const int16_t *base, svint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4157,12 +4230,14 @@ internal Arm64() { } /// svint32_t svld1sh_gather_[u32]index_s32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sh_gather_[s64]index_s64(svbool_t pg, const int16_t *base, svint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4175,12 +4250,14 @@ internal Arm64() { } /// svint64_t svld1sh_gather_[u64]index_s64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1sh_gather_[s32]index_u32(svbool_t pg, const int16_t *base, svint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4194,12 +4271,14 @@ internal Arm64() { } /// svuint32_t svld1sh_gather_[u32]index_u32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sh_gather_[s64]index_u64(svbool_t pg, const int16_t *base, svint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4212,6 +4291,7 @@ internal Arm64() { } /// svuint64_t svld1sh_gather_[u64]index_u64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtend(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4221,6 +4301,7 @@ internal Arm64() { } /// svint32_t svldff1sh_gather_[s32]index_s32(svbool_t pg, const int16_t *base, svint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4234,12 +4315,14 @@ internal Arm64() { } /// svint32_t svldff1sh_gather_[u32]index_s32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sh_gather_[s64]index_s64(svbool_t pg, const int16_t *base, svint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4252,12 +4335,14 @@ internal Arm64() { } /// svint64_t svldff1sh_gather_[u64]index_s64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sh_gather_[s32]index_u32(svbool_t pg, const int16_t *base, svint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4271,12 +4356,14 @@ internal Arm64() { } /// svuint32_t svldff1sh_gather_[u32]index_u32(svbool_t pg, const int16_t *base, svuint32_t indices) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sh_gather_[s64]index_u64(svbool_t pg, const int16_t *base, svint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4289,6 +4376,7 @@ internal Arm64() { } /// svuint64_t svldff1sh_gather_[u64]index_u64(svbool_t pg, const int16_t *base, svuint64_t indices) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16SignExtendFirstFaulting(Vector mask, short* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4298,48 +4386,56 @@ internal Arm64() { } /// svint32_t svld1sh_gather_[s32]offset_s32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1sh_gather_[u32]offset_s32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sh_gather_[s64]offset_s64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sh_gather_[u64]offset_s64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1sh_gather_[s32]offset_u32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1sh_gather_[u32]offset_u32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LD1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sh_gather_[s64]offset_u64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sh_gather_[u64]offset_u64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LD1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtend(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4349,48 +4445,56 @@ internal Arm64() { } /// svint32_t svldff1sh_gather_[s32]offset_s32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1sh_gather_[u32]offset_s32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sh_gather_[s64]offset_s64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sh_gather_[u64]offset_s64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sh_gather_[s32]offset_u32(svbool_t pg, const int16_t *base, svint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sh_gather_[u32]offset_u32(svbool_t pg, const int16_t *base, svuint32_t offsets) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sh_gather_[s64]offset_u64(svbool_t pg, const int16_t *base, svint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sh_gather_[u64]offset_u64(svbool_t pg, const int16_t *base, svuint64_t offsets) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt16WithByteOffsetsSignExtendFirstFaulting(Vector mask, short* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4400,6 +4504,7 @@ internal Arm64() { } /// svint64_t svld1sw_gather_[s64]index_s64(svbool_t pg, const int32_t *base, svint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4412,12 +4517,14 @@ internal Arm64() { } /// svint64_t svld1sw_gather_[u64]index_s64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sw_gather_[s64]index_u64(svbool_t pg, const int32_t *base, svint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4430,6 +4537,7 @@ internal Arm64() { } /// svuint64_t svld1sw_gather_[u64]index_u64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtend(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4439,6 +4547,7 @@ internal Arm64() { } /// svint64_t svldff1sw_gather_[s64]index_s64(svbool_t pg, const int32_t *base, svint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4451,12 +4560,14 @@ internal Arm64() { } /// svint64_t svldff1sw_gather_[u64]index_s64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sw_gather_[s64]index_u64(svbool_t pg, const int32_t *base, svint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4469,6 +4580,7 @@ internal Arm64() { } /// svuint64_t svldff1sw_gather_[u64]index_u64(svbool_t pg, const int32_t *base, svuint64_t indices) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32SignExtendFirstFaulting(Vector mask, int* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4478,24 +4590,28 @@ internal Arm64() { } /// svint64_t svld1sw_gather_[s64]offset_s64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sw_gather_[u64]offset_s64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sw_gather_[s64]offset_u64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sw_gather_[u64]offset_u64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LD1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtend(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4505,24 +4621,28 @@ internal Arm64() { } /// svint64_t svldff1sw_gather_[s64]offset_s64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sw_gather_[u64]offset_s64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sw_gather_[s64]offset_u64(svbool_t pg, const int32_t *base, svint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sw_gather_[u64]offset_u64(svbool_t pg, const int32_t *base, svuint64_t offsets) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorInt32WithByteOffsetsSignExtendFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4532,6 +4652,7 @@ internal Arm64() { } /// svint32_t svld1sb_gather_[s32]offset_s32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4545,12 +4666,14 @@ internal Arm64() { } /// svint32_t svld1sb_gather_[u32]offset_s32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1sb_gather_[s64]offset_s64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4563,12 +4686,14 @@ internal Arm64() { } /// svint64_t svld1sb_gather_[u64]offset_s64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1sb_gather_[s32]offset_u32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4582,12 +4707,14 @@ internal Arm64() { } /// svuint32_t svld1sb_gather_[u32]offset_u32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LD1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1sb_gather_[s64]offset_u64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4600,6 +4727,7 @@ internal Arm64() { } /// svuint64_t svld1sb_gather_[u64]offset_u64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LD1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtend(Vector mask, sbyte* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4609,6 +4737,7 @@ internal Arm64() { } /// svint32_t svldff1sb_gather_[s32]offset_s32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } // @@ -4622,12 +4751,14 @@ internal Arm64() { } /// svint32_t svldff1sb_gather_[u32]offset_s32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sb_gather_[s64]offset_s64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// @@ -4640,12 +4771,14 @@ internal Arm64() { } /// svint64_t svldff1sb_gather_[u64]offset_s64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sb_gather_[s32]offset_u32(svbool_t pg, const int8_t *base, svint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } // @@ -4659,12 +4792,14 @@ internal Arm64() { } /// svuint32_t svldff1sb_gather_[u32]offset_u32(svbool_t pg, const int8_t *base, svuint32_t offsets) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sb_gather_[s64]offset_u64(svbool_t pg, const int8_t *base, svint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// @@ -4677,6 +4812,7 @@ internal Arm64() { } /// svuint64_t svldff1sb_gather_[u64]offset_u64(svbool_t pg, const int8_t *base, svuint64_t offsets) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4686,48 +4822,56 @@ internal Arm64() { } /// svint32_t svld1uh_gather_[s32]offset_s32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1uh_gather_[u32]offset_s32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1uh_gather_[s64]offset_s64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1uh_gather_[u64]offset_s64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1uh_gather_[s32]offset_u32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1uh_gather_[u32]offset_u32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LD1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uh_gather_[s64]offset_u64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uh_gather_[u64]offset_u64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LD1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtend(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4737,48 +4881,56 @@ internal Arm64() { } /// svint32_t svldff1uh_gather_[s32]offset_s32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1uh_gather_[u32]offset_s32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uh_gather_[s64]offset_s64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uh_gather_[u64]offset_s64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1uh_gather_[s32]offset_u32(svbool_t pg, const uint16_t *base, svint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1uh_gather_[u32]offset_u32(svbool_t pg, const uint16_t *base, svuint32_t offsets) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uh_gather_[s64]offset_u64(svbool_t pg, const uint16_t *base, svint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uh_gather_[u64]offset_u64(svbool_t pg, const uint16_t *base, svuint64_t offsets) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16WithByteOffsetsZeroExtendFirstFaulting(Vector mask, ushort* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4788,6 +4940,7 @@ internal Arm64() { } /// svint32_t svld1uh_gather_[s32]index_s32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4801,12 +4954,14 @@ internal Arm64() { } /// svint32_t svld1uh_gather_[u32]index_s32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1uh_gather_[s64]index_s64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4819,12 +4974,14 @@ internal Arm64() { } /// svint64_t svld1uh_gather_[u64]index_s64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1uh_gather_[s32]index_u32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4838,12 +4995,14 @@ internal Arm64() { } /// svuint32_t svld1uh_gather_[u32]index_u32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LD1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uh_gather_[s64]index_u64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4856,6 +5015,7 @@ internal Arm64() { } /// svuint64_t svld1uh_gather_[u64]index_u64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LD1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtend(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4865,6 +5025,7 @@ internal Arm64() { } /// svint32_t svldff1uh_gather_[s32]index_s32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4878,12 +5039,14 @@ internal Arm64() { } /// svint32_t svldff1uh_gather_[u32]index_s32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uh_gather_[s64]index_s64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4896,12 +5059,14 @@ internal Arm64() { } /// svint64_t svldff1uh_gather_[u64]index_s64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1uh_gather_[s32]index_u32(svbool_t pg, const uint16_t *base, svint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } // @@ -4915,12 +5080,14 @@ internal Arm64() { } /// svuint32_t svldff1uh_gather_[u32]index_u32(svbool_t pg, const uint16_t *base, svuint32_t indices) /// LDFF1H Zresult.S, Pg/Z, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uh_gather_[s64]index_u64(svbool_t pg, const uint16_t *base, svint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -4933,6 +5100,7 @@ internal Arm64() { } /// svuint64_t svldff1uh_gather_[u64]index_u64(svbool_t pg, const uint16_t *base, svuint64_t indices) /// LDFF1H Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -4942,24 +5110,28 @@ internal Arm64() { } /// svint64_t svld1uw_gather_[s64]offset_s64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1uw_gather_[u64]offset_s64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uw_gather_[s64]offset_u64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uw_gather_[u64]offset_u64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LD1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtend(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4969,24 +5141,28 @@ internal Arm64() { } /// svint64_t svldff1uw_gather_[s64]offset_s64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uw_gather_[u64]offset_s64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uw_gather_[s64]offset_u64(svbool_t pg, const uint32_t *base, svint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uw_gather_[u64]offset_u64(svbool_t pg, const uint32_t *base, svuint64_t offsets) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32WithByteOffsetsZeroExtendFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -4996,6 +5172,7 @@ internal Arm64() { } /// svint64_t svld1uw_gather_[s64]index_s64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5008,12 +5185,14 @@ internal Arm64() { } /// svint64_t svld1uw_gather_[u64]index_s64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1uw_gather_[s64]index_u64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5026,6 +5205,7 @@ internal Arm64() { } /// svuint64_t svld1uw_gather_[u64]index_u64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LD1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtend(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -5035,6 +5215,7 @@ internal Arm64() { } /// svint64_t svldff1uw_gather_[s64]index_s64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5047,12 +5228,14 @@ internal Arm64() { } /// svint64_t svldff1uw_gather_[u64]index_s64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uw_gather_[s64]index_u64(svbool_t pg, const uint32_t *base, svint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } /// @@ -5065,6 +5248,7 @@ internal Arm64() { } /// svuint64_t svldff1uw_gather_[u64]index_u64(svbool_t pg, const uint32_t *base, svuint64_t indices) /// LDFF1W Zresult.D, Pg/Z, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address, Vector indices) { throw new PlatformNotSupportedException(); } @@ -5074,72 +5258,84 @@ internal Arm64() { } /// svfloat64_t svldff1_gather_[s64]offset[_f64](svbool_t pg, const float64_t *base, svint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, double* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svldff1_gather_[u64]offset[_f64](svbool_t pg, const float64_t *base, svuint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, double* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1_gather_[s32]offset[_s32](svbool_t pg, const int32_t *base, svint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1_gather_[u32]offset[_s32](svbool_t pg, const int32_t *base, svuint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1_gather_[s64]offset[_s64](svbool_t pg, const int64_t *base, svint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, long* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1_gather_[u64]offset[_s64](svbool_t pg, const int64_t *base, svuint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, long* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldff1_gather_[s32]offset[_f32](svbool_t pg, const float32_t *base, svint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, float* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldff1_gather_[u32]offset[_f32](svbool_t pg, const float32_t *base, svuint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, float* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1_gather_[s32]offset[_u32](svbool_t pg, const uint32_t *base, svint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1_gather_[u32]offset[_u32](svbool_t pg, const uint32_t *base, svuint32_t offsets) /// LDFF1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1_gather_[s64]offset[_u64](svbool_t pg, const uint64_t *base, svint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, ulong* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1_gather_[u64]offset[_u64](svbool_t pg, const uint64_t *base, svuint64_t offsets) /// LDFF1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsetFirstFaulting(Vector mask, ulong* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -5149,72 +5345,84 @@ internal Arm64() { } /// svfloat64_t svld1_gather_[s64]offset[_f64](svbool_t pg, const float64_t *base, svint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, double* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svld1_gather_[u64]offset[_f64](svbool_t pg, const float64_t *base, svuint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, double* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1_gather_[s32]offset[_s32](svbool_t pg, const int32_t *base, svint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1_gather_[u32]offset[_s32](svbool_t pg, const int32_t *base, svuint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, int* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1_gather_[s64]offset[_s64](svbool_t pg, const int64_t *base, svint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, long* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1_gather_[u64]offset[_s64](svbool_t pg, const int64_t *base, svuint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, long* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svld1_gather_[s32]offset[_f32](svbool_t pg, const float32_t *base, svint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, float* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svld1_gather_[u32]offset[_f32](svbool_t pg, const float32_t *base, svuint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, float* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1_gather_[s32]offset[_u32](svbool_t pg, const uint32_t *base, svint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1_gather_[u32]offset[_u32](svbool_t pg, const uint32_t *base, svuint32_t offsets) /// LD1W Zresult.S, Pg/Z, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, uint* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1_gather_[s64]offset[_u64](svbool_t pg, const uint64_t *base, svint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, ulong* address, Vector offsets) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1_gather_[u64]offset[_u64](svbool_t pg, const uint64_t *base, svuint64_t offsets) /// LD1D Zresult.D, Pg/Z, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe Vector GatherVectorWithByteOffsets(Vector mask, ulong* address, Vector offsets) { throw new PlatformNotSupportedException(); } @@ -5526,6 +5734,7 @@ internal Arm64() { } /// LD1B Zresult.B, Pg/Z, [Xarray, Xindex] /// LD1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// @@ -5533,6 +5742,7 @@ internal Arm64() { } /// LD1D Zresult.D, Pg/Z, [Xarray, Xindex, LSL #3] /// LD1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// @@ -5540,6 +5750,7 @@ internal Arm64() { } /// LD1H Zresult.H, Pg/Z, [Xarray, Xindex, LSL #1] /// LD1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// @@ -5547,6 +5758,7 @@ internal Arm64() { } /// LD1W Zresult.S, Pg/Z, [Xarray, Xindex, LSL #2] /// LD1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// @@ -5554,6 +5766,7 @@ internal Arm64() { } /// LD1D Zresult.D, Pg/Z, [Xarray, Xindex, LSL #3] /// LD1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// @@ -5561,6 +5774,7 @@ internal Arm64() { } /// LD1B Zresult.B, Pg/Z, [Xarray, Xindex] /// LD1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// @@ -5568,6 +5782,7 @@ internal Arm64() { } /// LD1W Zresult.S, Pg/Z, [Xarray, Xindex, LSL #2] /// LD1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// @@ -5575,6 +5790,7 @@ internal Arm64() { } /// LD1H Zresult.H, Pg/Z, [Xarray, Xindex, LSL #1] /// LD1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// @@ -5582,6 +5798,7 @@ internal Arm64() { } /// LD1W Zresult.S, Pg/Z, [Xarray, Xindex, LSL #2] /// LD1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// @@ -5589,6 +5806,7 @@ internal Arm64() { } /// LD1D Zresult.D, Pg/Z, [Xarray, Xindex, LSL #3] /// LD1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVector(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -5598,60 +5816,70 @@ internal Arm64() { } /// svuint8_t svld1rq[_u8](svbool_t pg, const uint8_t *base) /// LD1RQB Zresult.B, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svld1rq[_f64](svbool_t pg, const float64_t *base) /// LD1RQD Zresult.D, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16_t svld1rq[_s16](svbool_t pg, const int16_t *base) /// LD1RQH Zresult.H, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svld1rq[_s32](svbool_t pg, const int32_t *base) /// LD1RQW Zresult.S, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svld1rq[_s64](svbool_t pg, const int64_t *base) /// LD1RQD Zresult.D, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8_t svld1rq[_s8](svbool_t pg, const int8_t *base) /// LD1RQB Zresult.B, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svld1rq[_f32](svbool_t pg, const float32_t *base) /// LD1RQW Zresult.S, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svld1rq[_u16](svbool_t pg, const uint16_t *base) /// LD1RQH Zresult.H, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svld1rq[_u32](svbool_t pg, const uint32_t *base) /// LD1RQW Zresult.S, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svld1rq[_u64](svbool_t pg, const uint64_t *base) /// LD1RQD Zresult.D, Pg/Z, [Xbase, #0] /// + [RequiresUnsafe] public static unsafe Vector LoadVector128AndReplicateToVector(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -5661,6 +5889,7 @@ internal Arm64() { } /// svint16_t svldnf1ub_s16(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToInt16(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5670,6 +5899,7 @@ internal Arm64() { } /// svint32_t svldnf1ub_s32(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToInt32(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5679,6 +5909,7 @@ internal Arm64() { } /// svint64_t svldnf1ub_s64(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToInt64(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5688,6 +5919,7 @@ internal Arm64() { } /// svuint16_t svldnf1ub_u16(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToUInt16(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5697,6 +5929,7 @@ internal Arm64() { } /// svuint32_t svldnf1ub_u32(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToUInt32(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5706,6 +5939,7 @@ internal Arm64() { } /// svuint64_t svldnf1ub_u64(svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteNonFaultingZeroExtendToUInt64(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5713,36 +5947,42 @@ internal Arm64() { } /// svint16_t svldff1ub_s16(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.H, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1ub_s32(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.S, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1ub_s64(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.D, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldff1ub_u16(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.H, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1ub_u32(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.S, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1ub_u64(svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.D, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5752,6 +5992,7 @@ internal Arm64() { } /// svint16_t svld1ub_s16(svbool_t pg, const uint8_t *base) /// LD1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToInt16(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5761,6 +6002,7 @@ internal Arm64() { } /// svint32_t svld1ub_s32(svbool_t pg, const uint8_t *base) /// LD1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToInt32(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5770,6 +6012,7 @@ internal Arm64() { } /// svint64_t svld1ub_s64(svbool_t pg, const uint8_t *base) /// LD1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToInt64(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5779,6 +6022,7 @@ internal Arm64() { } /// svuint16_t svld1ub_u16(svbool_t pg, const uint8_t *base) /// LD1B Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToUInt16(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5788,6 +6032,7 @@ internal Arm64() { } /// svuint32_t svld1ub_u32(svbool_t pg, const uint8_t *base) /// LD1B Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToUInt32(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5797,6 +6042,7 @@ internal Arm64() { } /// svuint64_t svld1ub_u64(svbool_t pg, const uint8_t *base) /// LD1B Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorByteZeroExtendToUInt64(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } @@ -5806,60 +6052,70 @@ internal Arm64() { } /// svuint8_t svldff1[_u8](svbool_t pg, const uint8_t *base) /// LDFF1B Zresult.B, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svldff1[_f64](svbool_t pg, const float64_t *base) /// LDFF1D Zresult.D, Pg/Z, [Xbase, XZR, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16_t svldff1[_s16](svbool_t pg, const int16_t *base) /// LDFF1H Zresult.H, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1[_s32](svbool_t pg, const int32_t *base) /// LDFF1W Zresult.S, Pg/Z, [Xbase, XZR, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1[_s64](svbool_t pg, const int64_t *base) /// LDFF1D Zresult.D, Pg/Z, [Xbase, XZR, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8_t svldff1[_s8](svbool_t pg, const int8_t *base) /// LDFF1B Zresult.B, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldff1[_f32](svbool_t pg, const float32_t *base) /// LDFF1W Zresult.S, Pg/Z, [Xbase, XZR, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldff1[_u16](svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.H, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1[_u32](svbool_t pg, const uint32_t *base) /// LDFF1W Zresult.S, Pg/Z, [Xbase, XZR, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1[_u64](svbool_t pg, const uint64_t *base) /// LDFF1D Zresult.D, Pg/Z, [Xbase, XZR, LSL #3] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorFirstFaulting(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -5869,6 +6125,7 @@ internal Arm64() { } /// svint32_t svldnf1sh_s32(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToInt32(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -5878,6 +6135,7 @@ internal Arm64() { } /// svint64_t svldnf1sh_s64(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToInt64(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -5887,6 +6145,7 @@ internal Arm64() { } /// svuint32_t svldnf1sh_u32(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToUInt32(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -5896,6 +6155,7 @@ internal Arm64() { } /// svuint64_t svldnf1sh_u64(svbool_t pg, const int16_t *base) /// LDNF1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16NonFaultingSignExtendToUInt64(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -5905,24 +6165,28 @@ internal Arm64() { } /// svint32_t svldff1sh_s32(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sh_s64(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sh_u32(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sh_u64(svbool_t pg, const int16_t *base) /// LDFF1SH Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendFirstFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -5932,6 +6196,7 @@ internal Arm64() { } /// svint32_t svld1sh_s32(svbool_t pg, const int16_t *base) /// LD1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToInt32(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -5941,6 +6206,7 @@ internal Arm64() { } /// svint64_t svld1sh_s64(svbool_t pg, const int16_t *base) /// LD1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToInt64(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -5950,6 +6216,7 @@ internal Arm64() { } /// svuint32_t svld1sh_u32(svbool_t pg, const int16_t *base) /// LD1SH Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToUInt32(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -5959,6 +6226,7 @@ internal Arm64() { } /// svuint64_t svld1sh_u64(svbool_t pg, const int16_t *base) /// LD1SH Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt16SignExtendToUInt64(Vector mask, short* address) { throw new PlatformNotSupportedException(); } @@ -5968,6 +6236,7 @@ internal Arm64() { } /// svint64_t svldnf1sw_s64(svbool_t pg, const int32_t *base) /// LDNF1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt32NonFaultingSignExtendToInt64(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -5977,6 +6246,7 @@ internal Arm64() { } /// svuint64_t svldnf1sw_u64(svbool_t pg, const int32_t *base) /// LDNF1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt32NonFaultingSignExtendToUInt64(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -5986,12 +6256,14 @@ internal Arm64() { } /// svint64_t svldff1sw_s64(svbool_t pg, const int32_t *base) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendFirstFaulting(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sw_u64(svbool_t pg, const int32_t *base) /// LDFF1SW Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendFirstFaulting(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -6001,6 +6273,7 @@ internal Arm64() { } /// svint64_t svld1sw_s64(svbool_t pg, const int32_t *base) /// LD1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendToInt64(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -6010,6 +6283,7 @@ internal Arm64() { } /// svuint64_t svld1sw_u64(svbool_t pg, const int32_t *base) /// LD1SW Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorInt32SignExtendToUInt64(Vector mask, int* address) { throw new PlatformNotSupportedException(); } @@ -6019,60 +6293,70 @@ internal Arm64() { } /// svuint8_t svldnf1[_u8](svbool_t pg, const uint8_t *base) /// LDNF1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svldnf1[_f64](svbool_t pg, const float64_t *base) /// LDNF1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16_t svldnf1[_s16](svbool_t pg, const int16_t *base) /// LDNF1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldnf1[_s32](svbool_t pg, const int32_t *base) /// LDNF1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldnf1[_s64](svbool_t pg, const int64_t *base) /// LDNF1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8_t svldnf1[_s8](svbool_t pg, const int8_t *base) /// LDNF1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldnf1[_f32](svbool_t pg, const float32_t *base) /// LDNF1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldnf1[_u16](svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldnf1[_u32](svbool_t pg, const uint32_t *base) /// LDNF1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldnf1[_u64](svbool_t pg, const uint64_t *base) /// LDNF1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonFaulting(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -6082,60 +6366,70 @@ internal Arm64() { } /// svuint8_t svldnt1[_u8](svbool_t pg, const uint8_t *base) /// LDNT1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64_t svldnt1[_f64](svbool_t pg, const float64_t *base) /// LDNT1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16_t svldnt1[_s16](svbool_t pg, const int16_t *base) /// LDNT1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldnt1[_s32](svbool_t pg, const int32_t *base) /// LDNT1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldnt1[_s64](svbool_t pg, const int64_t *base) /// LDNT1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8_t svldnt1[_s8](svbool_t pg, const int8_t *base) /// LDNT1B Zresult.B, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32_t svldnt1[_f32](svbool_t pg, const float32_t *base) /// LDNT1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldnt1[_u16](svbool_t pg, const uint16_t *base) /// LDNT1H Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldnt1[_u32](svbool_t pg, const uint32_t *base) /// LDNT1W Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldnt1[_u64](svbool_t pg, const uint64_t *base) /// LDNT1D Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorNonTemporal(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -6145,6 +6439,7 @@ internal Arm64() { } /// svint16_t svldnf1sb_s16(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToInt16(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6154,6 +6449,7 @@ internal Arm64() { } /// svint32_t svldnf1sb_s32(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToInt32(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6163,6 +6459,7 @@ internal Arm64() { } /// svint64_t svldnf1sb_s64(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToInt64(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6172,6 +6469,7 @@ internal Arm64() { } /// svuint16_t svldnf1sb_u16(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToUInt16(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6181,6 +6479,7 @@ internal Arm64() { } /// svuint32_t svldnf1sb_u32(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToUInt32(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6190,6 +6489,7 @@ internal Arm64() { } /// svuint64_t svldnf1sb_u64(svbool_t pg, const int8_t *base) /// LDNF1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteNonFaultingSignExtendToUInt64(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6199,36 +6499,42 @@ internal Arm64() { } /// svint16_t svldff1sb_s16(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.H, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svint32_t svldff1sb_s32(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1sb_s64(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svuint16_t svldff1sb_u16(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.H, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1sb_u32(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.S, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1sb_u64(svbool_t pg, const int8_t *base) /// LDFF1SB Zresult.D, Pg/Z, [Xbase, XZR] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendFirstFaulting(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6238,6 +6544,7 @@ internal Arm64() { } /// svint16_t svld1sb_s16(svbool_t pg, const int8_t *base) /// LD1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToInt16(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6247,6 +6554,7 @@ internal Arm64() { } /// svint32_t svld1sb_s32(svbool_t pg, const int8_t *base) /// LD1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToInt32(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6256,6 +6564,7 @@ internal Arm64() { } /// svint64_t svld1sb_s64(svbool_t pg, const int8_t *base) /// LD1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToInt64(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6265,6 +6574,7 @@ internal Arm64() { } /// svuint16_t svld1sb_u16(svbool_t pg, const int8_t *base) /// LD1SB Zresult.H, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToUInt16(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6274,6 +6584,7 @@ internal Arm64() { } /// svuint32_t svld1sb_u32(svbool_t pg, const int8_t *base) /// LD1SB Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToUInt32(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6283,6 +6594,7 @@ internal Arm64() { } /// svuint64_t svld1sb_u64(svbool_t pg, const int8_t *base) /// LD1SB Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorSByteSignExtendToUInt64(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } @@ -6292,6 +6604,7 @@ internal Arm64() { } /// svint32_t svldnf1uh_s32(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToInt32(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6301,6 +6614,7 @@ internal Arm64() { } /// svint64_t svldnf1uh_s64(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToInt64(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6310,6 +6624,7 @@ internal Arm64() { } /// svuint32_t svldnf1uh_u32(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToUInt32(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6319,6 +6634,7 @@ internal Arm64() { } /// svuint64_t svldnf1uh_u64(svbool_t pg, const uint16_t *base) /// LDNF1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16NonFaultingZeroExtendToUInt64(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6328,24 +6644,28 @@ internal Arm64() { } /// svint32_t svldff1uh_s32(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svint64_t svldff1uh_s64(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32_t svldff1uh_u32(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.S, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uh_u64(svbool_t pg, const uint16_t *base) /// LDFF1H Zresult.D, Pg/Z, [Xbase, XZR, LSL #1] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendFirstFaulting(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6355,6 +6675,7 @@ internal Arm64() { } /// svint32_t svld1uh_s32(svbool_t pg, const uint16_t *base) /// LD1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToInt32(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6364,6 +6685,7 @@ internal Arm64() { } /// svint64_t svld1uh_s64(svbool_t pg, const uint16_t *base) /// LD1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToInt64(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6373,6 +6695,7 @@ internal Arm64() { } /// svuint32_t svld1uh_u32(svbool_t pg, const uint16_t *base) /// LD1H Zresult.S, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToUInt32(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6382,6 +6705,7 @@ internal Arm64() { } /// svuint64_t svld1uh_u64(svbool_t pg, const uint16_t *base) /// LD1H Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt16ZeroExtendToUInt64(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } @@ -6391,6 +6715,7 @@ internal Arm64() { } /// svint64_t svldnf1uw_s64(svbool_t pg, const uint32_t *base) /// LDNF1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32NonFaultingZeroExtendToInt64(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -6400,6 +6725,7 @@ internal Arm64() { } /// svuint64_t svldnf1uw_u64(svbool_t pg, const uint32_t *base) /// LDNF1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32NonFaultingZeroExtendToUInt64(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -6409,12 +6735,14 @@ internal Arm64() { } /// svint64_t svldff1uw_s64(svbool_t pg, const uint32_t *base) /// LDFF1W Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64_t svldff1uw_u64(svbool_t pg, const uint32_t *base) /// LDFF1W Zresult.D, Pg/Z, [Xbase, XZR, LSL #2] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendFirstFaulting(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -6424,6 +6752,7 @@ internal Arm64() { } /// svint64_t svld1uw_s64(svbool_t pg, const uint32_t *base) /// LD1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendToInt64(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -6433,6 +6762,7 @@ internal Arm64() { } /// svuint64_t svld1uw_u64(svbool_t pg, const uint32_t *base) /// LD1W Zresult.D, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe Vector LoadVectorUInt32ZeroExtendToUInt64(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } @@ -6442,60 +6772,70 @@ internal Arm64() { } /// svuint8x2_t svld2[_u8](svbool_t pg, const uint8_t *base) /// LD2B {Zresult0.B, Zresult1.B}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64x2_t svld2[_f64](svbool_t pg, const float64_t *base) /// LD2D {Zresult0.D, Zresult1.D}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16x2_t svld2[_s16](svbool_t pg, const int16_t *base) /// LD2H {Zresult0.H, Zresult1.H}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32x2_t svld2[_s32](svbool_t pg, const int32_t *base) /// LD2W {Zresult0.S, Zresult1.S}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64x2_t svld2[_s64](svbool_t pg, const int64_t *base) /// LD2D {Zresult0.D, Zresult1.D}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8x2_t svld2[_s8](svbool_t pg, const int8_t *base) /// LD2B {Zresult0.B, Zresult1.B}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32x2_t svld2[_f32](svbool_t pg, const float32_t *base) /// LD2W {Zresult0.S, Zresult1.S}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16x2_t svld2[_u16](svbool_t pg, const uint16_t *base) /// LD2H {Zresult0.H, Zresult1.H}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32x2_t svld2[_u32](svbool_t pg, const uint32_t *base) /// LD2W {Zresult0.S, Zresult1.S}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64x2_t svld2[_u64](svbool_t pg, const uint64_t *base) /// LD2D {Zresult0.D, Zresult1.D}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector) Load2xVectorAndUnzip(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -6505,60 +6845,70 @@ internal Arm64() { } /// svuint8x3_t svld3[_u8](svbool_t pg, const uint8_t *base) /// LD3B {Zresult0.B - Zresult2.B}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64x3_t svld3[_f64](svbool_t pg, const float64_t *base) /// LD3D {Zresult0.D - Zresult2.D}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16x3_t svld3[_s16](svbool_t pg, const int16_t *base) /// LD3H {Zresult0.H - Zresult2.H}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32x3_t svld3[_s32](svbool_t pg, const int32_t *base) /// LD3W {Zresult0.S - Zresult2.S}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64x3_t svld3[_s64](svbool_t pg, const int64_t *base) /// LD3D {Zresult0.D - Zresult2.D}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8x3_t svld3[_s8](svbool_t pg, const int8_t *base) /// LD3B {Zresult0.B - Zresult2.B}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32x3_t svld3[_f32](svbool_t pg, const float32_t *base) /// LD3W {Zresult0.S - Zresult2.S}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16x3_t svld3[_u16](svbool_t pg, const uint16_t *base) /// LD3H {Zresult0.H - Zresult2.H}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32x3_t svld3[_u32](svbool_t pg, const uint32_t *base) /// LD3W {Zresult0.S - Zresult2.S}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64x3_t svld3[_u64](svbool_t pg, const uint64_t *base) /// LD3D {Zresult0.D - Zresult2.D}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector) Load3xVectorAndUnzip(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -6568,60 +6918,70 @@ internal Arm64() { } /// svuint8x4_t svld4[_u8](svbool_t pg, const uint8_t *base) /// LD4B {Zresult0.B - Zresult3.B}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, byte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat64x4_t svld4[_f64](svbool_t pg, const float64_t *base) /// LD4D {Zresult0.D - Zresult3.D}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, double* address) { throw new PlatformNotSupportedException(); } /// /// svint16x4_t svld4[_s16](svbool_t pg, const int16_t *base) /// LD4H {Zresult0.H - Zresult3.H}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, short* address) { throw new PlatformNotSupportedException(); } /// /// svint32x4_t svld4[_s32](svbool_t pg, const int32_t *base) /// LD4W {Zresult0.S - Zresult3.S}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, int* address) { throw new PlatformNotSupportedException(); } /// /// svint64x4_t svld4[_s64](svbool_t pg, const int64_t *base) /// LD4D {Zresult0.D - Zresult3.D}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, long* address) { throw new PlatformNotSupportedException(); } /// /// svint8x4_t svld4[_s8](svbool_t pg, const int8_t *base) /// LD4B {Zresult0.B - Zresult3.B}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// svfloat32x4_t svld4[_f32](svbool_t pg, const float32_t *base) /// LD4W {Zresult0.S - Zresult3.S}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, float* address) { throw new PlatformNotSupportedException(); } /// /// svuint16x4_t svld4[_u16](svbool_t pg, const uint16_t *base) /// LD4H {Zresult0.H - Zresult3.H}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, ushort* address) { throw new PlatformNotSupportedException(); } /// /// svuint32x4_t svld4[_u32](svbool_t pg, const uint32_t *base) /// LD4W {Zresult0.S - Zresult3.S}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, uint* address) { throw new PlatformNotSupportedException(); } /// /// svuint64x4_t svld4[_u64](svbool_t pg, const uint64_t *base) /// LD4D {Zresult0.D - Zresult3.D}, Pg/Z, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe (Vector, Vector, Vector, Vector) Load4xVectorAndUnzip(Vector mask, ulong* address) { throw new PlatformNotSupportedException(); } @@ -7633,6 +7993,7 @@ internal Arm64() { } /// void svprfh(svbool_t pg, const void *base, enum svprfop op) /// PRFH op, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void Prefetch16Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -7642,6 +8003,7 @@ internal Arm64() { } /// void svprfw(svbool_t pg, const void *base, enum svprfop op) /// PRFW op, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void Prefetch32Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -7651,6 +8013,7 @@ internal Arm64() { } /// void svprfd(svbool_t pg, const void *base, enum svprfop op) /// PRFD op, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void Prefetch64Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -7660,6 +8023,7 @@ internal Arm64() { } /// void svprfb(svbool_t pg, const void *base, enum svprfop op) /// PRFB op, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void Prefetch8Bit(Vector mask, void* address, [ConstantExpected] SvePrefetchType prefetchType) { throw new PlatformNotSupportedException(); } @@ -8655,6 +9019,7 @@ internal Arm64() { } /// void svst1_scatter_[s64]offset[_f64](svbool_t pg, float64_t *base, svint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, double* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// @@ -8667,12 +9032,14 @@ internal Arm64() { } /// void svst1_scatter_[u64]offset[_f64](svbool_t pg, float64_t *base, svuint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, double* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_s32](svbool_t pg, int32_t *base, svint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, int* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } // @@ -8686,12 +9053,14 @@ internal Arm64() { } /// void svst1_scatter_[u32]offset[_s32](svbool_t pg, int32_t *base, svuint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, int* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s64]offset[_s64](svbool_t pg, int64_t *base, svint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, long* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// @@ -8704,12 +9073,14 @@ internal Arm64() { } /// void svst1_scatter_[u64]offset[_s64](svbool_t pg, int64_t *base, svuint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, long* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_f32](svbool_t pg, float32_t *base, svint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, float* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } // @@ -8723,12 +9094,14 @@ internal Arm64() { } /// void svst1_scatter_[u32]offset[_f32](svbool_t pg, float32_t *base, svuint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, float* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_u32](svbool_t pg, uint32_t *base, svint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, uint* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } // @@ -8742,12 +9115,14 @@ internal Arm64() { } /// void svst1_scatter_[u32]offset[_u32](svbool_t pg, uint32_t *base, svuint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, uint* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s64]offset[_u64](svbool_t pg, uint64_t *base, svint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, ulong* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } /// @@ -8760,6 +9135,7 @@ internal Arm64() { } /// void svst1_scatter_[u64]offset[_u64](svbool_t pg, uint64_t *base, svuint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter(Vector mask, ulong* address, Vector indicies, Vector data) { throw new PlatformNotSupportedException(); } @@ -8795,48 +9171,56 @@ internal Arm64() { } /// void svst1h_scatter_[s32]index[_s32](svbool_t pg, int16_t *base, svint32_t indices, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u32]index[_s32](svbool_t pg, int16_t *base, svuint32_t indices, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s64]index[_s64](svbool_t pg, int16_t *base, svint64_t indices, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u64]index[_s64](svbool_t pg, int16_t *base, svuint64_t indices, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s32]index[_u32](svbool_t pg, uint16_t *base, svint32_t indices, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, SXTW #1] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u32]index[_u32](svbool_t pg, uint16_t *base, svuint32_t indices, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zindices.S, UXTW #1] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s64]index[_u64](svbool_t pg, uint16_t *base, svint64_t indices, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u64]index[_u64](svbool_t pg, uint16_t *base, svuint64_t indices, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zindices.D, LSL #1] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowing(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -8846,48 +9230,56 @@ internal Arm64() { } /// void svst1h_scatter_[s32]offset[_s32](svbool_t pg, int16_t *base, svint32_t offsets, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u32]offset[_s32](svbool_t pg, int16_t *base, svuint32_t offsets, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s64]offset[_s64](svbool_t pg, int16_t *base, svint64_t offsets, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u64]offset[_s64](svbool_t pg, int16_t *base, svuint64_t offsets, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s32]offset[_u32](svbool_t pg, uint16_t *base, svint32_t offsets, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u32]offset[_u32](svbool_t pg, uint16_t *base, svuint32_t offsets, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[s64]offset[_u64](svbool_t pg, uint16_t *base, svint64_t offsets, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h_scatter_[u64]offset[_u64](svbool_t pg, uint16_t *base, svuint64_t offsets, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowing(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -8909,24 +9301,28 @@ internal Arm64() { } /// void svst1w_scatter_[s64]index[_s64](svbool_t pg, int32_t *base, svint64_t indices, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, int* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[u64]index[_s64](svbool_t pg, int32_t *base, svuint64_t indices, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, int* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[s64]index[_u64](svbool_t pg, uint32_t *base, svint64_t indices, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, uint* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[u64]index[_u64](svbool_t pg, uint32_t *base, svuint64_t indices, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zindices.D, LSL #2] /// + [RequiresUnsafe] public static unsafe void Scatter32BitNarrowing(Vector mask, uint* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -8936,24 +9332,28 @@ internal Arm64() { } /// void svst1w_scatter_[s64]offset[_s64](svbool_t pg, int32_t *base, svint64_t offsets, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[u64]offset[_s64](svbool_t pg, int32_t *base, svuint64_t offsets, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[s64]offset[_u64](svbool_t pg, uint32_t *base, svint64_t offsets, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w_scatter_[u64]offset[_u64](svbool_t pg, uint32_t *base, svuint64_t offsets, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowing(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -8992,48 +9392,56 @@ internal Arm64() { } /// void svst1b_scatter_[s32]offset[_s32](svbool_t pg, int8_t *base, svint32_t offsets, svint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[u32]offset[_s32](svbool_t pg, int8_t *base, svuint32_t offsets, svint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[s64]offset[_s64](svbool_t pg, int8_t *base, svint64_t offsets, svint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[u64]offset[_s64](svbool_t pg, int8_t *base, svuint64_t offsets, svint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[s32]offset[_u32](svbool_t pg, uint8_t *base, svint32_t offsets, svuint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[u32]offset[_u32](svbool_t pg, uint8_t *base, svuint32_t offsets, svuint32_t data) /// ST1B Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[s64]offset[_u64](svbool_t pg, uint8_t *base, svint64_t offsets, svuint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b_scatter_[u64]offset[_u64](svbool_t pg, uint8_t *base, svuint64_t offsets, svuint64_t data) /// ST1B Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowing(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -9043,72 +9451,84 @@ internal Arm64() { } /// void svst1_scatter_[s64]offset[_f64](svbool_t pg, float64_t *base, svint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, double* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u64]offset[_f64](svbool_t pg, float64_t *base, svuint64_t offsets, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, double* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_s32](svbool_t pg, int32_t *base, svint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u32]offset[_s32](svbool_t pg, int32_t *base, svuint32_t offsets, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s64]offset[_s64](svbool_t pg, int64_t *base, svint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, long* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u64]offset[_s64](svbool_t pg, int64_t *base, svuint64_t offsets, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, long* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_f32](svbool_t pg, float32_t *base, svint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, float* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u32]offset[_f32](svbool_t pg, float32_t *base, svuint32_t offsets, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, float* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s32]offset[_u32](svbool_t pg, uint32_t *base, svint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, SXTW] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u32]offset[_u32](svbool_t pg, uint32_t *base, svuint32_t offsets, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, Zoffsets.S, UXTW] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[s64]offset[_u64](svbool_t pg, uint64_t *base, svint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, ulong* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1_scatter_[u64]offset[_u64](svbool_t pg, uint64_t *base, svuint64_t offsets, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, Zoffsets.D] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsets(Vector mask, ulong* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -9630,240 +10050,280 @@ internal Arm64() { } /// void svst1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u8](svbool_t pg, uint8_t *base, svuint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u8](svbool_t pg, uint8_t *base, svuint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u8](svbool_t pg, uint8_t *base, svuint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, byte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_f64](svbool_t pg, float64_t *base, svfloat64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_f64](svbool_t pg, float64_t *base, svfloat64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_f64](svbool_t pg, float64_t *base, svfloat64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, double* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s16](svbool_t pg, int16_t *base, svint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s16](svbool_t pg, int16_t *base, svint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s16](svbool_t pg, int16_t *base, svint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s16](svbool_t pg, int16_t *base, svint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, short* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s32](svbool_t pg, int32_t *base, svint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s32](svbool_t pg, int32_t *base, svint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s32](svbool_t pg, int32_t *base, svint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s32](svbool_t pg, int32_t *base, svint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, int* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s64](svbool_t pg, int64_t *base, svint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s64](svbool_t pg, int64_t *base, svint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s64](svbool_t pg, int64_t *base, svint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s64](svbool_t pg, int64_t *base, svint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, long* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_s8](svbool_t pg, int8_t *base, svint8_t data) /// ST1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_s8](svbool_t pg, int8_t *base, svint8x2_t data) /// ST2B {Zdata0.B, Zdata1.B}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_s8](svbool_t pg, int8_t *base, svint8x3_t data) /// ST3B {Zdata0.B - Zdata2.B}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_s8](svbool_t pg, int8_t *base, svint8x4_t data) /// ST4B {Zdata0.B - Zdata3.B}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, sbyte* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_f32](svbool_t pg, float32_t *base, svfloat32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_f32](svbool_t pg, float32_t *base, svfloat32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_f32](svbool_t pg, float32_t *base, svfloat32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, float* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) /// ST1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u16](svbool_t pg, uint16_t *base, svuint16x2_t data) /// ST2H {Zdata0.H, Zdata1.H}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u16](svbool_t pg, uint16_t *base, svuint16x3_t data) /// ST3H {Zdata0.H - Zdata2.H}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u16](svbool_t pg, uint16_t *base, svuint16x4_t data) /// ST4H {Zdata0.H - Zdata3.H}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ushort* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) /// ST1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u32](svbool_t pg, uint32_t *base, svuint32x2_t data) /// ST2W {Zdata0.S, Zdata1.S}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u32](svbool_t pg, uint32_t *base, svuint32x3_t data) /// ST3W {Zdata0.S - Zdata2.S}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u32](svbool_t pg, uint32_t *base, svuint32x4_t data) /// ST4W {Zdata0.S - Zdata3.S}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, uint* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } /// /// void svst1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) /// ST1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst2[_u64](svbool_t pg, uint64_t *base, svuint64x2_t data) /// ST2D {Zdata0.D, Zdata1.D}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2) data) { throw new PlatformNotSupportedException(); } /// /// void svst3[_u64](svbool_t pg, uint64_t *base, svuint64x3_t data) /// ST3D {Zdata0.D - Zdata2.D}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3) data) { throw new PlatformNotSupportedException(); } /// /// void svst4[_u64](svbool_t pg, uint64_t *base, svuint64x4_t data) /// ST4D {Zdata0.D - Zdata3.D}, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreAndZip(Vector mask, ulong* address, (Vector Value1, Vector Value2, Vector Value3, Vector Value4) data) { throw new PlatformNotSupportedException(); } @@ -9873,72 +10333,84 @@ internal Arm64() { } /// void svst1b[_s16](svbool_t pg, int8_t *base, svint16_t data) /// ST1B Zdata.H, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_s32](svbool_t pg, int8_t *base, svint32_t data) /// ST1B Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h[_s32](svbool_t pg, int16_t *base, svint32_t data) /// ST1H Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_s64](svbool_t pg, int8_t *base, svint64_t data) /// ST1B Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h[_s64](svbool_t pg, int16_t *base, svint64_t data) /// ST1H Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w[_s64](svbool_t pg, int32_t *base, svint64_t data) /// ST1W Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_u16](svbool_t pg, uint8_t *base, svuint16_t data) /// ST1B Zdata.H, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_u32](svbool_t pg, uint8_t *base, svuint32_t data) /// ST1B Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h[_u32](svbool_t pg, uint16_t *base, svuint32_t data) /// ST1H Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1b[_u64](svbool_t pg, uint8_t *base, svuint64_t data) /// ST1B Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1h[_u64](svbool_t pg, uint16_t *base, svuint64_t data) /// ST1H Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svst1w[_u64](svbool_t pg, uint32_t *base, svuint64_t data) /// ST1W Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNarrowing(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } @@ -9948,60 +10420,70 @@ internal Arm64() { } /// void svstnt1[_u8](svbool_t pg, uint8_t *base, svuint8_t data) /// STNT1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, byte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_f64](svbool_t pg, float64_t *base, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, double* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_s16](svbool_t pg, int16_t *base, svint16_t data) /// STNT1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, short* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_s32](svbool_t pg, int32_t *base, svint32_t data) /// STNT1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, int* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_s64](svbool_t pg, int64_t *base, svint64_t data) /// STNT1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, long* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_s8](svbool_t pg, int8_t *base, svint8_t data) /// STNT1B Zdata.B, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, sbyte* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_f32](svbool_t pg, float32_t *base, svfloat32_t data) /// STNT1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, float* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_u16](svbool_t pg, uint16_t *base, svuint16_t data) /// STNT1H Zdata.H, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, ushort* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_u32](svbool_t pg, uint32_t *base, svuint32_t data) /// STNT1W Zdata.S, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, uint* address, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1[_u64](svbool_t pg, uint64_t *base, svuint64_t data) /// STNT1D Zdata.D, Pg, [Xbase, #0, MUL VL] /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(Vector mask, ulong* address, Vector data) { throw new PlatformNotSupportedException(); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs index 1eb32eba2be1ca..1c127f42f7597a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve2.PlatformNotSupported.cs @@ -3601,24 +3601,28 @@ internal Arm64() { } /// void svstnt1h_scatter_[s64]index[_s64](svbool_t pg, int16_t *base, svint64_t indices, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u64]index[_s64](svbool_t pg, int16_t *base, svuint64_t indices, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, short* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[s64]index[_u64](svbool_t pg, uint16_t *base, svint64_t indices, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u64]index[_u64](svbool_t pg, uint16_t *base, svuint64_t indices, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitNarrowingNonTemporal(Vector mask, ushort* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -3628,36 +3632,42 @@ internal Arm64() { } /// void svstnt1h_scatter_[u32]offset[_s32](svbool_t pg, int16_t *base, svuint32_t offsets, svint32_t data) /// STNT1H Zdata.S, Pg, [Zoffsets.S, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[s64]offset[_s64](svbool_t pg, int16_t *base, svint64_t offsets, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u64]offset[_s64](svbool_t pg, int16_t *base, svuint64_t offsets, svint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, short* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u32]offset[_u32](svbool_t pg, uint16_t *base, svuint32_t offsets, svuint32_t data) /// STNT1H Zdata.S, Pg, [Zoffsets.S, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[s64]offset[_u64](svbool_t pg, uint16_t *base, svint64_t offsets, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1h_scatter_[u64]offset[_u64](svbool_t pg, uint16_t *base, svuint64_t offsets, svuint64_t data) /// STNT1H Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter16BitWithByteOffsetsNarrowingNonTemporal(Vector mask, ushort* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -3679,24 +3689,28 @@ internal Arm64() { } /// void svstnt1w_scatter_[s64]index[_s64](svbool_t pg, int32_t *base, svint64_t indices, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, int* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[u64]index[_s64](svbool_t pg, int32_t *base, svuint64_t indices, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, int* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[s64]index[_u64](svbool_t pg, uint32_t *base, svint64_t indices, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, uint* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[u64]index[_u64](svbool_t pg, uint32_t *base, svuint64_t indices, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter32BitNarrowingNonTemporal(Vector mask, uint* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -3706,24 +3720,28 @@ internal Arm64() { } /// void svstnt1w_scatter_[s64]offset[_s64](svbool_t pg, int32_t *base, svint64_t offsets, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[u64]offset[_s64](svbool_t pg, int32_t *base, svuint64_t offsets, svint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[s64]offset[_u64](svbool_t pg, uint32_t *base, svint64_t offsets, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1w_scatter_[u64]offset[_u64](svbool_t pg, uint32_t *base, svuint64_t offsets, svuint64_t data) /// STNT1W Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter32BitWithByteOffsetsNarrowingNonTemporal(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -3762,36 +3780,42 @@ internal Arm64() { } /// void svstnt1b_scatter_[u32]offset[_s32](svbool_t pg, int8_t *base, svuint32_t offsets, svint32_t data) /// STNT1B Zdata.S, Pg, [Zoffsets.S, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[s64]offset[_s64](svbool_t pg, int8_t *base, svint64_t offsets, svint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[u64]offset[_s64](svbool_t pg, int8_t *base, svuint64_t offsets, svint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, sbyte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[u32]offset[_u32](svbool_t pg, uint8_t *base, svuint32_t offsets, svuint32_t data) /// STNT1B Zdata.S, Pg, [Zoffsets.S, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[s64]offset[_u64](svbool_t pg, uint8_t *base, svint64_t offsets, svuint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1b_scatter_[u64]offset[_u64](svbool_t pg, uint8_t *base, svuint64_t offsets, svuint64_t data) /// STNT1B Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void Scatter8BitWithByteOffsetsNarrowingNonTemporal(Vector mask, byte* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } @@ -3840,36 +3864,42 @@ internal Arm64() { } /// void svstnt1_scatter_[s64]index[_f64](svbool_t pg, float64_t *base, svint64_t indices, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, double* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]index[_f64](svbool_t pg, float64_t *base, svuint64_t indices, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, double* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[s64]index[_s64](svbool_t pg, int64_t *base, svint64_t indices, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, long* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]index[_s64](svbool_t pg, int64_t *base, svuint64_t indices, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, long* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[s64]index[_u64](svbool_t pg, uint64_t *base, svint64_t indices, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, ulong* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]index[_u64](svbool_t pg, uint64_t *base, svuint64_t indices, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterNonTemporal(Vector mask, ulong* address, Vector indices, Vector data) { throw new PlatformNotSupportedException(); } @@ -3879,54 +3909,63 @@ internal Arm64() { } /// void svstnt1_scatter_[s64]offset[_f64](svbool_t pg, float64_t *base, svint64_t offsets, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, double* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]offset[_f64](svbool_t pg, float64_t *base, svuint64_t offsets, svfloat64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, double* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u32]offset[_s32](svbool_t pg, int32_t *base, svuint32_t offsets, svint32_t data) /// STNT1W Zdata.S, Pg, [Zoffsets.S, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, int* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[s64]offset[_s64](svbool_t pg, int64_t *base, svint64_t offsets, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, long* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]offset[_s64](svbool_t pg, int64_t *base, svuint64_t offsets, svint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, long* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u32]offset[_f32](svbool_t pg, float32_t *base, svuint32_t offsets, svfloat32_t data) /// STNT1W Zdata.S, Pg, [Zoffsets.S, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, float* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u32]offset[_u32](svbool_t pg, uint32_t *base, svuint32_t offsets, svuint32_t data) /// STNT1W Zdata.S, Pg, [Zoffsets.S, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, uint* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[s64]offset[_u64](svbool_t pg, uint64_t *base, svint64_t offsets, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, ulong* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } /// /// void svstnt1_scatter_[u64]offset[_u64](svbool_t pg, uint64_t *base, svuint64_t offsets, svuint64_t data) /// STNT1D Zdata.D, Pg, [Zoffsets.D, Xbase] /// + [RequiresUnsafe] public static unsafe void ScatterWithByteOffsetsNonTemporal(Vector mask, ulong* address, Vector offsets, Vector data) { throw new PlatformNotSupportedException(); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs index a43a6ab74fcf57..10e1bf0bd2b1d4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -522,12 +523,14 @@ static virtual TSelf CreateScalarUnsafe(T value) /// The source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. + [RequiresUnsafe] static virtual TSelf Load(T* source) => TSelf.LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. /// The aligned source from which the vector will be loaded. /// The vector loaded from . /// The type of () is not supported. + [RequiresUnsafe] static virtual TSelf LoadAligned(T* source) { if (((nuint)(source) % (uint)(TSelf.Alignment)) != 0) @@ -542,6 +545,7 @@ static virtual TSelf LoadAligned(T* source) /// The vector loaded from . /// This method may bypass the cache on certain platforms. /// The type of () is not supported. + [RequiresUnsafe] static virtual TSelf LoadAlignedNonTemporal(T* source) => TSelf.LoadAligned(source); /// Loads a vector from the given source. @@ -718,12 +722,14 @@ static virtual TSelf LoadAligned(T* source) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. + [RequiresUnsafe] static virtual void Store(TSelf source, T* destination) => TSelf.StoreUnsafe(source, ref *destination); /// Stores a vector at the given aligned destination. /// The vector that will be stored. /// The aligned destination at which will be stored. /// The type of () is not supported. + [RequiresUnsafe] static virtual void StoreAligned(TSelf source, T* destination) { if (((nuint)(destination) % (uint)(TSelf.Alignment)) != 0) @@ -738,6 +744,7 @@ static virtual void StoreAligned(TSelf source, T* destination) /// The aligned destination at which will be stored. /// This method may bypass the cache on certain platforms. /// The type of () is not supported. + [RequiresUnsafe] static virtual void StoreAlignedNonTemporal(TSelf source, T* destination) => TSelf.StoreAligned(source, destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/SimdVectorExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/SimdVectorExtensions.cs index 666497b294eaa2..1b74541a0df34a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/SimdVectorExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/SimdVectorExtensions.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Numerics; namespace System.Runtime.Intrinsics @@ -72,6 +73,7 @@ public static T GetElement(this TVector vector, int index) /// The vector that will be stored. /// The destination at which will be stored. /// The type of () is not supported. + [RequiresUnsafe] public static void Store(this TVector source, T* destination) where TVector : ISimdVector { @@ -84,6 +86,7 @@ public static void Store(this TVector source, T* destination) /// The vector that will be stored. /// The aligned destination at which will be stored. /// The type of () is not supported. + [RequiresUnsafe] public static void StoreAligned(this TVector source, T* destination) where TVector : ISimdVector { @@ -97,6 +100,7 @@ public static void StoreAligned(this TVector source, T* destination) /// The aligned destination at which will be stored. /// This method may bypass the cache on certain platforms. /// The type of () is not supported. + [RequiresUnsafe] public static void StoreAlignedNonTemporal(this TVector source, T* destination) where TVector : ISimdVector { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index 93e5a25c477fbe..4e6931beb81ba6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -2317,6 +2318,7 @@ public static bool LessThanOrEqualAny(Vector128 left, Vector128 right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector128 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -2327,6 +2329,7 @@ public static bool LessThanOrEqualAny(Vector128 left, Vector128 right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector128 LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -2347,6 +2350,7 @@ public static unsafe Vector128 LoadAligned(T* source) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -3894,6 +3898,7 @@ public static Vector128 Sqrt(Vector128 vector) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void Store(this Vector128 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -3904,6 +3909,7 @@ public static Vector128 Sqrt(Vector128 vector) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe void StoreAligned(this Vector128 source, T* destination) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector128BaseType(); @@ -3924,6 +3930,7 @@ public static unsafe void StoreAligned(this Vector128 source, T* destinati /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector128 source, T* destination) => source.StoreAligned(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs index 7c8e8a8a75073d..e00dbbe7258076 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs @@ -725,14 +725,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static Vector128 ISimdVector, T>.Load(T* source) => Vector128.Load(source); /// [Intrinsic] + [RequiresUnsafe] static Vector128 ISimdVector, T>.LoadAligned(T* source) => Vector128.LoadAligned(source); /// [Intrinsic] + [RequiresUnsafe] static Vector128 ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector128.LoadAlignedNonTemporal(source); /// @@ -833,14 +836,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.Store(Vector128 source, T* destination) => source.Store(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector128 source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector128 source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs index 38d7eb0e1c2f59..e7a4b2a23fe018 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -2401,6 +2402,7 @@ public static bool LessThanOrEqualAny(Vector256 left, Vector256 right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector256 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -2411,6 +2413,7 @@ public static bool LessThanOrEqualAny(Vector256 left, Vector256 right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector256 LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -2431,6 +2434,7 @@ public static unsafe Vector256 LoadAligned(T* source) /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -3878,6 +3882,7 @@ public static Vector256 Sqrt(Vector256 vector) /// The type of and () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void Store(this Vector256 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -3888,6 +3893,7 @@ public static Vector256 Sqrt(Vector256 vector) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe void StoreAligned(this Vector256 source, T* destination) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector256BaseType(); @@ -3908,6 +3914,7 @@ public static unsafe void StoreAligned(this Vector256 source, T* destinati /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector256 source, T* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs index 1e1e4e713a59d0..0418b0d01a79bc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs @@ -713,14 +713,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static Vector256 ISimdVector, T>.Load(T* source) => Vector256.Load(source); /// [Intrinsic] + [RequiresUnsafe] static Vector256 ISimdVector, T>.LoadAligned(T* source) => Vector256.LoadAligned(source); /// [Intrinsic] + [RequiresUnsafe] static Vector256 ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector256.LoadAlignedNonTemporal(source); /// @@ -821,14 +824,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.Store(Vector256 source, T* destination) => source.Store(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector256 source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector256 source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs index 944397b1eb3143..eefda30c768b4d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -2427,6 +2428,7 @@ public static bool LessThanOrEqualAny(Vector512 left, Vector512 right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector512 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -2437,6 +2439,7 @@ public static bool LessThanOrEqualAny(Vector512 left, Vector512 right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector512 LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -2457,6 +2460,7 @@ public static unsafe Vector512 LoadAligned(T* source) /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -3889,6 +3893,7 @@ public static Vector512 Sqrt(Vector512 vector) /// The type of and () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void Store(this Vector512 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -3899,6 +3904,7 @@ public static Vector512 Sqrt(Vector512 vector) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe void StoreAligned(this Vector512 source, T* destination) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector512BaseType(); @@ -3919,6 +3925,7 @@ public static unsafe void StoreAligned(this Vector512 source, T* destinati /// This method may bypass the cache on certain platforms. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector512 source, T* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs index eec2be8a3f79fb..3841113a21ec11 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512_1.cs @@ -713,14 +713,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static Vector512 ISimdVector, T>.Load(T* source) => Vector512.Load(source); /// [Intrinsic] + [RequiresUnsafe] static Vector512 ISimdVector, T>.LoadAligned(T* source) => Vector512.LoadAligned(source); /// [Intrinsic] + [RequiresUnsafe] static Vector512 ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector512.LoadAlignedNonTemporal(source); /// @@ -821,14 +824,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.Store(Vector512 source, T* destination) => source.Store(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector512 source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector512 source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs index 3c80c23498ac92..a53597b44d6e52 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -2300,6 +2301,7 @@ public static bool LessThanOrEqualAny(Vector64 left, Vector64 right) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector64 Load(T* source) => LoadUnsafe(ref *source); /// Loads a vector from the given aligned source. @@ -2310,6 +2312,7 @@ public static bool LessThanOrEqualAny(Vector64 left, Vector64 right) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe Vector64 LoadAligned(T* source) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); @@ -2330,6 +2333,7 @@ public static unsafe Vector64 LoadAligned(T* source) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe Vector64 LoadAlignedNonTemporal(T* source) => LoadAligned(source); /// Loads a vector from the given source. @@ -3789,6 +3793,7 @@ public static Vector64 Sqrt(Vector64 vector) /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void Store(this Vector64 source, T* destination) => source.StoreUnsafe(ref *destination); /// Stores a vector at the given aligned destination. @@ -3799,6 +3804,7 @@ public static Vector64 Sqrt(Vector64 vector) [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe void StoreAligned(this Vector64 source, T* destination) { ThrowHelper.ThrowForUnsupportedIntrinsicsVector64BaseType(); @@ -3819,6 +3825,7 @@ public static unsafe void StoreAligned(this Vector64 source, T* destinatio /// The type of () is not supported. [Intrinsic] [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(this Vector64 source, T* destination) => source.StoreAligned(destination); /// Stores a vector at the given destination. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs index e06b50891fba28..df7a7dafddd0f2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs @@ -782,14 +782,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static Vector64 ISimdVector, T>.Load(T* source) => Vector64.Load(source); /// [Intrinsic] + [RequiresUnsafe] static Vector64 ISimdVector, T>.LoadAligned(T* source) => Vector64.LoadAligned(source); /// [Intrinsic] + [RequiresUnsafe] static Vector64 ISimdVector, T>.LoadAlignedNonTemporal(T* source) => Vector64.LoadAlignedNonTemporal(source); /// @@ -890,14 +893,17 @@ static bool ISimdVector, T>.IsHardwareAccelerated /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.Store(Vector64 source, T* destination) => source.Store(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAligned(Vector64 source, T* destination) => source.StoreAligned(destination); /// [Intrinsic] + [RequiresUnsafe] static void ISimdVector, T>.StoreAlignedNonTemporal(Vector64 source, T* destination) => source.StoreAlignedNonTemporal(destination); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs index ba0d08193e1347..8157d1bc2c619e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.PlatformNotSupported.cs @@ -395,87 +395,228 @@ public abstract class PackedSimd // Load + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(sbyte* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(byte* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(short* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ushort* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(int* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(uint* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(long* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ulong* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(float* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(double* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(nint* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(nuint* address) { throw new PlatformNotSupportedException(); } + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(int* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(uint* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(long* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(ulong* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(float* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(double* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(nint* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(nuint* address) { throw new PlatformNotSupportedException(); } + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(sbyte* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(byte* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(short* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(ushort* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(int* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(uint* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(long* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(ulong* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(float* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(double* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(nint* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndSplatVector128(nuint* address) { throw new PlatformNotSupportedException(); } + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(sbyte* address, Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(byte* address, Vector128 vector, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(short* address, Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(ushort* address, Vector128 vector, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(int* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(uint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(long* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(ulong* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(float* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(double* address, Vector128 vector, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(nint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadScalarAndInsert(nuint* address, Vector128 vector, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } + [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(sbyte* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(byte* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(short* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(ushort* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(int* address) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe Vector128 LoadWideningVector128(uint* address) { throw new PlatformNotSupportedException(); } // Store + [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(byte* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(short* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(int* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(uint* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(long* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(float* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(double* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(nint* address, Vector128 source) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void Store(nuint* address, Vector128 source) { throw new PlatformNotSupportedException(); } + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(sbyte* address, Vector128 source, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx16 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(byte* address, Vector128 source, [ConstantExpected(Max = (byte)(15))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx16 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(short* address, Vector128 source, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx8 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ushort* address, Vector128 source, [ConstantExpected(Max = (byte)(7))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx8 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(int* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx4 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(uint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx4 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(long* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx2 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(ulong* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx2 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(float* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx4 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(double* address, Vector128 source, [ConstantExpected(Max = (byte)(1))] byte index) { throw new PlatformNotSupportedException(); } // takes ImmLaneIdx2 + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(nint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } + + [RequiresUnsafe] public static unsafe void StoreSelectedScalar(nuint* address, Vector128 source, [ConstantExpected(Max = (byte)(3))] byte index) { throw new PlatformNotSupportedException(); } // Floating-point sign bit operations diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.cs index c0212c3f8da48d..fd89d3dfd859a2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx.cs @@ -108,6 +108,7 @@ internal X64() { } /// VBROADCASTSS xmm1, m32 /// VBROADCASTSS xmm1 {k1}{z}, m32 /// + [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(float* source) => BroadcastScalarToVector128(source); /// @@ -115,12 +116,15 @@ internal X64() { } /// VBROADCASTSS ymm1, m32 /// VBROADCASTSS ymm1 {k1}{z}, m32 /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(float* source) => BroadcastScalarToVector256(source); + /// /// __m256d _mm256_broadcast_sd (double const * mem_addr) /// VBROADCASTSD ymm1, m64 /// VBROADCASTSD ymm1 {k1}{z}, m64 /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(double* source) => BroadcastScalarToVector256(source); /// @@ -128,12 +132,15 @@ internal X64() { } /// VBROADCASTF128 ymm1, m128 /// VBROADCASTF32x4 ymm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(float* address) => BroadcastVector128ToVector256(address); + /// /// __m256d _mm256_broadcast_pd (__m128d const * mem_addr) /// VBROADCASTF128 ymm1, m128 /// VBROADCASTF64x2 ymm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(double* address) => BroadcastVector128ToVector256(address); /// @@ -574,101 +581,135 @@ internal X64() { } /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(sbyte* address) => LoadAlignedVector256(address); + /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(byte* address) => LoadAlignedVector256(address); + /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(short* address) => LoadAlignedVector256(address); + /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(ushort* address) => LoadAlignedVector256(address); + /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(int* address) => LoadAlignedVector256(address); + /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(uint* address) => LoadAlignedVector256(address); + /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA64 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(long* address) => LoadAlignedVector256(address); + /// /// __m256i _mm256_load_si256 (__m256i const * mem_addr) /// VMOVDQA ymm1, m256 /// VMOVDQA64 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(ulong* address) => LoadAlignedVector256(address); + /// /// __m256 _mm256_load_ps (float const * mem_addr) /// VMOVAPS ymm1, m256 /// VMOVAPS ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(float* address) => LoadAlignedVector256(address); + /// /// __m256d _mm256_load_pd (double const * mem_addr) /// VMOVAPD ymm1, m256 /// VMOVAPD ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256(double* address) => LoadAlignedVector256(address); /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(sbyte* address) => LoadDquVector256(address); + /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(byte* address) => LoadDquVector256(address); + /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(short* address) => LoadDquVector256(address); + /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(ushort* address) => LoadDquVector256(address); + /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(int* address) => LoadDquVector256(address); + /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(uint* address) => LoadDquVector256(address); + /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(long* address) => LoadDquVector256(address); + /// /// __m256i _mm256_lddqu_si256 (__m256i const * mem_addr) /// VLDDQU ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadDquVector256(ulong* address) => LoadDquVector256(address); /// @@ -676,102 +717,135 @@ internal X64() { } /// VMOVDQU ymm1, m256 /// VMOVDQU8 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(sbyte* address) => LoadVector256(address); + /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU8 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(byte* address) => LoadVector256(address); + /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU16 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(short* address) => LoadVector256(address); + /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU16 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(ushort* address) => LoadVector256(address); + /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(int* address) => LoadVector256(address); + /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(uint* address) => LoadVector256(address); + /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU64 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(long* address) => LoadVector256(address); + /// /// __m256i _mm256_loadu_si256 (__m256i const * mem_addr) /// VMOVDQU ymm1, m256 /// VMOVDQU64 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(ulong* address) => LoadVector256(address); + /// /// __m256 _mm256_loadu_ps (float const * mem_addr) /// VMOVUPS ymm1, m256 /// VMOVUPS ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(float* address) => LoadVector256(address); + /// /// __m256d _mm256_loadu_pd (double const * mem_addr) /// VMOVUPD ymm1, m256 /// VMOVUPD ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadVector256(double* address) => LoadVector256(address); /// /// __m128 _mm_maskload_ps (float const * mem_addr, __m128i mask) /// VMASKMOVPS xmm1, xmm2, m128 /// + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(float* address, Vector128 mask) => MaskLoad(address, mask); + /// /// __m128d _mm_maskload_pd (double const * mem_addr, __m128i mask) /// VMASKMOVPD xmm1, xmm2, m128 /// + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(double* address, Vector128 mask) => MaskLoad(address, mask); + /// /// __m256 _mm256_maskload_ps (float const * mem_addr, __m256i mask) /// VMASKMOVPS ymm1, ymm2, m256 /// + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(float* address, Vector256 mask) => MaskLoad(address, mask); + /// /// __m256d _mm256_maskload_pd (double const * mem_addr, __m256i mask) /// VMASKMOVPD ymm1, ymm2, m256 /// + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(double* address, Vector256 mask) => MaskLoad(address, mask); /// /// void _mm_maskstore_ps (float * mem_addr, __m128i mask, __m128 a) /// VMASKMOVPS m128, xmm1, xmm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_maskstore_pd (double * mem_addr, __m128i mask, __m128d a) /// VMASKMOVPD m128, xmm1, xmm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm256_maskstore_ps (float * mem_addr, __m256i mask, __m256 a) /// VMASKMOVPS m256, ymm1, ymm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_maskstore_pd (double * mem_addr, __m256i mask, __m256d a) /// VMASKMOVPD m256, ymm1, ymm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// @@ -1046,60 +1120,79 @@ internal X64() { } /// VMOVDQU m256, ymm1 /// VMOVDQU8 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector256 source) => Store(address, source); + /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU8 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(byte* address, Vector256 source) => Store(address, source); + /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU16 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(short* address, Vector256 source) => Store(address, source); + /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU16 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector256 source) => Store(address, source); + /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(int* address, Vector256 source) => Store(address, source); + /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(uint* address, Vector256 source) => Store(address, source); + /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU64 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(long* address, Vector256 source) => Store(address, source); + /// /// void _mm256_storeu_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQU m256, ymm1 /// VMOVDQU64 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector256 source) => Store(address, source); + /// /// void _mm256_storeu_ps (float * mem_addr, __m256 a) /// VMOVUPS m256, ymm1 /// VMOVUPS m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(float* address, Vector256 source) => Store(address, source); + /// /// void _mm256_storeu_pd (double * mem_addr, __m256d a) /// VMOVUPD m256, ymm1 /// VMOVUPD m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void Store(double* address, Vector256 source) => Store(address, source); /// @@ -1107,111 +1200,149 @@ internal X64() { } /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(sbyte* address, Vector256 source) => StoreAligned(address, source); + /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(byte* address, Vector256 source) => StoreAligned(address, source); + /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(short* address, Vector256 source) => StoreAligned(address, source); + /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(ushort* address, Vector256 source) => StoreAligned(address, source); + /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(int* address, Vector256 source) => StoreAligned(address, source); + /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(uint* address, Vector256 source) => StoreAligned(address, source); + /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA64 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(long* address, Vector256 source) => StoreAligned(address, source); + /// /// void _mm256_store_si256 (__m256i * mem_addr, __m256i a) /// VMOVDQA m256, ymm1 /// VMOVDQA64 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(ulong* address, Vector256 source) => StoreAligned(address, source); + /// /// void _mm256_store_ps (float * mem_addr, __m256 a) /// VMOVAPS m256, ymm1 /// VMOVAPS m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(float* address, Vector256 source) => StoreAligned(address, source); + /// /// void _mm256_store_pd (double * mem_addr, __m256d a) /// VMOVAPD m256, ymm1 /// VMOVAPD m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(double* address, Vector256 source) => StoreAligned(address, source); /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(sbyte* address, Vector256 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(byte* address, Vector256 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(short* address, Vector256 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ushort* address, Vector256 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(int* address, Vector256 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(uint* address, Vector256 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(long* address, Vector256 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm256_stream_si256 (__m256i * mem_addr, __m256i a) /// VMOVNTDQ m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ulong* address, Vector256 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm256_stream_ps (float * mem_addr, __m256 a) /// VMOVNTPS m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(float* address, Vector256 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm256_stream_pd (double * mem_addr, __m256d a) /// VMOVNTPD m256, ymm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(double* address, Vector256 source) => StoreAlignedNonTemporal(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.cs index 8094f05631bc21..aaaa02cf2ea57b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v1.cs @@ -1179,102 +1179,140 @@ internal Avx10v1() { } /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128d _mm_mask_compressstoreu_pd (void * a, __mmask8 k, __m128d a) /// VCOMPRESSPD m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128 _mm_mask_compressstoreu_ps (void * a, __mmask8 k, __m128 a) /// VCOMPRESSPS m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// __m256d _mm256_mask_compressstoreu_pd (void * a, __mmask8 k, __m256d a) /// VCOMPRESSPD m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// __m256 _mm256_mask_compressstoreu_ps (void * a, __mmask8 k, __m256 a) /// VCOMPRESSPS m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// @@ -2074,60 +2112,79 @@ internal Avx10v1() { } /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(byte* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128d _mm_mask_expandloadu_pd (__m128d s, __mmask8 k, void const * a) /// VEXPANDPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(double* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi16 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(short* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi32 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(int* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi64 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(long* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi8 (__m128i s, __mmask16 k, void const * a) /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(sbyte* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128 _mm_mask_expandloadu_ps (__m128 s, __mmask8 k, void const * a) /// VEXPANDPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(float* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi16 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ushort* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi32 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(uint* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi64 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ulong* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -2135,60 +2192,79 @@ internal Avx10v1() { } /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(byte* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256d _mm256_address_expandloadu_pd (__m256d s, __mmask8 k, void const * a) /// VEXPANDPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(double* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_mask_expandloadu_epi16 (__m256i s, __mmask16 k, void const * a) /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(short* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_address_expandloadu_epi32 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(int* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_address_expandloadu_epi64 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(long* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_mask_expandloadu_epi8 (__m256i s, __mmask32 k, void const * a) /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(sbyte* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256 _mm256_address_expandloadu_ps (__m256 s, __mmask8 k, void const * a) /// VEXPANDPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(float* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_mask_expandloadu_epi16 (__m256i s, __mmask16 k, void const * a) /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ushort* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_address_expandloadu_epi32 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(uint* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_address_expandloadu_epi64 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ulong* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -2403,60 +2479,79 @@ internal Avx10v1() { } /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(byte* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128d _mm_mask_loadu_pd (__m128d s, __mmask8 k, void const * mem_addr) /// VMOVUPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(double* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi16 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(short* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(int* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(long* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi8 (__m128i s, __mmask16 k, void const * mem_addr) /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(sbyte* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128 _mm_mask_loadu_ps (__m128 s, __mmask8 k, void const * mem_addr) /// VMOVUPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(float* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi16 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ushort* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(uint* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ulong* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -2464,59 +2559,78 @@ internal Avx10v1() { } /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(byte* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256d _mm256_mask_loadu_pd (__m256d s, __mmask8 k, void const * mem_addr) /// VMOVUPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(double* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi16 (__m256i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(short* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(int* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(long* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi8 (__m256i s, __mmask32 k, void const * mem_addr) /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(sbyte* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256 _mm256_mask_loadu_ps (__m256 s, __mmask8 k, void const * mem_addr) /// VMOVUPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(float* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi16 (__m256i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ushort* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(uint* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ulong* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -2524,36 +2638,47 @@ internal Avx10v1() { } /// VMOVAPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(double* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128i _mm_mask_load_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(int* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128i _mm_mask_load_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(long* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128 _mm_mask_load_ps (__m128 s, __mmask8 k, void const * mem_addr) /// VMOVAPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(float* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128i _mm_mask_load_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(uint* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128i _mm_mask_load_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(ulong* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -2561,200 +2686,271 @@ internal Avx10v1() { } /// VMOVAPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(double* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256i _mm256_mask_load_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(int* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256i _mm256_mask_load_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(long* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256 _mm256_mask_load_ps (__m256 s, __mmask8 k, void const * mem_addr) /// VMOVAPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(float* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256i _mm256_mask_load_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(uint* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256i _mm256_mask_load_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(ulong* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVUPD m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(int* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(long* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVUPS m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(uint* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(ulong* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVUPD m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(int* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(long* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVUPS m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(uint* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static new unsafe void MaskStore(ulong* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm_mask_store_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVAPD m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVAPS m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVAPD m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVAPS m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// @@ -4001,32 +4197,42 @@ internal V512() { } /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(long* address) => BroadcastVector128ToVector512(address); + /// /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(ulong* address) => BroadcastVector128ToVector512(address); + /// /// __m512d _mm512_broadcast_f64x2 (__m128d const * mem_addr) /// VBROADCASTF64x2 zmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(double* address) => BroadcastVector128ToVector512(address); /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(int* address) => BroadcastVector256ToVector512(address); + /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(uint* address) => BroadcastVector256ToVector512(address); + /// /// __m512 _mm512_broadcast_f32x8 (__m256 const * mem_addr) /// VBROADCASTF32x8 zmm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(float* address) => BroadcastVector256ToVector512(address); /// @@ -4065,21 +4271,28 @@ internal V512() { } /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// @@ -4235,24 +4448,31 @@ internal V512() { } /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(byte* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi16 (__m512i s, __mmask32 k, void * const a) /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(short* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi8 (__m512i s, __mmask64 k, void * const a) /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(sbyte* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi16 (__m512i s, __mmask32 k, void * const a) /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(ushort* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.cs index a3c1a88477b6f6..9ba7e082a57de4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx10v2.cs @@ -111,11 +111,13 @@ internal Avx10v2() { } /// /// VMOVW xmm1/m16, xmm2 /// + [RequiresUnsafe] public static unsafe void StoreScalar(short* address, Vector128 source) => StoreScalar(address, source); /// /// VMOVW xmm1/m16, xmm2 /// + [RequiresUnsafe] public static unsafe void StoreScalar(ushort* address, Vector128 source) => StoreScalar(address, source); /// Provides access to the x86 AVX10.2 hardware instructions, that are only available to 64-bit processes, via intrinsics. diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs index edf6fefcda7ed3..5fc1b2001a70ad 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs @@ -425,55 +425,70 @@ internal X64() { } /// VPBROADCASTB xmm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(byte* source) => BroadcastScalarToVector128(source); + /// /// __m128i _mm_broadcastb_epi8 (__m128i a) /// VPBROADCASTB xmm1, m8 /// VPBROADCASTB xmm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(sbyte* source) => BroadcastScalarToVector128(source); + /// /// __m128i _mm_broadcastw_epi16 (__m128i a) /// VPBROADCASTW xmm1, m16 /// VPBROADCASTW xmm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(short* source) => BroadcastScalarToVector128(source); + /// /// __m128i _mm_broadcastw_epi16 (__m128i a) /// VPBROADCASTW xmm1, m16 /// VPBROADCASTW xmm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(ushort* source) => BroadcastScalarToVector128(source); + /// /// __m128i _mm_broadcastd_epi32 (__m128i a) /// VPBROADCASTD xmm1, m32 /// VPBROADCASTD xmm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(int* source) => BroadcastScalarToVector128(source); + /// /// __m128i _mm_broadcastd_epi32 (__m128i a) /// VPBROADCASTD xmm1, m32 /// VPBROADCASTD xmm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(uint* source) => BroadcastScalarToVector128(source); + /// /// __m128i _mm_broadcastq_epi64 (__m128i a) /// VPBROADCASTQ xmm1, m64 /// VPBROADCASTQ xmm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(long* source) => BroadcastScalarToVector128(source); + /// /// __m128i _mm_broadcastq_epi64 (__m128i a) /// VPBROADCASTQ xmm1, m64 /// VPBROADCASTQ xmm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector128 BroadcastScalarToVector128(ulong* source) => BroadcastScalarToVector128(source); /// @@ -543,55 +558,70 @@ internal X64() { } /// VPBROADCASTB ymm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(byte* source) => BroadcastScalarToVector256(source); + /// /// __m256i _mm256_broadcastb_epi8 (__m128i a) /// VPBROADCASTB ymm1, m8 /// VPBROADCASTB ymm1 {k1}{z}, m8 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(sbyte* source) => BroadcastScalarToVector256(source); + /// /// __m256i _mm256_broadcastw_epi16 (__m128i a) /// VPBROADCASTW ymm1, m16 /// VPBROADCASTW ymm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(short* source) => BroadcastScalarToVector256(source); + /// /// __m256i _mm256_broadcastw_epi16 (__m128i a) /// VPBROADCASTW ymm1, m16 /// VPBROADCASTW ymm1 {k1}{z}, m16 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(ushort* source) => BroadcastScalarToVector256(source); + /// /// __m256i _mm256_broadcastd_epi32 (__m128i a) /// VPBROADCASTD ymm1, m32 /// VPBROADCASTD ymm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(int* source) => BroadcastScalarToVector256(source); + /// /// __m256i _mm256_broadcastd_epi32 (__m128i a) /// VPBROADCASTD ymm1, m32 /// VPBROADCASTD ymm1 {k1}{z}, m32 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(uint* source) => BroadcastScalarToVector256(source); + /// /// __m256i _mm256_broadcastq_epi64 (__m128i a) /// VPBROADCASTQ ymm1, m64 /// VPBROADCASTQ ymm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(long* source) => BroadcastScalarToVector256(source); + /// /// __m256i _mm256_broadcastq_epi64 (__m128i a) /// VPBROADCASTQ ymm1, m64 /// VPBROADCASTQ ymm1 {k1}{z}, m64 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastScalarToVector256(ulong* source) => BroadcastScalarToVector256(source); /// @@ -600,55 +630,70 @@ internal X64() { } /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(sbyte* address) => BroadcastVector128ToVector256(address); + /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) /// VBROADCASTI128 ymm1, m128 /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(byte* address) => BroadcastVector128ToVector256(address); + /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) /// VBROADCASTI128 ymm1, m128 /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(short* address) => BroadcastVector128ToVector256(address); + /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) /// VBROADCASTI128 ymm1, m128 /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(ushort* address) => BroadcastVector128ToVector256(address); + /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) /// VBROADCASTI128 ymm1, m128 /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(int* address) => BroadcastVector128ToVector256(address); + /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) /// VBROADCASTI128 ymm1, m128 /// VBROADCASTI32x4 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(uint* address) => BroadcastVector128ToVector256(address); + /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) /// VBROADCASTI128 ymm1, m128 /// VBROADCASTI64x2 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(long* address) => BroadcastVector128ToVector256(address); + /// /// __m256i _mm256_broadcastsi128_si256 (__m128i a) /// VBROADCASTI128 ymm1, m128 /// VBROADCASTI64x2 ymm1 {k1}{z}, m128 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe Vector256 BroadcastVector128ToVector256(ulong* address) => BroadcastVector128ToVector256(address); /// @@ -802,72 +847,95 @@ internal X64() { } /// VPMOVSXBW ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int16(sbyte* address) => ConvertToVector256Int16(address); + /// /// VPMOVZXBW ymm1, m128 /// VPMOVZXBW ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int16(byte* address) => ConvertToVector256Int16(address); + /// /// VPMOVSXBD ymm1, m64 /// VPMOVSXBD ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(sbyte* address) => ConvertToVector256Int32(address); + /// /// VPMOVZXBD ymm1, m64 /// VPMOVZXBD ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(byte* address) => ConvertToVector256Int32(address); + /// /// VPMOVSXWD ymm1, m128 /// VPMOVSXWD ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(short* address) => ConvertToVector256Int32(address); + /// /// VPMOVZXWD ymm1, m128 /// VPMOVZXWD ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int32(ushort* address) => ConvertToVector256Int32(address); + /// /// VPMOVSXBQ ymm1, m32 /// VPMOVSXBQ ymm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(sbyte* address) => ConvertToVector256Int64(address); + /// /// VPMOVZXBQ ymm1, m32 /// VPMOVZXBQ ymm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(byte* address) => ConvertToVector256Int64(address); + /// /// VPMOVSXWQ ymm1, m64 /// VPMOVSXWQ ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(short* address) => ConvertToVector256Int64(address); + /// /// VPMOVZXWQ ymm1, m64 /// VPMOVZXWQ ymm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(ushort* address) => ConvertToVector256Int64(address); + /// /// VPMOVSXDQ ymm1, m128 /// VPMOVSXDQ ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(int* address) => ConvertToVector256Int64(address); + /// /// VPMOVZXDQ ymm1, m128 /// VPMOVZXDQ ymm1 {k1}{z}, m128 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector256 ConvertToVector256Int64(uint* address) => ConvertToVector256Int64(address); /// @@ -924,6 +992,7 @@ internal X64() { } /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -935,11 +1004,13 @@ public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128< _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_i32gather_epi32 (int const* base_addr, __m128i vindex, const int scale) /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -951,11 +1022,13 @@ public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector12 _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_i32gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(long* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -967,11 +1040,13 @@ public static unsafe Vector128 GatherVector128(long* baseAddress, Vector12 _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_i32gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -983,11 +1058,13 @@ public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128 _mm_i32gather_ps (float const* base_addr, __m128i vindex, const int scale) /// VGATHERDPS xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(float* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -999,11 +1076,13 @@ public static unsafe Vector128 GatherVector128(float* baseAddress, Vector _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128d _mm_i32gather_pd (double const* base_addr, __m128i vindex, const int scale) /// VGATHERDPD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(double* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1015,11 +1094,13 @@ public static unsafe Vector128 GatherVector128(double* baseAddress, Vect _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_i64gather_epi32 (int const* base_addr, __m128i vindex, const int scale) /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1031,11 +1112,13 @@ public static unsafe Vector128 GatherVector128(int* baseAddress, Vector128< _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_i64gather_epi32 (int const* base_addr, __m128i vindex, const int scale) /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1047,11 +1130,13 @@ public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector12 _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_i64gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(long* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1063,11 +1148,13 @@ public static unsafe Vector128 GatherVector128(long* baseAddress, Vector12 _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_i64gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1079,11 +1166,13 @@ public static unsafe Vector128 GatherVector128(ulong* baseAddress, Vector _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128 _mm_i64gather_ps (float const* base_addr, __m128i vindex, const int scale) /// VGATHERQPS xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(float* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1095,11 +1184,13 @@ public static unsafe Vector128 GatherVector128(float* baseAddress, Vector _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128d _mm_i64gather_pd (double const* base_addr, __m128i vindex, const int scale) /// VGATHERQPD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(double* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1111,11 +1202,13 @@ public static unsafe Vector128 GatherVector128(double* baseAddress, Vect _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_i32gather_epi32 (int const* base_addr, __m256i vindex, const int scale) /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherVector256(int* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1127,11 +1220,13 @@ public static unsafe Vector256 GatherVector256(int* baseAddress, Vector256< _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_i32gather_epi32 (int const* base_addr, __m256i vindex, const int scale) /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherVector256(uint* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1143,11 +1238,13 @@ public static unsafe Vector256 GatherVector256(uint* baseAddress, Vector25 _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_i32gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherVector256(long* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1159,11 +1256,13 @@ public static unsafe Vector256 GatherVector256(long* baseAddress, Vector12 _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_i32gather_epi64 (__int64 const* base_addr, __m128i vindex, const int scale) /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1175,11 +1274,13 @@ public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256 _mm256_i32gather_ps (float const* base_addr, __m256i vindex, const int scale) /// VGATHERDPS ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherVector256(float* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1191,11 +1292,13 @@ public static unsafe Vector256 GatherVector256(float* baseAddress, Vector _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256d _mm256_i32gather_pd (double const* base_addr, __m128i vindex, const int scale) /// VGATHERDPD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherVector256(double* baseAddress, Vector128 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1207,11 +1310,13 @@ public static unsafe Vector256 GatherVector256(double* baseAddress, Vect _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm256_i64gather_epi32 (int const* base_addr, __m256i vindex, const int scale) /// VPGATHERQD xmm1, vm64y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(int* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1223,11 +1328,13 @@ public static unsafe Vector128 GatherVector128(int* baseAddress, Vector256< _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm256_i64gather_epi32 (int const* base_addr, __m256i vindex, const int scale) /// VPGATHERQD xmm1, vm64y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1239,11 +1346,13 @@ public static unsafe Vector128 GatherVector128(uint* baseAddress, Vector25 _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_i64gather_epi64 (__int64 const* base_addr, __m256i vindex, const int scale) /// VPGATHERQQ ymm1, vm64y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherVector256(long* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1255,11 +1364,13 @@ public static unsafe Vector256 GatherVector256(long* baseAddress, Vector25 _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_i64gather_epi64 (__int64 const* base_addr, __m256i vindex, const int scale) /// VPGATHERQQ ymm1, vm64y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1271,11 +1382,13 @@ public static unsafe Vector256 GatherVector256(ulong* baseAddress, Vector _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128 _mm256_i64gather_ps (float const* base_addr, __m256i vindex, const int scale) /// VGATHERQPS xmm1, vm64y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherVector128(float* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1287,11 +1400,13 @@ public static unsafe Vector128 GatherVector128(float* baseAddress, Vector _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256d _mm256_i64gather_pd (double const* base_addr, __m256i vindex, const int scale) /// VGATHERQPD ymm1, vm64y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherVector256(double* baseAddress, Vector256 index, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1309,6 +1424,7 @@ public static unsafe Vector256 GatherVector256(double* baseAddress, Vect /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, int* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1320,11 +1436,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, i _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_mask_i32gather_epi32 (__m128i src, int const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERDD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, uint* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1336,11 +1454,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_mask_i32gather_epi64 (__m128i src, __int64 const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, long* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1352,11 +1472,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_mask_i32gather_epi64 (__m128i src, __int64 const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERDQ xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, ulong* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1368,11 +1490,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128 _mm_mask_i32gather_ps (__m128 src, float const* base_addr, __m128i vindex, __m128 mask, const int scale) /// VGATHERDPS xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, float* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1384,11 +1508,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128d _mm_mask_i32gather_pd (__m128d src, double const* base_addr, __m128i vindex, __m128d mask, const int scale) /// VGATHERDPD xmm1, vm32x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, double* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1400,11 +1526,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sou _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_mask_i64gather_epi32 (__m128i src, int const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, int* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1416,11 +1544,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, i _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_mask_i64gather_epi32 (__m128i src, int const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERQD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, uint* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1432,11 +1562,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_mask_i64gather_epi64 (__m128i src, __int64 const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, long* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1448,11 +1580,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm_mask_i64gather_epi64 (__m128i src, __int64 const* base_addr, __m128i vindex, __m128i mask, const int scale) /// VPGATHERQQ xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, ulong* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1464,11 +1598,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128 _mm_mask_i64gather_ps (__m128 src, float const* base_addr, __m128i vindex, __m128 mask, const int scale) /// VGATHERQPS xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, float* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1480,11 +1616,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128d _mm_mask_i64gather_pd (__m128d src, double const* base_addr, __m128i vindex, __m128d mask, const int scale) /// VGATHERQPD xmm1, vm64x, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, double* baseAddress, Vector128 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1496,11 +1634,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sou _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_mask_i32gather_epi32 (__m256i src, int const* base_addr, __m256i vindex, __m256i mask, const int scale) /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, int* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1512,11 +1652,13 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 source, i _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_mask_i32gather_epi32 (__m256i src, int const* base_addr, __m256i vindex, __m256i mask, const int scale) /// VPGATHERDD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, uint* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1528,11 +1670,13 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 source, _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_mask_i32gather_epi64 (__m256i src, __int64 const* base_addr, __m128i vindex, __m256i mask, const int scale) /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, long* baseAddress, Vector128 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1544,11 +1688,13 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 source, _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_mask_i32gather_epi64 (__m256i src, __int64 const* base_addr, __m128i vindex, __m256i mask, const int scale) /// VPGATHERDQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, ulong* baseAddress, Vector128 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1560,11 +1706,13 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sourc _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256 _mm256_mask_i32gather_ps (__m256 src, float const* base_addr, __m256i vindex, __m256 mask, const int scale) /// VPGATHERDPS ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, float* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1576,11 +1724,13 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sourc _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256d _mm256_mask_i32gather_pd (__m256d src, double const* base_addr, __m128i vindex, __m256d mask, const int scale) /// VPGATHERDPD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, double* baseAddress, Vector128 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1592,11 +1742,13 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sou _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm256_mask_i64gather_epi32 (__m128i src, int const* base_addr, __m256i vindex, __m128i mask, const int scale) /// VPGATHERQD xmm1, vm32y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, int* baseAddress, Vector256 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1608,11 +1760,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, i _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128i _mm256_mask_i64gather_epi32 (__m128i src, int const* base_addr, __m256i vindex, __m128i mask, const int scale) /// VPGATHERQD xmm1, vm32y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, uint* baseAddress, Vector256 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1624,11 +1778,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 source, _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_mask_i64gather_epi64 (__m256i src, __int64 const* base_addr, __m256i vindex, __m256i mask, const int scale) /// VPGATHERQQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, long* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1640,11 +1796,13 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 source, _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256i _mm256_mask_i64gather_epi64 (__m256i src, __int64 const* base_addr, __m256i vindex, __m256i mask, const int scale) /// VPGATHERQQ ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, ulong* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1656,11 +1814,13 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sourc _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m128 _mm256_mask_i64gather_ps (__m128 src, float const* base_addr, __m256i vindex, __m128 mask, const int scale) /// VGATHERQPS xmm1, vm32y, xmm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector128 GatherMaskVector128(Vector128 source, float* baseAddress, Vector256 index, Vector128 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1672,11 +1832,13 @@ public static unsafe Vector128 GatherMaskVector128(Vector128 sourc _ => throw new ArgumentOutOfRangeException(nameof(scale)), }; } + /// /// __m256d _mm256_mask_i64gather_pd (__m256d src, double const* base_addr, __m256i vindex, __m256d mask, const int scale) /// VGATHERQPD ymm1, vm32y, ymm2 /// The scale parameter should be 1, 2, 4 or 8, otherwise, ArgumentOutOfRangeException will be thrown. /// + [RequiresUnsafe] public static unsafe Vector256 GatherMaskVector256(Vector256 source, double* baseAddress, Vector256 index, Vector256 mask, [ConstantExpected(Min = (byte)(1), Max = (byte)(8))] byte scale) { return scale switch @@ -1776,123 +1938,168 @@ public static unsafe Vector256 GatherMaskVector256(Vector256 sou /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(sbyte* address) => LoadAlignedVector256NonTemporal(address); + /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(byte* address) => LoadAlignedVector256NonTemporal(address); + /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(short* address) => LoadAlignedVector256NonTemporal(address); + /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(ushort* address) => LoadAlignedVector256NonTemporal(address); + /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(int* address) => LoadAlignedVector256NonTemporal(address); + /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(uint* address) => LoadAlignedVector256NonTemporal(address); + /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(long* address) => LoadAlignedVector256NonTemporal(address); + /// /// __m256i _mm256_stream_load_si256 (__m256i const* mem_addr) /// VMOVNTDQA ymm1, m256 /// + [RequiresUnsafe] public static unsafe Vector256 LoadAlignedVector256NonTemporal(ulong* address) => LoadAlignedVector256NonTemporal(address); /// /// __m128i _mm_maskload_epi32 (int const* mem_addr, __m128i mask) /// VPMASKMOVD xmm1, xmm2, m128 /// + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(int* address, Vector128 mask) => MaskLoad(address, mask); + /// /// __m128i _mm_maskload_epi32 (int const* mem_addr, __m128i mask) /// VPMASKMOVD xmm1, xmm2, m128 /// + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(uint* address, Vector128 mask) => MaskLoad(address, mask); + /// /// __m128i _mm_maskload_epi64 (__int64 const* mem_addr, __m128i mask) /// VPMASKMOVQ xmm1, xmm2, m128 /// + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(long* address, Vector128 mask) => MaskLoad(address, mask); + /// /// __m128i _mm_maskload_epi64 (__int64 const* mem_addr, __m128i mask) /// VPMASKMOVQ xmm1, xmm2, m128 /// + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ulong* address, Vector128 mask) => MaskLoad(address, mask); + /// /// __m256i _mm256_maskload_epi32 (int const* mem_addr, __m256i mask) /// VPMASKMOVD ymm1, ymm2, m256 /// + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(int* address, Vector256 mask) => MaskLoad(address, mask); + /// /// __m256i _mm256_maskload_epi32 (int const* mem_addr, __m256i mask) /// VPMASKMOVD ymm1, ymm2, m256 /// + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(uint* address, Vector256 mask) => MaskLoad(address, mask); + /// /// __m256i _mm256_maskload_epi64 (__int64 const* mem_addr, __m256i mask) /// VPMASKMOVQ ymm1, ymm2, m256 /// + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(long* address, Vector256 mask) => MaskLoad(address, mask); + /// /// __m256i _mm256_maskload_epi64 (__int64 const* mem_addr, __m256i mask) /// VPMASKMOVQ ymm1, ymm2, m256 /// + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ulong* address, Vector256 mask) => MaskLoad(address, mask); /// /// void _mm_maskstore_epi32 (int* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVD m128, xmm1, xmm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_maskstore_epi32 (int* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVD m128, xmm1, xmm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_maskstore_epi64 (__int64* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVQ m128, xmm1, xmm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_maskstore_epi64 (__int64* mem_addr, __m128i mask, __m128i a) /// VPMASKMOVQ m128, xmm1, xmm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm256_maskstore_epi32 (int* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVD m256, ymm1, ymm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_maskstore_epi32 (int* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVD m256, ymm1, ymm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_maskstore_epi64 (__int64* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVQ m256, ymm1, ymm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_maskstore_epi64 (__int64* mem_addr, __m256i mask, __m256i a) /// VPMASKMOVQ m256, ymm1, ymm2 /// + [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs index 7161e936c09b40..767b650223af3f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs @@ -394,24 +394,31 @@ internal VL() { } /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(byte* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi16 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(short* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi8 (__m128i s, __mmask16 k, void const * mem_addr) /// VMOVDQU8 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(sbyte* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi16 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ushort* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -419,66 +426,87 @@ internal VL() { } /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(byte* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi16 (__m256i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(short* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi8 (__m256i s, __mmask32 k, void const * mem_addr) /// VMOVDQU8 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(sbyte* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi16 (__m256i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ushort* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask16 k, __m128i a) /// VMOVDQU8 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_si128 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU16 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask32 k, __m256i a) /// VMOVDQU8 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_si256 (void * mem_addr, __mmask16 k, __m256i a) /// VMOVDQU16 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// @@ -912,21 +940,28 @@ internal X64() { } /// __m512i _mm512_loadu_epi8 (void const * mem_addr) /// VMOVDQU8 zmm1, m512 /// + [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(sbyte* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_epi8 (void const * mem_addr) /// VMOVDQU8 zmm1, m512 /// + [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(byte* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_epi16 (void const * mem_addr) /// VMOVDQU16 zmm1, m512 /// + [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(short* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_epi16 (void const * mem_addr) /// VMOVDQU16 zmm1, m512 /// + [RequiresUnsafe] public static new unsafe Vector512 LoadVector512(ushort* address) => LoadVector512(address); /// @@ -934,45 +969,59 @@ internal X64() { } /// VMOVDQU8 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(byte* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); + /// /// __m512i _mm512_mask_loadu_epi16 (__m512i s, __mmask32 k, void const * mem_addr) /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(short* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); + /// /// __m512i _mm512_mask_loadu_epi8 (__m512i s, __mmask64 k, void const * mem_addr) /// VMOVDQU8 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(sbyte* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); + /// /// __m512i _mm512_mask_loadu_epi16 (__m512i s, __mmask32 k, void const * mem_addr) /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(ushort* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask64 k, __m512i a) /// VMOVDQU8 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(byte* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); + /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask32 k, __m512i a) /// VMOVDQU16 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(short* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); + /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask64 k, __m512i a) /// VMOVDQU8 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(sbyte* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); + /// /// void _mm512_mask_storeu_si512 (void * mem_addr, __mmask32 k, __m512i a) /// VMOVDQU16 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(ushort* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// @@ -1279,21 +1328,28 @@ internal X64() { } /// void _mm512_storeu_epi8 (void * mem_addr, __m512i a) /// VMOVDQU8 m512, zmm1 /// + [RequiresUnsafe] public static new unsafe void Store(sbyte* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_epi8 (void * mem_addr, __m512i a) /// VMOVDQU8 m512, zmm1 /// + [RequiresUnsafe] public static new unsafe void Store(byte* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_epi16 (void * mem_addr, __m512i a) /// VMOVDQU16 m512, zmm1 /// + [RequiresUnsafe] public static new unsafe void Store(short* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_epi16 (void * mem_addr, __m512i a) /// VMOVDQU16 m512, zmm1 /// + [RequiresUnsafe] public static new unsafe void Store(ushort* address, Vector512 source) => Store(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs index 0acd454c72c8a8..076bc6d83ac941 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs @@ -317,32 +317,42 @@ internal X64() { } /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(long* address) => BroadcastVector128ToVector512(address); + /// /// __m512i _mm512_broadcast_i64x2 (__m128i const * mem_addr) /// VBROADCASTI64x2 zmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(ulong* address) => BroadcastVector128ToVector512(address); + /// /// __m512d _mm512_broadcast_f64x2 (__m128d const * mem_addr) /// VBROADCASTF64x2 zmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(double* address) => BroadcastVector128ToVector512(address); /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(int* address) => BroadcastVector256ToVector512(address); + /// /// __m512i _mm512_broadcast_i32x8 (__m256i const * mem_addr) /// VBROADCASTI32x8 zmm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(uint* address) => BroadcastVector256ToVector512(address); + /// /// __m512 _mm512_broadcast_f32x8 (__m256 const * mem_addr) /// VBROADCASTF32x8 zmm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(float* address) => BroadcastVector256ToVector512(address); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs index 9019c4cc8aa7f1..6caa2a4cd1ecca 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs @@ -782,62 +782,84 @@ internal VL() { } /// __m128d _mm_mask_compressstoreu_pd (void * a, __mmask8 k, __m128d a) /// VCOMPRESSPD m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128 _mm_mask_compressstoreu_ps (void * a, __mmask8 k, __m128 a) /// VCOMPRESSPS m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi32 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSD m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi64 (void * a, __mask8 k, __m128i a) /// VPCOMPRESSQ m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// __m256d _mm256_mask_compressstoreu_pd (void * a, __mmask8 k, __m256d a) /// VCOMPRESSPD m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// __m256 _mm256_mask_compressstoreu_ps (void * a, __mmask8 k, __m256 a) /// VCOMPRESSPS m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi32 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSD m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi64 (void * a, __mmask8 k, __m256i a) /// VPCOMPRESSQ m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// @@ -1276,36 +1298,47 @@ internal VL() { } /// VEXPANDPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(double* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi32 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(int* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi64 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(long* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128 _mm_mask_expandloadu_ps (__m128 s, __mmask8 k, void const * a) /// VEXPANDPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(float* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi32 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(uint* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi64 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDQ xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ulong* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -1313,36 +1346,47 @@ internal VL() { } /// VEXPANDPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(double* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_address_expandloadu_epi32 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(int* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_address_expandloadu_epi64 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(long* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256 _mm256_address_expandloadu_ps (__m256 s, __mmask8 k, void const * a) /// VEXPANDPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(float* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_address_expandloadu_epi32 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(uint* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_address_expandloadu_epi64 (__m256i s, __mmask8 k, void const * a) /// VPEXPANDQ ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ulong* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); /// @@ -1413,36 +1457,47 @@ internal VL() { } /// VMOVUPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(double* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(int* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(long* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128 _mm_mask_loadu_ps (__m128 s, __mmask8 k, void const * mem_addr) /// VMOVUPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(float* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(uint* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); + /// /// __m128i _mm_mask_loadu_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoad(ulong* address, Vector128 mask, Vector128 merge) => MaskLoad(address, mask, merge); /// @@ -1450,35 +1505,46 @@ internal VL() { } /// VMOVUPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(double* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(int* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(long* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256 _mm256_mask_loadu_ps (__m256 s, __mmask8 k, void const * mem_addr) /// VMOVUPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(float* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(uint* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); + /// /// __m256i _mm256_mask_loadu_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoad(ulong* address, Vector256 mask, Vector256 merge) => MaskLoad(address, mask, merge); /// @@ -1486,36 +1552,47 @@ internal VL() { } /// VMOVAPD xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(double* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128i _mm_mask_load_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(int* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128i _mm_mask_load_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(long* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128 _mm_mask_load_ps (__m128 s, __mmask8 k, void const * mem_addr) /// VMOVAPS xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(float* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128i _mm_mask_load_epi32 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(uint* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m128i _mm_mask_load_epi64 (__m128i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 MaskLoadAligned(ulong* address, Vector128 mask, Vector128 merge) => MaskLoadAligned(address, mask, merge); /// @@ -1523,160 +1600,215 @@ internal VL() { } /// VMOVAPD ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(double* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256i _mm256_mask_load_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(int* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256i _mm256_mask_load_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(long* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256 _mm256_mask_load_ps (__m256 s, __mmask8 k, void const * mem_addr) /// VMOVAPS ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(float* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256i _mm256_mask_load_epi32 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA32 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(uint* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m256i _mm256_mask_load_epi64 (__m256i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 MaskLoadAligned(ulong* address, Vector256 mask, Vector256 merge) => MaskLoadAligned(address, mask, merge); /// /// void _mm_mask_storeu_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVUPD m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVUPS m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + /// /// void _mm_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQU64 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm256_mask_storeu_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVUPD m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVUPS m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + /// /// void _mm256_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQU64 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm_mask_store_pd (void * mem_addr, __mmask8 k, __m128d a) /// VMOVAPD m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_ps (void * mem_addr, __mmask8 k, __m128 a) /// VMOVAPS m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_epi32 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm_mask_store_epi64 (void * mem_addr, __mmask8 k, __m128i a) /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector128 mask, Vector128 source) => MaskStoreAligned(address, mask, source); /// /// void _mm256_mask_store_pd (void * mem_addr, __mmask8 k, __m256d a) /// VMOVAPD m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_ps (void * mem_addr, __mmask8 k, __m256 a) /// VMOVAPS m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_epi32 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm256_mask_store_epi64 (void * mem_addr, __mmask8 k, __m256i a) /// VMOVDQA32 m256 {k1}{z}, ymm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector256 mask, Vector256 source) => MaskStoreAligned(address, mask, source); /// @@ -2572,32 +2704,42 @@ internal X64() { } /// __m512i _mm512_broadcast_i32x4 (__m128i const * mem_addr) /// VBROADCASTI32x4 zmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(int* address) => BroadcastVector128ToVector512(address); + /// /// __m512i _mm512_broadcast_i32x4 (__m128i const * mem_addr) /// VBROADCASTI32x4 zmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(uint* address) => BroadcastVector128ToVector512(address); + /// /// __m512 _mm512_broadcast_f32x4 (__m128 const * mem_addr) /// VBROADCASTF32x4 zmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector128ToVector512(float* address) => BroadcastVector128ToVector512(address); /// /// __m512i _mm512_broadcast_i64x4 (__m256i const * mem_addr) /// VBROADCASTI64x4 zmm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(long* address) => BroadcastVector256ToVector512(address); + /// /// __m512i _mm512_broadcast_i64x4 (__m256i const * mem_addr) /// VBROADCASTI64x4 zmm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(ulong* address) => BroadcastVector256ToVector512(address); + /// /// __m512d _mm512_broadcast_f64x4 (__m256d const * mem_addr) /// VBROADCASTF64x4 zmm1 {k1}{z}, m256 /// + [RequiresUnsafe] public static unsafe Vector512 BroadcastVector256ToVector512(double* address) => BroadcastVector256ToVector512(address); /// @@ -2915,31 +3057,42 @@ internal X64() { } /// __m512d _mm512_mask_compressstoreu_pd (void * s, __mmask8 k, __m512d a) /// VCOMPRESSPD m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(double* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// void _mm512_mask_compressstoreu_epi32 (void * s, __mmask16 k, __m512i a) /// VPCOMPRESSD m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(int* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// void _mm512_mask_compressstoreu_epi64 (void * s, __mmask8 k, __m512i a) /// VPCOMPRESSQ m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(long* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// __m512 _mm512_mask_compressstoreu_ps (void * s, __mmask16 k, __m512 a) /// VCOMPRESSPS m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(float* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// void _mm512_mask_compressstoreu_epi32 (void * s, __mmask16 k, __m512i a) /// VPCOMPRESSD m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(uint* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// void _mm512_mask_compressstoreu_epi64 (void * s, __mmask8 k, __m512i a) /// VPCOMPRESSQ m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ulong* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// @@ -3457,36 +3610,47 @@ internal X64() { } /// VEXPANDPD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(double* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi32 (__m512i s, __mmask16 k, void * const a) /// VPEXPANDD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(int* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi64 (__m512i s, __mmask8 k, void * const a) /// VPEXPANDQ zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(long* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512 _mm512_mask_expandloadu_ps (__m512 s, __mmask16 k, void * const a) /// VEXPANDPS zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(float* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi32 (__m512i s, __mmask16 k, void * const a) /// VPEXPANDD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(uint* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi64 (__m512i s, __mmask8 k, void * const a) /// VPEXPANDQ zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(ulong* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); /// @@ -3953,143 +4117,196 @@ internal X64() { } /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(byte* address) => LoadAlignedVector512(address); + /// /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(sbyte* address) => LoadAlignedVector512(address); + /// /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(short* address) => LoadAlignedVector512(address); + /// /// __m512i _mm512_load_si512 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(ushort* address) => LoadAlignedVector512(address); + /// /// __m512i _mm512_load_epi32 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(int* address) => LoadAlignedVector512(address); + /// /// __m512i _mm512_load_epi32 (__m512i const * mem_addr) /// VMOVDQA32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(uint* address) => LoadAlignedVector512(address); + /// /// __m512i _mm512_load_epi64 (__m512i const * mem_addr) /// VMOVDQA64 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(long* address) => LoadAlignedVector512(address); + /// /// __m512i _mm512_load_epi64 (__m512i const * mem_addr) /// VMOVDQA64 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(ulong* address) => LoadAlignedVector512(address); + /// /// __m512 _mm512_load_ps (float const * mem_addr) /// VMOVAPS zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(float* address) => LoadAlignedVector512(address); + /// /// __m512d _mm512_load_pd (double const * mem_addr) /// VMOVAPD zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512(double* address) => LoadAlignedVector512(address); /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(sbyte* address) => LoadAlignedVector512NonTemporal(address); + /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(byte* address) => LoadAlignedVector512NonTemporal(address); + /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(short* address) => LoadAlignedVector512NonTemporal(address); + /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(ushort* address) => LoadAlignedVector512NonTemporal(address); + /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(int* address) => LoadAlignedVector512NonTemporal(address); + /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(uint* address) => LoadAlignedVector512NonTemporal(address); + /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(long* address) => LoadAlignedVector512NonTemporal(address); + /// /// __m512i _mm512_stream_load_si512 (__m512i const* mem_addr) /// VMOVNTDQA zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadAlignedVector512NonTemporal(ulong* address) => LoadAlignedVector512NonTemporal(address); /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(sbyte* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(byte* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(short* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_si512 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(ushort* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_epi32 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(int* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_epi32 (__m512i const * mem_addr) /// VMOVDQU32 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(uint* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_epi64 (__m512i const * mem_addr) /// VMOVDQU64 zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(long* address) => LoadVector512(address); + /// /// __m512i _mm512_loadu_epi64 (__m512i const * mem_addr) /// VMOVDQU64 zmm1 , m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(ulong* address) => LoadVector512(address); + /// /// __m512 _mm512_loadu_ps (float const * mem_addr) /// VMOVUPS zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(float* address) => LoadVector512(address); + /// /// __m512d _mm512_loadu_pd (double const * mem_addr) /// VMOVUPD zmm1, m512 /// + [RequiresUnsafe] public static unsafe Vector512 LoadVector512(double* address) => LoadVector512(address); /// @@ -4097,36 +4314,47 @@ internal X64() { } /// VMOVUPD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(double* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); + /// /// __m512i _mm512_mask_loadu_epi32 (__m512i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(int* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); + /// /// __m512i _mm512_mask_loadu_epi64 (__m512i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(long* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); + /// /// __m512 _mm512_mask_loadu_ps (__m512 s, __mmask16 k, void const * mem_addr) /// VMOVUPS zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(float* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); + /// /// __m512i _mm512_mask_loadu_epi32 (__m512i s, __mmask16 k, void const * mem_addr) /// VMOVDQU32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(uint* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); + /// /// __m512i _mm512_mask_loadu_epi64 (__m512i s, __mmask8 k, void const * mem_addr) /// VMOVDQU64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoad(ulong* address, Vector512 mask, Vector512 merge) => MaskLoad(address, mask, merge); /// @@ -4134,98 +4362,131 @@ internal X64() { } /// VMOVAPD zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(double* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m512i _mm512_mask_load_epi32 (__m512i s, __mmask16 k, void const * mem_addr) /// VMOVDQA32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(int* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m512i _mm512_mask_load_epi64 (__m512i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(long* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m512 _mm512_mask_load_ps (__m512 s, __mmask16 k, void const * mem_addr) /// VMOVAPS zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(float* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m512i _mm512_mask_load_epi32 (__m512i s, __mmask16 k, void const * mem_addr) /// VMOVDQA32 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(uint* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); + /// /// __m512i _mm512_mask_load_epi64 (__m512i s, __mmask8 k, void const * mem_addr) /// VMOVDQA64 zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 MaskLoadAligned(ulong* address, Vector512 mask, Vector512 merge) => MaskLoadAligned(address, mask, merge); /// /// void _mm512_mask_storeu_pd (void * mem_addr, __mmask8 k, __m512d a) /// VMOVUPD m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(double* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); + /// /// void _mm512_mask_storeu_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQU32 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(int* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); + /// /// void _mm512_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQU64 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(long* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); + /// /// void _mm512_mask_storeu_ps (void * mem_addr, __mmask16 k, __m512 a) /// VMOVUPS m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(float* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); + /// /// void _mm512_mask_storeu_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQU32 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(uint* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); + /// /// void _mm512_mask_storeu_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQU64 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStore(ulong* address, Vector512 mask, Vector512 source) => MaskStore(address, mask, source); /// /// void _mm512_mask_store_pd (void * mem_addr, __mmask8 k, __m512d a) /// VMOVAPD m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(double* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm512_mask_store_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(int* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm512_mask_store_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(long* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm512_mask_store_ps (void * mem_addr, __mmask16 k, __m512 a) /// VMOVAPS m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(float* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm512_mask_store_epi32 (void * mem_addr, __mmask16 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(uint* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); + /// /// void _mm512_mask_store_epi64 (void * mem_addr, __mmask8 k, __m512i a) /// VMOVDQA32 m512 {k1}{z}, zmm1 /// + [RequiresUnsafe] public static unsafe void MaskStoreAligned(ulong* address, Vector512 mask, Vector512 source) => MaskStoreAligned(address, mask, source); /// @@ -5010,153 +5271,210 @@ internal X64() { } /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(byte* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(short* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_si512 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_epi32 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(int* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_epi32 (void * mem_addr, __m512i a) /// VMOVDQU32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(uint* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_epi64 (void * mem_addr, __m512i a) /// VMOVDQU64 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(long* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_epi64 (void * mem_addr, __m512i a) /// VMOVDQU64 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_ps (float * mem_addr, __m512 a) /// VMOVUPS m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(float* address, Vector512 source) => Store(address, source); + /// /// void _mm512_storeu_pd (double * mem_addr, __m512d a) /// VMOVUPD m512, zmm1 /// + [RequiresUnsafe] public static unsafe void Store(double* address, Vector512 source) => Store(address, source); /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(byte* address, Vector512 source) => StoreAligned(address, source); + /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(sbyte* address, Vector512 source) => StoreAligned(address, source); + /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(short* address, Vector512 source) => StoreAligned(address, source); + /// /// void _mm512_store_si512 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(ushort* address, Vector512 source) => StoreAligned(address, source); + /// /// void _mm512_store_epi32 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(int* address, Vector512 source) => StoreAligned(address, source); + /// /// void _mm512_store_epi32 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(uint* address, Vector512 source) => StoreAligned(address, source); + /// /// void _mm512_store_epi64 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(long* address, Vector512 source) => StoreAligned(address, source); + /// /// void _mm512_store_epi64 (void * mem_addr, __m512i a) /// VMOVDQA32 m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(ulong* address, Vector512 source) => StoreAligned(address, source); + /// /// void _mm512_store_ps (float * mem_addr, __m512 a) /// VMOVAPS m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(float* address, Vector512 source) => StoreAligned(address, source); + /// /// void _mm512_store_pd (double * mem_addr, __m512d a) /// VMOVAPD m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(double* address, Vector512 source) => StoreAligned(address, source); /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(sbyte* address, Vector512 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(byte* address, Vector512 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(short* address, Vector512 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ushort* address, Vector512 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(int* address, Vector512 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(uint* address, Vector512 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(long* address, Vector512 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm512_stream_si512 (void * mem_addr, __m512i a) /// VMOVNTDQ m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ulong* address, Vector512 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm512_stream_ps (float * mem_addr, __m512 a) /// VMOVNTPS m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(float* address, Vector512 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm512_stream_pd (double * mem_addr, __m512d a) /// VMOVNTPD m512, zmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(double* address, Vector512 source) => StoreAlignedNonTemporal(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.cs index 032c9011357d86..57db4a9eba90f0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512Vbmi2.cs @@ -77,42 +77,56 @@ internal VL() { } /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi8 (void * s, __mmask16 k, __m128i a) /// VPCOMPRESSB m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); + /// /// __m128i _mm_mask_compressstoreu_epi16 (void * s, __mmask8 k, __m128i a) /// VPCOMPRESSW m128 {k1}{z}, xmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector128 mask, Vector128 source) => CompressStore(address, mask, source); /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi8 (void * s, __mmask32 k, __m256i a) /// VPCOMPRESSB m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); + /// /// void _mm256_mask_compressstoreu_epi16 (void * s, __mmask16 k, __m256i a) /// VPCOMPRESSW m256 {k1}{z}, ymm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector256 mask, Vector256 source) => CompressStore(address, mask, source); /// @@ -162,24 +176,31 @@ internal VL() { } /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(byte* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi16 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(short* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi8 (__m128i s, __mmask16 k, void const * a) /// VPEXPANDB xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(sbyte* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); + /// /// __m128i _mm_mask_expandloadu_epi16 (__m128i s, __mmask8 k, void const * a) /// VPEXPANDW xmm1 {k1}{z}, m128 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector128 ExpandLoad(ushort* address, Vector128 mask, Vector128 merge) => ExpandLoad(address, mask, merge); /// @@ -187,24 +208,31 @@ internal VL() { } /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(byte* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_mask_expandloadu_epi16 (__m256i s, __mmask16 k, void const * a) /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(short* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_mask_expandloadu_epi8 (__m256i s, __mmask32 k, void const * a) /// VPEXPANDB ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(sbyte* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); + /// /// __m256i _mm256_mask_expandloadu_epi16 (__m256i s, __mmask16 k, void const * a) /// VPEXPANDW ymm1 {k1}{z}, m256 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector256 ExpandLoad(ushort* address, Vector256 mask, Vector256 merge) => ExpandLoad(address, mask, merge); } @@ -245,21 +273,28 @@ internal X64() { } /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(byte* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(short* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// __m512i _mm512_mask_compresstoreu_epi8 (void * s, __mmask64 k, __m512i a) /// VPCOMPRESSB m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(sbyte* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); + /// /// __m512i _mm512_mask_compresstoreu_epi16 (void * s, __mmask32 k, __m512i a) /// VPCOMPRESSW m512 {k1}{z}, zmm2 /// + [RequiresUnsafe] public static unsafe void CompressStore(ushort* address, Vector512 mask, Vector512 source) => CompressStore(address, mask, source); /// @@ -288,24 +323,31 @@ internal X64() { } /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(byte* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi16 (__m512i s, __mmask32 k, void * const a) /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(short* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi8 (__m512i s, __mmask64 k, void * const a) /// VPEXPANDB zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(sbyte* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); + /// /// __m512i _mm512_mask_expandloadu_epi16 (__m512i s, __mmask32 k, void * const a) /// VPEXPANDW zmm1 {k1}{z}, m512 /// /// The native and managed intrinsics have different order of parameters. + [RequiresUnsafe] public static unsafe Vector512 ExpandLoad(ushort* address, Vector512 mask, Vector512 merge) => ExpandLoad(address, mask, merge); } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs index 9178a6e0a8f2a5..311e6cefeed75b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Bmi2.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Runtime.Intrinsics.X86 @@ -49,6 +50,7 @@ internal X64() { } /// The above native signature does not directly correspond to the managed signature. /// This intrinsic is only available on 64-bit processes /// + [RequiresUnsafe] public static unsafe ulong MultiplyNoFlags(ulong left, ulong right, ulong* low) => MultiplyNoFlags(left, right, low); /// @@ -84,6 +86,7 @@ internal X64() { } /// MULX r32a, r32b, r/m32 /// The above native signature does not directly correspond to the managed signature. /// + [RequiresUnsafe] public static unsafe uint MultiplyNoFlags(uint left, uint right, uint* low) => MultiplyNoFlags(left, right, low); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.cs index e6f349afd202ef..4bc3349964f3a1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse.cs @@ -359,32 +359,41 @@ internal X64() { } /// VMOVAPS xmm1, m128 /// VMOVAPS xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(float* address) => LoadAlignedVector128(address); + /// /// __m128 _mm_loadh_pi (__m128 a, __m64 const* mem_addr) /// MOVHPS xmm1, m64 /// VMOVHPS xmm1, xmm2, m64 /// + [RequiresUnsafe] public static unsafe Vector128 LoadHigh(Vector128 lower, float* address) => LoadHigh(lower, address); + /// /// __m128 _mm_loadl_pi (__m128 a, __m64 const* mem_addr) /// MOVLPS xmm1, m64 /// VMOVLPS xmm1, xmm2, m64 /// + [RequiresUnsafe] public static unsafe Vector128 LoadLow(Vector128 upper, float* address) => LoadLow(upper, address); + /// /// __m128 _mm_load_ss (float const* mem_address) /// MOVSS xmm1, m32 /// VMOVSS xmm1, m32 /// VMOVSS xmm1 {k1}, m32 /// + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(float* address) => LoadScalarVector128(address); + /// /// __m128 _mm_loadu_ps (float const* mem_address) /// MOVUPS xmm1, m128 /// VMOVUPS xmm1, m128 /// VMOVUPS xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(float* address) => LoadVector128(address); /// @@ -470,21 +479,28 @@ internal X64() { } /// void _mm_prefetch(char* p, int i) /// PREFETCHT0 m8 /// + [RequiresUnsafe] public static unsafe void Prefetch0(void* address) => Prefetch0(address); + /// /// void _mm_prefetch(char* p, int i) /// PREFETCHT1 m8 /// + [RequiresUnsafe] public static unsafe void Prefetch1(void* address) => Prefetch1(address); + /// /// void _mm_prefetch(char* p, int i) /// PREFETCHT2 m8 /// + [RequiresUnsafe] public static unsafe void Prefetch2(void* address) => Prefetch2(address); + /// /// void _mm_prefetch(char* p, int i) /// PREFETCHNTA m8 /// + [RequiresUnsafe] public static unsafe void PrefetchNonTemporal(void* address) => PrefetchNonTemporal(address); /// @@ -567,43 +583,54 @@ internal X64() { } /// VMOVAPS m128, xmm1 /// VMOVAPS m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(float* address, Vector128 source) => Store(address, source); + /// /// void _mm_store_ps (float* mem_addr, __m128 a) /// MOVAPS m128, xmm1 /// VMOVAPS m128, xmm1 /// VMOVAPS m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(float* address, Vector128 source) => StoreAligned(address, source); + /// /// void _mm_stream_ps (float* mem_addr, __m128 a) /// MOVNTPS m128, xmm1 /// VMOVNTPS m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(float* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// /// void _mm_sfence(void) /// SFENCE /// public static void StoreFence() => StoreFence(); + /// /// void _mm_storeh_pi (__m64* mem_addr, __m128 a) /// MOVHPS m64, xmm1 /// VMOVHPS m64, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreHigh(float* address, Vector128 source) => StoreHigh(address, source); + /// /// void _mm_storel_pi (__m64* mem_addr, __m128 a) /// MOVLPS m64, xmm1 /// VMOVLPS m64, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreLow(float* address, Vector128 source) => StoreLow(address, source); + /// /// void _mm_store_ss (float* mem_addr, __m128 a) /// MOVSS m32, xmm1 /// VMOVSS m32, xmm1 /// VMOVSS m32 {k1}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreScalar(float* address, Vector128 source) => StoreScalar(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs index 5fba62f5f1678a..eb9319f94ced26 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse2.cs @@ -85,12 +85,15 @@ internal X64() { } /// MOVNTI m64, r64 /// This intrinsic is only available on 64-bit processes /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(long* address, long value) => StoreNonTemporal(address, value); + /// /// void _mm_stream_si64(__int64 *p, __int64 a) /// MOVNTI m64, r64 /// This intrinsic is only available on 64-bit processes /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(ulong* address, ulong value) => StoreNonTemporal(address, value); } @@ -793,62 +796,79 @@ internal X64() { } /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(sbyte* address) => LoadAlignedVector128(address); + /// /// __m128i _mm_load_si128 (__m128i const* mem_address) /// MOVDQA xmm1, m128 /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(byte* address) => LoadAlignedVector128(address); + /// /// __m128i _mm_load_si128 (__m128i const* mem_address) /// MOVDQA xmm1, m128 /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(short* address) => LoadAlignedVector128(address); + /// /// __m128i _mm_load_si128 (__m128i const* mem_address) /// MOVDQA xmm1, m128 /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(ushort* address) => LoadAlignedVector128(address); + /// /// __m128i _mm_load_si128 (__m128i const* mem_address) /// MOVDQA xmm1, m128 /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(int* address) => LoadAlignedVector128(address); + /// /// __m128i _mm_load_si128 (__m128i const* mem_address) /// MOVDQA xmm1, m128 /// VMOVDQA xmm1, m128 /// VMOVDQA32 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(uint* address) => LoadAlignedVector128(address); + /// /// __m128i _mm_load_si128 (__m128i const* mem_address) /// MOVDQA xmm1, m128 /// VMOVDQA xmm1, m128 /// VMOVDQA64 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(long* address) => LoadAlignedVector128(address); + /// /// __m128i _mm_load_si128 (__m128i const* mem_address) /// MOVDQA xmm1, m128 /// VMOVDQA xmm1, m128 /// VMOVDQA64 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(ulong* address) => LoadAlignedVector128(address); + /// /// __m128d _mm_load_pd (double const* mem_address) /// MOVAPD xmm1, m128 /// VMOVAPD xmm1, m128 /// VMOVAPD xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128(double* address) => LoadAlignedVector128(address); /// @@ -856,17 +876,21 @@ internal X64() { } /// LFENCE /// public static void LoadFence() => LoadFence(); + /// /// __m128d _mm_loadh_pd (__m128d a, double const* mem_addr) /// MOVHPD xmm1, m64 /// VMOVHPD xmm1, xmm2, m64 /// + [RequiresUnsafe] public static unsafe Vector128 LoadHigh(Vector128 lower, double* address) => LoadHigh(lower, address); + /// /// __m128d _mm_loadl_pd (__m128d a, double const* mem_addr) /// MOVLPD xmm1, m64 /// VMOVLPD xmm1, xmm2, m64 /// + [RequiresUnsafe] public static unsafe Vector128 LoadLow(Vector128 upper, double* address) => LoadLow(upper, address); /// @@ -874,31 +898,40 @@ internal X64() { } /// MOVD xmm1, m32 /// VMOVD xmm1, m32 /// + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(int* address) => LoadScalarVector128(address); + /// /// __m128i _mm_loadu_si32 (void const* mem_addr) /// MOVD xmm1, m32 /// VMOVD xmm1, m32 /// + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(uint* address) => LoadScalarVector128(address); + /// /// __m128i _mm_loadl_epi64 (__m128i const* mem_addr) /// MOVQ xmm1, m64 /// VMOVQ xmm1, m64 /// + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(long* address) => LoadScalarVector128(address); + /// /// __m128i _mm_loadl_epi64 (__m128i const* mem_addr) /// MOVQ xmm1, m64 /// VMOVQ xmm1, m64 /// + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(ulong* address) => LoadScalarVector128(address); + /// /// __m128d _mm_load_sd (double const* mem_address) /// MOVSD xmm1, m64 /// VMOVSD xmm1, m64 /// VMOVSD xmm1 {k1}, m64 /// + [RequiresUnsafe] public static unsafe Vector128 LoadScalarVector128(double* address) => LoadScalarVector128(address); /// @@ -907,62 +940,79 @@ internal X64() { } /// VMOVDQU xmm1, m128 /// VMOVDQU8 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(sbyte* address) => LoadVector128(address); + /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) /// MOVDQU xmm1, m128 /// VMOVDQU xmm1, m128 /// VMOVDQU8 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(byte* address) => LoadVector128(address); + /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) /// MOVDQU xmm1, m128 /// VMOVDQU xmm1, m128 /// VMOVDQU16 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(short* address) => LoadVector128(address); + /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) /// MOVDQU xmm1, m128 /// VMOVDQU xmm1, m128 /// VMOVDQU16 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ushort* address) => LoadVector128(address); + /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) /// MOVDQU xmm1, m128 /// VMOVDQU xmm1, m128 /// VMOVDQU32 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(int* address) => LoadVector128(address); + /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) /// MOVDQU xmm1, m128 /// VMOVDQU xmm1, m128 /// VMOVDQU32 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(uint* address) => LoadVector128(address); + /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) /// MOVDQU xmm1, m128 /// VMOVDQU xmm1, m128 /// VMOVDQU64 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(long* address) => LoadVector128(address); + /// /// __m128i _mm_loadu_si128 (__m128i const* mem_address) /// MOVDQU xmm1, m128 /// VMOVDQU xmm1, m128 /// VMOVDQU64 xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(ulong* address) => LoadVector128(address); + /// /// __m128d _mm_loadu_pd (double const* mem_address) /// MOVUPD xmm1, m128 /// VMOVUPD xmm1, m128 /// VMOVUPD xmm1 {k1}{z}, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadVector128(double* address) => LoadVector128(address); /// @@ -970,12 +1020,15 @@ internal X64() { } /// MASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// VMASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// + [RequiresUnsafe] public static unsafe void MaskMove(Vector128 source, Vector128 mask, sbyte* address) => MaskMove(source, mask, address); + /// /// void _mm_maskmoveu_si128 (__m128i a, __m128i mask, char* mem_address) /// MASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// VMASKMOVDQU xmm1, xmm2 ; Address: EDI/RDI /// + [RequiresUnsafe] public static unsafe void MaskMove(Vector128 source, Vector128 mask, byte* address) => MaskMove(source, mask, address); /// @@ -1618,62 +1671,79 @@ internal X64() { } /// VMOVDQU m128, xmm1 /// VMOVDQU8 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(sbyte* address, Vector128 source) => Store(address, source); + /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) /// MOVDQU m128, xmm1 /// VMOVDQU m128, xmm1 /// VMOVDQU8 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(byte* address, Vector128 source) => Store(address, source); + /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) /// MOVDQU m128, xmm1 /// VMOVDQU m128, xmm1 /// VMOVDQU16 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(short* address, Vector128 source) => Store(address, source); + /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) /// MOVDQU m128, xmm1 /// VMOVDQU m128, xmm1 /// VMOVDQU16 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(ushort* address, Vector128 source) => Store(address, source); + /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) /// MOVDQU m128, xmm1 /// VMOVDQU m128, xmm1 /// VMOVDQU32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(int* address, Vector128 source) => Store(address, source); + /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) /// MOVDQU m128, xmm1 /// VMOVDQU m128, xmm1 /// VMOVDQU32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(uint* address, Vector128 source) => Store(address, source); + /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) /// MOVDQU m128, xmm1 /// VMOVDQU m128, xmm1 /// VMOVDQU64 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(long* address, Vector128 source) => Store(address, source); + /// /// void _mm_storeu_si128 (__m128i* mem_addr, __m128i a) /// MOVDQU m128, xmm1 /// VMOVDQU m128, xmm1 /// VMOVDQU64 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(ulong* address, Vector128 source) => Store(address, source); + /// /// void _mm_storeu_pd (double* mem_addr, __m128d a) /// MOVUPD m128, xmm1 /// VMOVUPD m128, xmm1 /// VMOVUPD m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void Store(double* address, Vector128 source) => Store(address, source); /// @@ -1682,62 +1752,79 @@ internal X64() { } /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(sbyte* address, Vector128 source) => StoreAligned(address, source); + /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) /// MOVDQA m128, xmm1 /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(byte* address, Vector128 source) => StoreAligned(address, source); + /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) /// MOVDQA m128, xmm1 /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(short* address, Vector128 source) => StoreAligned(address, source); + /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) /// MOVDQA m128, xmm1 /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(ushort* address, Vector128 source) => StoreAligned(address, source); + /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) /// MOVDQA m128, xmm1 /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(int* address, Vector128 source) => StoreAligned(address, source); + /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) /// MOVDQA m128, xmm1 /// VMOVDQA m128, xmm1 /// VMOVDQA32 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(uint* address, Vector128 source) => StoreAligned(address, source); + /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) /// MOVDQA m128, xmm1 /// VMOVDQA m128, xmm1 /// VMOVDQA64 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(long* address, Vector128 source) => StoreAligned(address, source); + /// /// void _mm_store_si128 (__m128i* mem_addr, __m128i a) /// MOVDQA m128, xmm1 /// VMOVDQA m128, xmm1 /// VMOVDQA64 m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(ulong* address, Vector128 source) => StoreAligned(address, source); + /// /// void _mm_store_pd (double* mem_addr, __m128d a) /// MOVAPD m128, xmm1 /// VMOVAPD m128, xmm1 /// VMOVAPD m128 {k1}{z}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAligned(double* address, Vector128 source) => StoreAligned(address, source); /// @@ -1745,54 +1832,71 @@ internal X64() { } /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(sbyte* address, Vector128 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(byte* address, Vector128 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(short* address, Vector128 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ushort* address, Vector128 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(int* address, Vector128 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(uint* address, Vector128 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(long* address, Vector128 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm_stream_si128 (__m128i* mem_addr, __m128i a) /// MOVNTDQ m128, xmm1 /// VMOVNTDQ m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(ulong* address, Vector128 source) => StoreAlignedNonTemporal(address, source); + /// /// void _mm_stream_pd (double* mem_addr, __m128d a) /// MOVNTPD m128, xmm1 /// VMOVNTPD m128, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreAlignedNonTemporal(double* address, Vector128 source) => StoreAlignedNonTemporal(address, source); /// @@ -1800,23 +1904,29 @@ internal X64() { } /// MOVHPD m64, xmm1 /// VMOVHPD m64, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreHigh(double* address, Vector128 source) => StoreHigh(address, source); + /// /// void _mm_storel_pd (double* mem_addr, __m128d a) /// MOVLPD m64, xmm1 /// VMOVLPD m64, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreLow(double* address, Vector128 source) => StoreLow(address, source); /// /// void _mm_stream_si32(int *p, int a) /// MOVNTI m32, r32 /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(int* address, int value) => StoreNonTemporal(address, value); + /// /// void _mm_stream_si32(int *p, int a) /// MOVNTI m32, r32 /// + [RequiresUnsafe] public static unsafe void StoreNonTemporal(uint* address, uint value) => StoreNonTemporal(address, value); /// @@ -1824,31 +1934,40 @@ internal X64() { } /// MOVD m32, xmm1 /// VMOVD m32, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreScalar(int* address, Vector128 source) => StoreScalar(address, source); + /// /// void _mm_storeu_si32 (void* mem_addr, __m128i a) /// MOVD m32, xmm1 /// VMOVD m32, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreScalar(uint* address, Vector128 source) => StoreScalar(address, source); + /// /// void _mm_storel_epi64 (__m128i* mem_addr, __m128i a) /// MOVQ m64, xmm1 /// VMOVQ m64, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreScalar(long* address, Vector128 source) => StoreScalar(address, source); + /// /// void _mm_storel_epi64 (__m128i* mem_addr, __m128i a) /// MOVQ m64, xmm1 /// VMOVQ m64, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreScalar(ulong* address, Vector128 source) => StoreScalar(address, source); + /// /// void _mm_store_sd (double* mem_addr, __m128d a) /// MOVSD m64, xmm1 /// VMOVSD m64, xmm1 /// VMOVSD m64 {k1}, xmm1 /// + [RequiresUnsafe] public static unsafe void StoreScalar(double* address, Vector128 source) => StoreScalar(address, source); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.cs index bf14096e90ba60..3e494c57e843cf 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse3.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Runtime.Intrinsics.X86 @@ -74,6 +75,7 @@ internal X64() { } /// VMOVDDUP xmm1, m64 /// VMOVDDUP xmm1 {k1}{z}, m64 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAndDuplicateToVector128(double* address) => LoadAndDuplicateToVector128(address); /// @@ -81,48 +83,63 @@ internal X64() { } /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(sbyte* address) => LoadDquVector128(address); + /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(byte* address) => LoadDquVector128(address); + /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(short* address) => LoadDquVector128(address); + /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(ushort* address) => LoadDquVector128(address); + /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(int* address) => LoadDquVector128(address); + /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(uint* address) => LoadDquVector128(address); + /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(long* address) => LoadDquVector128(address); + /// /// __m128i _mm_lddqu_si128 (__m128i const* mem_addr) /// LDDQU xmm1, m128 /// VLDDQU xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadDquVector128(ulong* address) => LoadDquVector128(address); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.cs index fa05c404fa6d2e..8d438194e37b59 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Sse41.cs @@ -296,83 +296,106 @@ internal X64() { } /// VPMOVSXBW xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int16(sbyte* address) => ConvertToVector128Int16(address); + /// /// PMOVZXBW xmm1, m64 /// VPMOVZXBW xmm1, m64 /// VPMOVZXBW xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int16(byte* address) => ConvertToVector128Int16(address); + /// /// PMOVSXBD xmm1, m32 /// VPMOVSXBD xmm1, m32 /// VPMOVSXBD xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(sbyte* address) => ConvertToVector128Int32(address); + /// /// PMOVZXBD xmm1, m32 /// VPMOVZXBD xmm1, m32 /// VPMOVZXBD xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(byte* address) => ConvertToVector128Int32(address); + /// /// PMOVSXWD xmm1, m64 /// VPMOVSXWD xmm1, m64 /// VPMOVSXWD xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(short* address) => ConvertToVector128Int32(address); + /// /// PMOVZXWD xmm1, m64 /// VPMOVZXWD xmm1, m64 /// VPMOVZXWD xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int32(ushort* address) => ConvertToVector128Int32(address); + /// /// PMOVSXBQ xmm1, m16 /// VPMOVSXBQ xmm1, m16 /// VPMOVSXBQ xmm1 {k1}{z}, m16 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(sbyte* address) => ConvertToVector128Int64(address); + /// /// PMOVZXBQ xmm1, m16 /// VPMOVZXBQ xmm1, m16 /// VPMOVZXBQ xmm1 {k1}{z}, m16 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(byte* address) => ConvertToVector128Int64(address); + /// /// PMOVSXWQ xmm1, m32 /// VPMOVSXWQ xmm1, m32 /// VPMOVSXWQ xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(short* address) => ConvertToVector128Int64(address); + /// /// PMOVZXWQ xmm1, m32 /// VPMOVZXWQ xmm1, m32 /// VPMOVZXWQ xmm1 {k1}{z}, m32 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(ushort* address) => ConvertToVector128Int64(address); + /// /// PMOVSXDQ xmm1, m64 /// VPMOVSXDQ xmm1, m64 /// VPMOVSXDQ xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(int* address) => ConvertToVector128Int64(address); + /// /// PMOVZXDQ xmm1, m64 /// VPMOVZXDQ xmm1, m64 /// VPMOVZXDQ xmm1 {k1}{z}, m64 /// The native signature does not exist. We provide this additional overload for completeness. /// + [RequiresUnsafe] public static unsafe Vector128 ConvertToVector128Int64(uint* address) => ConvertToVector128Int64(address); /// @@ -489,48 +512,63 @@ internal X64() { } /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(sbyte* address) => LoadAlignedVector128NonTemporal(address); + /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(byte* address) => LoadAlignedVector128NonTemporal(address); + /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(short* address) => LoadAlignedVector128NonTemporal(address); + /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(ushort* address) => LoadAlignedVector128NonTemporal(address); + /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(int* address) => LoadAlignedVector128NonTemporal(address); + /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(uint* address) => LoadAlignedVector128NonTemporal(address); + /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(long* address) => LoadAlignedVector128NonTemporal(address); + /// /// __m128i _mm_stream_load_si128 (const __m128i* mem_addr) /// MOVNTDQA xmm1, m128 /// VMOVNTDQA xmm1, m128 /// + [RequiresUnsafe] public static unsafe Vector128 LoadAlignedVector128NonTemporal(ulong* address) => LoadAlignedVector128NonTemporal(address); /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.cs index b73e804f70c36b..4136d73dec770b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/X86Base.cs @@ -106,6 +106,7 @@ public static unsafe (int Eax, int Ebx, int Ecx, int Edx) CpuId(int functionId, private static extern unsafe void CpuId(int* cpuInfo, int functionId, int subFunctionId); #else [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "X86Base_CpuId")] + [RequiresUnsafe] private static unsafe partial void CpuId(int* cpuInfo, int functionId, int subFunctionId); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs index 0bd7bd3d6ea866..7fd30e30c6810f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs @@ -740,6 +740,7 @@ internal static void InvokeAssemblyLoadEvent(Assembly assembly) // These methods provide efficient reverse P/Invoke entry points for the VM. [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void OnAssemblyLoad(RuntimeAssembly* pAssembly, Exception* pException) { try @@ -753,6 +754,7 @@ private static unsafe void OnAssemblyLoad(RuntimeAssembly* pAssembly, Exception* } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void OnTypeResolve(RuntimeAssembly* pAssembly, byte* typeName, RuntimeAssembly* ppResult, Exception* pException) { try @@ -767,6 +769,7 @@ private static unsafe void OnTypeResolve(RuntimeAssembly* pAssembly, byte* typeN } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void OnResourceResolve(RuntimeAssembly* pAssembly, byte* resourceName, RuntimeAssembly* ppResult, Exception* pException) { try @@ -781,6 +784,7 @@ private static unsafe void OnResourceResolve(RuntimeAssembly* pAssembly, byte* r } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void OnAssemblyResolve(RuntimeAssembly* pAssembly, char* assemblyFullName, RuntimeAssembly* ppResult, Exception* pException) { try @@ -794,6 +798,7 @@ private static unsafe void OnAssemblyResolve(RuntimeAssembly* pAssembly, char* a } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void Resolve(IntPtr gchAssemblyLoadContext, AssemblyName* pAssemblyName, Assembly* ppResult, Exception* pException) { try @@ -808,6 +813,7 @@ private static unsafe void Resolve(IntPtr gchAssemblyLoadContext, AssemblyName* } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void ResolveSatelliteAssembly(IntPtr gchAssemblyLoadContext, AssemblyName* pAssemblyName, Assembly* ppResult, Exception* pException) { try @@ -822,6 +828,7 @@ private static unsafe void ResolveSatelliteAssembly(IntPtr gchAssemblyLoadContex } [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void ResolveUsingEvent(IntPtr gchAssemblyLoadContext, AssemblyName* pAssemblyName, Assembly* ppResult, Exception* pException) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/SearchValues/IndexOfAnyAsciiSearcher.cs b/src/libraries/System.Private.CoreLib/src/System/SearchValues/IndexOfAnyAsciiSearcher.cs index 3e716c7e22e6d2..5d7a7caa440ac6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SearchValues/IndexOfAnyAsciiSearcher.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SearchValues/IndexOfAnyAsciiSearcher.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; @@ -33,6 +34,7 @@ public readonly struct AnyByteState(Vector128 bitmap0, Vector128 bit internal static bool IsVectorizationSupported => Ssse3.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported; [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe void SetBitmapBit(byte* bitmap, int value) { Debug.Assert((uint)value <= 127); @@ -169,6 +171,7 @@ public static void ComputeUniqueLowNibbleState(ReadOnlySpan values, out As } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe bool TryComputeBitmap(ReadOnlySpan values, byte* bitmap, out bool needleContainsZero) { byte* bitmapLocal = bitmap; // https://github.com/dotnet/runtime/issues/9040 diff --git a/src/libraries/System.Private.CoreLib/src/System/SearchValues/ProbabilisticMapState.cs b/src/libraries/System.Private.CoreLib/src/System/SearchValues/ProbabilisticMapState.cs index 9d3f5bdab68e0d..934f34ecceb7c4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SearchValues/ProbabilisticMapState.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SearchValues/ProbabilisticMapState.cs @@ -52,6 +52,7 @@ public ProbabilisticMapState(ReadOnlySpan values, int maxInclusive) } // valuesPtr must remain valid for as long as this ProbabilisticMapState is used. + [RequiresUnsafe] public ProbabilisticMapState(ReadOnlySpan* valuesPtr) { Debug.Assert((IntPtr)valuesPtr != IntPtr.Zero); diff --git a/src/libraries/System.Private.CoreLib/src/System/Security/SecureString.cs b/src/libraries/System.Private.CoreLib/src/System/Security/SecureString.cs index 65ff3788b06d6d..ffdd9402ffe5ac 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Security/SecureString.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Security/SecureString.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Threading; @@ -22,6 +23,7 @@ public SecureString() } [CLSCompliant(false)] + [RequiresUnsafe] public unsafe SecureString(char* value, int length) { ArgumentNullException.ThrowIfNull(value); diff --git a/src/libraries/System.Private.CoreLib/src/System/Span.cs b/src/libraries/System.Private.CoreLib/src/System/Span.cs index 6a41ca242784be..399e82f5a541cb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Span.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Span.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.InteropServices.Marshalling; @@ -105,6 +106,7 @@ public Span(T[]? array, int start, int length) /// [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public unsafe Span(void* pointer, int length) { if (RuntimeHelpers.IsReferenceOrContainsReferences()) diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs index 31f9ba48151b8c..e7194f4098ed50 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Byte.cs @@ -450,6 +450,7 @@ private static void ThrowMustBeNullTerminatedString() // IndexOfNullByte processes memory in aligned chunks, and thus it won't crash even if it accesses memory beyond the null terminator. // This behavior is an implementation detail of the runtime and callers outside System.Private.CoreLib must not depend on it. + [RequiresUnsafe] internal static unsafe int IndexOfNullByte(byte* searchSpace) { const int Length = int.MaxValue; diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs index 600a76e4b3f789..1a40b32c6d0ca0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.ByteMemOps.cs @@ -7,6 +7,7 @@ #endif using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -261,6 +262,7 @@ private static unsafe void MemmoveNative(ref byte dest, ref byte src, nuint len) #pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "memmove")] [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [RequiresUnsafe] private static unsafe partial void* memmove(void* dest, void* src, nuint len); #pragma warning restore CS3016 #endif @@ -484,6 +486,7 @@ private static unsafe void ZeroMemoryNative(ref byte b, nuint byteLength) #pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "memset")] [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [RequiresUnsafe] private static unsafe partial void* memset(void* dest, int value, nuint len); #pragma warning restore CS3016 #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs index 9cbeccb2f88de1..a2b5ff8456c87f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.Char.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; @@ -528,6 +529,7 @@ public static unsafe int SequenceCompareTo(ref char first, int firstLength, ref // IndexOfNullCharacter processes memory in aligned chunks, and thus it won't crash even if it accesses memory beyond the null terminator. // This behavior is an implementation detail of the runtime and callers outside System.Private.CoreLib must not depend on it. + [RequiresUnsafe] public static unsafe int IndexOfNullCharacter(char* searchSpace) { const char value = '\0'; diff --git a/src/libraries/System.Private.CoreLib/src/System/StartupHookProvider.cs b/src/libraries/System.Private.CoreLib/src/System/StartupHookProvider.cs index 5d56c15849c1c4..83360801a6dc08 100644 --- a/src/libraries/System.Private.CoreLib/src/System/StartupHookProvider.cs +++ b/src/libraries/System.Private.CoreLib/src/System/StartupHookProvider.cs @@ -71,6 +71,7 @@ private static void ProcessStartupHooks(string diagnosticStartupHooks) // and call the hook. [UnconditionalSuppressMessageAttribute("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode", Justification = "An ILLink warning when trimming an app with System.StartupHookProvider.IsSupported=true already exists for ProcessStartupHooks.")] + [RequiresUnsafe] private static unsafe void CallStartupHook(char* pStartupHookPart) { if (!IsSupported) @@ -87,6 +88,7 @@ private static unsafe void CallStartupHook(char* pStartupHookPart) #if CORECLR [UnmanagedCallersOnly] + [RequiresUnsafe] private static unsafe void CallStartupHook(char* pStartupHookPart, Exception* pException) { try diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs index d9d03cf0666b54..343cf7bc9734d8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs @@ -2662,6 +2662,7 @@ private string TrimWhiteSpaceHelper(TrimType trimType) return CreateTrimmedString(start, end); } + [RequiresUnsafe] private unsafe string TrimHelper(char* trimChars, int trimCharsLength, TrimType trimType) { Debug.Assert(trimChars != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/String.cs b/src/libraries/System.Private.CoreLib/src/System/String.cs index 234f5e61529ad2..8121cab2050dfc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.cs @@ -116,11 +116,13 @@ private static string Ctor(char[] value, int startIndex, int length) [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.Char*)")] #endif public extern unsafe String(char* value); + [RequiresUnsafe] private static unsafe string Ctor(char* ptr) { if (ptr == null) @@ -142,11 +144,13 @@ private static unsafe string Ctor(char* ptr) [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.Char*,System.Int32,System.Int32)")] #endif public extern unsafe String(char* value, int startIndex, int length); + [RequiresUnsafe] private static unsafe string Ctor(char* ptr, int startIndex, int length) { ArgumentOutOfRangeException.ThrowIfNegative(length); @@ -176,11 +180,13 @@ private static unsafe string Ctor(char* ptr, int startIndex, int length) [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.SByte*)")] #endif public extern unsafe String(sbyte* value); + [RequiresUnsafe] private static unsafe string Ctor(sbyte* value) { byte* pb = (byte*)value; @@ -194,11 +200,13 @@ private static unsafe string Ctor(sbyte* value) [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.SByte*,System.Int32,System.Int32)")] #endif public extern unsafe String(sbyte* value, int startIndex, int length); + [RequiresUnsafe] private static unsafe string Ctor(sbyte* value, int startIndex, int length) { ArgumentOutOfRangeException.ThrowIfNegative(startIndex); @@ -222,6 +230,7 @@ private static unsafe string Ctor(sbyte* value, int startIndex, int length) } // Encoder for String..ctor(sbyte*) and String..ctor(sbyte*, int, int) + [RequiresUnsafe] private static unsafe string CreateStringForSByteConstructor(byte* pb, int numBytes) { Debug.Assert(numBytes >= 0); @@ -250,11 +259,13 @@ private static unsafe string CreateStringForSByteConstructor(byte* pb, int numBy [CLSCompliant(false)] [MethodImpl(MethodImplOptions.InternalCall)] + [RequiresUnsafe] #if MONO [DynamicDependency("Ctor(System.SByte*,System.Int32,System.Int32,System.Text.Encoding)")] #endif public extern unsafe String(sbyte* value, int startIndex, int length, Encoding enc); + [RequiresUnsafe] private static unsafe string Ctor(sbyte* value, int startIndex, int length, Encoding? enc) { if (enc == null) @@ -530,6 +541,7 @@ public static bool IsNullOrWhiteSpace([NotNullWhen(false)] string? value) // Helper for encodings so they can talk to our buffer directly // stringLength must be the exact size we'll expect + [RequiresUnsafe] internal static unsafe string CreateStringFromEncoding( byte* bytes, int byteLength, Encoding encoding) { @@ -612,8 +624,10 @@ public StringRuneEnumerator EnumerateRunes() return new StringRuneEnumerator(this); } + [RequiresUnsafe] internal static unsafe int wcslen(char* ptr) => SpanHelpers.IndexOfNullCharacter(ptr); + [RequiresUnsafe] internal static unsafe int strlen(byte* ptr) => SpanHelpers.IndexOfNullByte(ptr); // diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIEncoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIEncoding.cs index c33c8fd9090514..dbc7404a44aca8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIEncoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/ASCIIEncoding.cs @@ -4,6 +4,7 @@ using System.Buffers; using System.Buffers.Text; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -122,6 +123,7 @@ public override unsafe int GetByteCount(string chars) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { if (chars is null) @@ -148,6 +150,7 @@ public override unsafe int GetByteCount(ReadOnlySpan chars) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetByteCountCommon(char* pChars, int charCount) { // Common helper method for all non-EncoderNLS entry points to GetByteCount. @@ -177,6 +180,7 @@ private unsafe int GetByteCountCommon(char* pChars, int charCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetByteCountCommon + [RequiresUnsafe] private protected sealed override unsafe int GetByteCountFast(char* pChars, int charsLength, EncoderFallback? fallback, out int charsConsumed) { // First: Can we short-circuit the entire calculation? @@ -292,6 +296,7 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { if (chars is null || bytes is null) @@ -341,6 +346,7 @@ public override unsafe bool TryGetBytes(ReadOnlySpan chars, Span byt } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int byteCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-EncoderNLS entry points to GetBytes. @@ -370,6 +376,7 @@ private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetBytesCommon + [RequiresUnsafe] private protected sealed override unsafe int GetBytesFast(char* pChars, int charsLength, byte* pBytes, int bytesLength, out int charsConsumed) { int bytesWritten = (int)Ascii.NarrowUtf16ToAscii(pChars, pBytes, (uint)Math.Min(charsLength, bytesLength)); @@ -464,6 +471,7 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { if (bytes is null) @@ -490,6 +498,7 @@ public override unsafe int GetCharCount(ReadOnlySpan bytes) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetCharCountCommon(byte* pBytes, int byteCount) { // Common helper method for all non-DecoderNLS entry points to GetCharCount. @@ -519,6 +528,7 @@ private unsafe int GetCharCountCommon(byte* pBytes, int byteCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharCountCommon + [RequiresUnsafe] private protected sealed override unsafe int GetCharCountFast(byte* pBytes, int bytesLength, DecoderFallback? fallback, out int bytesConsumed) { // First: Can we short-circuit the entire calculation? @@ -583,6 +593,7 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { if (bytes is null || chars is null) @@ -632,6 +643,7 @@ public override unsafe bool TryGetChars(ReadOnlySpan bytes, Span cha } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int charCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-DecoderNLS entry points to GetChars. @@ -661,6 +673,7 @@ private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharsCommon + [RequiresUnsafe] private protected sealed override unsafe int GetCharsFast(byte* pBytes, int bytesLength, char* pChars, int charsLength, out int bytesConsumed) { bytesConsumed = (int)Ascii.WidenAsciiToUtf16(pBytes, pChars, (uint)Math.Min(charsLength, bytesLength)); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.CaseConversion.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.CaseConversion.cs index 66795fcc68977e..2cda2c3971adc5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.CaseConversion.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.CaseConversion.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -203,6 +204,7 @@ private static unsafe OperationStatus ChangeCase(Span buffer, out } } + [RequiresUnsafe] private static unsafe nuint ChangeCase(TFrom* pSrc, TTo* pDest, nuint elementCount) where TFrom : unmanaged, IBinaryInteger where TTo : unmanaged, IBinaryInteger @@ -464,6 +466,7 @@ private static unsafe nuint ChangeCase(TFrom* pSrc, TTo* pD } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe void ChangeWidthAndWriteTo(Vector128 vector, TTo* pDest, nuint elementOffset) where TFrom : unmanaged where TTo : unmanaged diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs index cdec5bb675b312..d47225c229dfb9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Ascii.Utility.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; #if NET @@ -104,6 +105,7 @@ private static bool FirstCharInUInt32IsAscii(uint value) /// /// An ASCII byte is defined as 0x00 - 0x7F, inclusive. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe nuint GetIndexOfFirstNonAsciiByte(byte* pBuffer, nuint bufferLength) { // If 256/512-bit aren't supported but SSE2 is supported, use those specific intrinsics instead of @@ -126,6 +128,7 @@ internal static unsafe nuint GetIndexOfFirstNonAsciiByte(byte* pBuffer, nuint bu } } + [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonAsciiByte_Vector(byte* pBuffer, nuint bufferLength) { // Squirrel away the original buffer reference. This method works by determining the exact @@ -362,6 +365,7 @@ private static bool ContainsNonAsciiByte_AdvSimd(uint advSimdIndex) return advSimdIndex < 16; } + [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonAsciiByte_Intrinsified(byte* pBuffer, nuint bufferLength) { // JIT turns the below into constants @@ -727,6 +731,7 @@ private static unsafe nuint GetIndexOfFirstNonAsciiByte_Intrinsified(byte* pBuff /// /// An ASCII char is defined as 0x0000 - 0x007F, inclusive. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] internal static unsafe nuint GetIndexOfFirstNonAsciiChar(char* pBuffer, nuint bufferLength /* in chars */) { // If 256/512-bit aren't supported but SSE2/ASIMD is supported, use those specific intrinsics instead of @@ -749,6 +754,7 @@ internal static unsafe nuint GetIndexOfFirstNonAsciiChar(char* pBuffer, nuint bu } } + [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonAsciiChar_Vector(char* pBuffer, nuint bufferLength /* in chars */) { // Squirrel away the original buffer reference.This method works by determining the exact @@ -954,6 +960,7 @@ private static unsafe nuint GetIndexOfFirstNonAsciiChar_Vector(char* pBuffer, nu } #if NET + [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonAsciiChar_Intrinsified(char* pBuffer, nuint bufferLength /* in chars */) { // This method contains logic optimized using vector instructions for both x64 and Arm64. @@ -1342,6 +1349,7 @@ private static void NarrowTwoUtf16CharsToAsciiAndWriteToBuffer(ref byte outputBu /// or once elements have been converted. Returns the total number /// of elements that were able to be converted. /// + [RequiresUnsafe] internal static unsafe nuint NarrowUtf16ToAscii(char* pUtf16Buffer, byte* pAsciiBuffer, nuint elementCount) { nuint currentOffset = 0; @@ -1707,6 +1715,7 @@ internal static Vector512 ExtractAsciiVector(Vector512 vectorFirst } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe nuint NarrowUtf16ToAscii_Intrinsified(char* pUtf16Buffer, byte* pAsciiBuffer, nuint elementCount) { // This method contains logic optimized using vector instructions for both x64 and Arm64. @@ -1826,6 +1835,7 @@ private static unsafe nuint NarrowUtf16ToAscii_Intrinsified(char* pUtf16Buffer, } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe nuint NarrowUtf16ToAscii_Intrinsified_256(char* pUtf16Buffer, byte* pAsciiBuffer, nuint elementCount) { // This method contains logic optimized using vector instructions for x64 only. @@ -1943,6 +1953,7 @@ private static unsafe nuint NarrowUtf16ToAscii_Intrinsified_256(char* pUtf16Buff } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe nuint NarrowUtf16ToAscii_Intrinsified_512(char* pUtf16Buffer, byte* pAsciiBuffer, nuint elementCount) { // This method contains logic optimized using vector instructions for x64 only. @@ -2067,6 +2078,7 @@ private static unsafe nuint NarrowUtf16ToAscii_Intrinsified_512(char* pUtf16Buff /// or once elements have been converted. Returns the total number /// of elements that were able to be converted. /// + [RequiresUnsafe] internal static unsafe nuint WidenAsciiToUtf16(byte* pAsciiBuffer, char* pUtf16Buffer, nuint elementCount) { // Intrinsified in mono interpreter @@ -2190,6 +2202,7 @@ internal static unsafe nuint WidenAsciiToUtf16(byte* pAsciiBuffer, char* pUtf16B #if NET [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private static unsafe void WidenAsciiToUtf1_Vector(byte* pAsciiBuffer, char* pUtf16Buffer, ref nuint currentOffset, nuint elementCount) where TVectorByte : unmanaged, ISimdVector where TVectorUInt16 : unmanaged, ISimdVector diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Decoder.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Decoder.cs index 1f1601edeca84c..7d07dc2c5a10cb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Decoder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Decoder.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Text @@ -94,6 +95,7 @@ public virtual int GetCharCount(byte[] bytes, int index, int count, bool flush) // We expect this to be the workhorse for NLS Encodings, but for existing // ones we need a working (if slow) default implementation) [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe int GetCharCount(byte* bytes, int count, bool flush) { ArgumentNullException.ThrowIfNull(bytes); @@ -155,6 +157,7 @@ public virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, // could easily overflow our output buffer. Therefore we do an extra test // when we copy the buffer so that we don't overflow charCount either. [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount, bool flush) { @@ -266,6 +269,7 @@ public virtual void Convert(byte[] bytes, int byteIndex, int byteCount, // that its likely that we didn't consume as many bytes as we could have. For some // applications this could be slow. (Like trying to exactly fill an output buffer from a bigger stream) [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe void Convert(byte* bytes, int byteCount, char* chars, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderFallback.cs b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderFallback.cs index 9fc078443f6902..7423d471f9f0a9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderFallback.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderFallback.cs @@ -74,6 +74,7 @@ internal unsafe void InternalReset() // Set the above values // This can't be part of the constructor because DecoderFallbacks would have to know how to implement these. + [RequiresUnsafe] internal unsafe void InternalInitialize(byte* byteStart, char* charEnd) { this.byteStart = byteStart; @@ -104,6 +105,7 @@ internal static DecoderFallbackBuffer CreateAndInitialize(Encoding encoding, Dec // Right now this has both bytes and bytes[], since we might have extra bytes, hence the // array, and we might need the index, hence the byte* // Don't touch ref chars unless we succeed + [RequiresUnsafe] internal unsafe bool InternalFallback(byte[] bytes, byte* pBytes, ref char* chars) { Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); @@ -157,6 +159,7 @@ internal unsafe bool InternalFallback(byte[] bytes, byte* pBytes, ref char* char } // This version just counts the fallback and doesn't actually copy anything. + [RequiresUnsafe] internal virtual unsafe int InternalFallback(byte[] bytes, byte* pBytes) // Right now this has both bytes and bytes[], since we might have extra bytes, hence the // array, and we might need the index, hence the byte* diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs index 2452d70ce2a55a..046683d16a8e68 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderNLS.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Text @@ -62,6 +63,7 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count, bool return GetCharCount(pBytes + index, count, flush); } + [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count, bool flush) { ArgumentNullException.ThrowIfNull(bytes); @@ -112,6 +114,7 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, } } + [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount, bool flush) { @@ -164,6 +167,7 @@ public override unsafe void Convert(byte[] bytes, int byteIndex, int byteCount, // This is the version that used pointers. We call the base encoding worker function // after setting our appropriate internal variables. This is getting chars + [RequiresUnsafe] public override unsafe void Convert(byte* bytes, int byteCount, char* chars, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderReplacementFallback.cs b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderReplacementFallback.cs index 4849b738529a4f..e46dd9f93a5848 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/DecoderReplacementFallback.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/DecoderReplacementFallback.cs @@ -163,6 +163,7 @@ public override unsafe void Reset() } // This version just counts the fallback and doesn't actually copy anything. + [RequiresUnsafe] internal override unsafe int InternalFallback(byte[] bytes, byte* pBytes) => // Right now this has both bytes and bytes[], since we might have extra bytes, // hence the array, and we might need the index, hence the byte*. diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Encoder.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Encoder.cs index abbc5e1066988a..12e1e406ccbed1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Encoder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Encoder.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Text @@ -91,6 +92,7 @@ public virtual void Reset() // unfortunately for existing overrides, it has to call the [] version, // which is really slow, so avoid this method if you might be calling external encodings. [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe int GetByteCount(char* chars, int count, bool flush) { ArgumentNullException.ThrowIfNull(chars); @@ -152,6 +154,7 @@ public abstract int GetBytes(char[] chars, int charIndex, int charCount, // could easily overflow our output buffer. Therefore we do an extra test // when we copy the buffer so that we don't overflow byteCount either. [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush) { @@ -265,6 +268,7 @@ public virtual void Convert(char[] chars, int charIndex, int charCount, // that its likely that we didn't consume as many chars as we could have. For some // applications this could be slow. (Like trying to exactly fill an output buffer from a bigger stream) [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe void Convert(char* chars, int charCount, byte* bytes, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderFallback.cs b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderFallback.cs index fdd585b02334ba..89c73fdb1d5c7b 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderFallback.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderFallback.cs @@ -293,6 +293,7 @@ private Rune GetNextRune() // Note that this could also change the contents of this.encoder, which is the same // object that the caller is using, so the caller could mess up the encoder for us // if they aren't careful. + [RequiresUnsafe] internal unsafe bool InternalFallback(char ch, ref char* chars) { // Shouldn't have null charStart diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs index 0c8a6a062fa0b9..637fad44eecf33 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderNLS.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Text @@ -61,6 +62,7 @@ public override unsafe int GetByteCount(char[] chars, int index, int count, bool return result; } + [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count, bool flush) { ArgumentNullException.ThrowIfNull(chars); @@ -102,6 +104,7 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, } } + [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush) { ArgumentNullException.ThrowIfNull(chars); @@ -150,6 +153,7 @@ public override unsafe void Convert(char[] chars, int charIndex, int charCount, // This is the version that uses pointers. We call the base encoding worker function // after setting our appropriate internal variables. This is getting bytes + [RequiresUnsafe] public override unsafe void Convert(char* chars, int charCount, byte* bytes, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.Internal.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.Internal.cs index 48ed1db1ca69be..814f3f03cf894d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.Internal.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.Internal.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -118,6 +119,7 @@ internal virtual bool TryGetByteCount(Rune value, out int byteCount) /// /// Entry point from . /// + [RequiresUnsafe] internal virtual unsafe int GetByteCount(char* pChars, int charCount, EncoderNLS? encoder) { Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); @@ -171,6 +173,7 @@ internal virtual unsafe int GetByteCount(char* pChars, int charCount, EncoderNLS /// The implementation should not attempt to perform any sort of fallback behavior. /// If custom fallback behavior is necessary, override . /// + [RequiresUnsafe] private protected virtual unsafe int GetByteCountFast(char* pChars, int charsLength, EncoderFallback? fallback, out int charsConsumed) { // Any production-quality type would override this method and provide a real @@ -222,6 +225,7 @@ private protected virtual unsafe int GetByteCountFast(char* pChars, int charsLen /// (Implementation should call .) /// [MethodImpl(MethodImplOptions.NoInlining)] // don't stack spill spans into our caller + [RequiresUnsafe] private protected unsafe int GetByteCountWithFallback(char* pCharsOriginal, int originalCharCount, int charsConsumedSoFar) { // This is a stub method that's marked "no-inlining" so that it we don't stack-spill spans @@ -252,6 +256,7 @@ private protected unsafe int GetByteCountWithFallback(char* pCharsOriginal, int /// If the return value would exceed . /// (The implementation should call .) /// + [RequiresUnsafe] private unsafe int GetByteCountWithFallback(char* pOriginalChars, int originalCharCount, int charsConsumedSoFar, EncoderNLS encoder) { Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); @@ -395,6 +400,7 @@ private protected virtual unsafe int GetByteCountWithFallback(ReadOnlySpan /// /// Entry point from and . /// + [RequiresUnsafe] internal virtual unsafe int GetBytes(char* pChars, int charCount, byte* pBytes, int byteCount, EncoderNLS? encoder) { Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); @@ -439,6 +445,7 @@ internal virtual unsafe int GetBytes(char* pChars, int charCount, byte* pBytes, /// The implementation should not attempt to perform any sort of fallback behavior. /// If custom fallback behavior is necessary, override . /// + [RequiresUnsafe] private protected virtual unsafe int GetBytesFast(char* pChars, int charsLength, byte* pBytes, int bytesLength, out int charsConsumed) { // Any production-quality type would override this method and provide a real @@ -485,6 +492,7 @@ private protected virtual unsafe int GetBytesFast(char* pChars, int charsLength, /// If the destination buffer is not large enough to hold the entirety of the transcoded data. /// [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private protected unsafe int GetBytesWithFallback(char* pOriginalChars, int originalCharCount, byte* pOriginalBytes, int originalByteCount, int charsConsumedSoFar, int bytesWrittenSoFar, bool throwForDestinationOverflow = true) { // This is a stub method that's marked "no-inlining" so that it we don't stack-spill spans @@ -519,6 +527,7 @@ private protected unsafe int GetBytesWithFallback(char* pOriginalChars, int orig /// too small to contain the entirety of the transcoded data and the instance disallows /// partial transcoding. /// + [RequiresUnsafe] private unsafe int GetBytesWithFallback(char* pOriginalChars, int originalCharCount, byte* pOriginalBytes, int originalByteCount, int charsConsumedSoFar, int bytesWrittenSoFar, EncoderNLS encoder) { Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); @@ -711,6 +720,7 @@ private protected virtual unsafe int GetBytesWithFallback(ReadOnlySpan cha /// /// Entry point from . /// + [RequiresUnsafe] internal virtual unsafe int GetCharCount(byte* pBytes, int byteCount, DecoderNLS? decoder) { Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); @@ -766,6 +776,7 @@ internal virtual unsafe int GetCharCount(byte* pBytes, int byteCount, DecoderNLS /// The implementation should not attempt to perform any sort of fallback behavior. /// If custom fallback behavior is necessary, override . /// + [RequiresUnsafe] private protected virtual unsafe int GetCharCountFast(byte* pBytes, int bytesLength, DecoderFallback? fallback, out int bytesConsumed) { // Any production-quality type would override this method and provide a real @@ -816,6 +827,7 @@ private protected virtual unsafe int GetCharCountFast(byte* pBytes, int bytesLen /// (Implementation should call .) /// [MethodImpl(MethodImplOptions.NoInlining)] // don't stack spill spans into our caller + [RequiresUnsafe] private protected unsafe int GetCharCountWithFallback(byte* pBytesOriginal, int originalByteCount, int bytesConsumedSoFar) { // This is a stub method that's marked "no-inlining" so that it we don't stack-spill spans @@ -846,6 +858,7 @@ private protected unsafe int GetCharCountWithFallback(byte* pBytesOriginal, int /// If the return value would exceed . /// (The implementation should call .) /// + [RequiresUnsafe] private unsafe int GetCharCountWithFallback(byte* pOriginalBytes, int originalByteCount, int bytesConsumedSoFar, DecoderNLS decoder) { Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); @@ -991,6 +1004,7 @@ private unsafe int GetCharCountWithFallback(ReadOnlySpan bytes, int origin /// /// Entry point from and . /// + [RequiresUnsafe] internal virtual unsafe int GetChars(byte* pBytes, int byteCount, char* pChars, int charCount, DecoderNLS? decoder) { Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); @@ -1035,6 +1049,7 @@ internal virtual unsafe int GetChars(byte* pBytes, int byteCount, char* pChars, /// The implementation should not attempt to perform any sort of fallback behavior. /// If custom fallback behavior is necessary, override . /// + [RequiresUnsafe] private protected virtual unsafe int GetCharsFast(byte* pBytes, int bytesLength, char* pChars, int charsLength, out int bytesConsumed) { // Any production-quality type would override this method and provide a real @@ -1081,6 +1096,7 @@ private protected virtual unsafe int GetCharsFast(byte* pBytes, int bytesLength, /// If the destination buffer is not large enough to hold the entirety of the transcoded data. /// [MethodImpl(MethodImplOptions.NoInlining)] + [RequiresUnsafe] private protected unsafe int GetCharsWithFallback(byte* pOriginalBytes, int originalByteCount, char* pOriginalChars, int originalCharCount, int bytesConsumedSoFar, int charsWrittenSoFar, bool throwForDestinationOverflow = true) { // This is a stub method that's marked "no-inlining" so that it we don't stack-spill spans @@ -1115,6 +1131,7 @@ private protected unsafe int GetCharsWithFallback(byte* pOriginalBytes, int orig /// too small to contain the entirety of the transcoded data and the instance disallows /// partial transcoding. /// + [RequiresUnsafe] private protected unsafe int GetCharsWithFallback(byte* pOriginalBytes, int originalByteCount, char* pOriginalChars, int originalCharCount, int bytesConsumedSoFar, int charsWrittenSoFar, DecoderNLS decoder) { Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs index 97282df181bbb6..6b5a1bae54e3a1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Encoding.cs @@ -568,6 +568,7 @@ public int GetByteCount(string s, int index, int count) // which is really slow, so this method should be avoided if you're calling // a 3rd party encoding. [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe int GetByteCount(char* chars, int count) { ArgumentNullException.ThrowIfNull(chars); @@ -690,6 +691,7 @@ public virtual int GetBytes(string s, int charIndex, int charCount, // when we copy the buffer so that we don't overflow byteCount either. [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { @@ -769,6 +771,7 @@ public virtual int GetCharCount(byte[] bytes) // We expect this to be the workhorse for NLS Encodings, but for existing // ones we need a working (if slow) default implementation) [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe int GetCharCount(byte* bytes, int count) { ArgumentNullException.ThrowIfNull(bytes); @@ -839,6 +842,7 @@ public abstract int GetChars(byte[] bytes, int byteIndex, int byteCount, // when we copy the buffer so that we don't overflow charCount either. [CLSCompliant(false)] + [RequiresUnsafe] public virtual unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { @@ -901,6 +905,7 @@ public virtual bool TryGetChars(ReadOnlySpan bytes, Span chars, out } [CLSCompliant(false)] + [RequiresUnsafe] public unsafe string GetString(byte* bytes, int byteCount) { ArgumentNullException.ThrowIfNull(bytes); @@ -1162,6 +1167,7 @@ public DefaultEncoder(Encoding encoding) public override int GetByteCount(char[] chars, int index, int count, bool flush) => _encoding.GetByteCount(chars, index, count); + [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count, bool flush) => _encoding.GetByteCount(chars, count); @@ -1189,6 +1195,7 @@ public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, bool flush) => _encoding.GetBytes(chars, charIndex, charCount, bytes, byteIndex); + [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush) => _encoding.GetBytes(chars, charCount, bytes, byteCount); @@ -1216,6 +1223,7 @@ public override int GetCharCount(byte[] bytes, int index, int count) => public override int GetCharCount(byte[] bytes, int index, int count, bool flush) => _encoding.GetCharCount(bytes, index, count); + [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count, bool flush) => // By default just call the encoding version, no flush by default _encoding.GetCharCount(bytes, count); @@ -1245,6 +1253,7 @@ public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush) => _encoding.GetChars(bytes, byteIndex, byteCount, chars, charIndex); + [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount, bool flush) => // By default just call the encoding's version @@ -1264,6 +1273,7 @@ internal sealed class EncodingCharBuffer private unsafe byte* _bytes; private readonly DecoderFallbackBuffer _fallbackBuffer; + [RequiresUnsafe] internal unsafe EncodingCharBuffer(Encoding enc, DecoderNLS? decoder, char* charStart, int charCount, byte* byteStart, int byteCount) { @@ -1411,6 +1421,7 @@ internal sealed class EncodingByteBuffer private readonly EncoderNLS? _encoder; internal EncoderFallbackBuffer fallbackBuffer; + [RequiresUnsafe] internal unsafe EncodingByteBuffer(Encoding inEncoding, EncoderNLS? inEncoder, byte* inByteStart, int inByteCount, char* inCharStart, int inCharCount) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Encoding.cs index d2dede7878c9c7..eb0582b3835870 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Encoding.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -38,6 +39,7 @@ internal sealed override void SetDefaultFallbacks() * but fallback mechanism must be consulted for non-Latin-1 chars. */ + [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { if (chars is null) @@ -100,6 +102,7 @@ public override unsafe int GetByteCount(string s) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetByteCountCommon(char* pChars, int charCount) { // Common helper method for all non-EncoderNLS entry points to GetByteCount. @@ -130,6 +133,7 @@ private unsafe int GetByteCountCommon(char* pChars, int charCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetByteCountCommon + [RequiresUnsafe] private protected sealed override unsafe int GetByteCountFast(char* pChars, int charsLength, EncoderFallback? fallback, out int charsConsumed) { // Can we short-circuit the entire calculation? If so, the output byte count @@ -171,6 +175,7 @@ public override int GetMaxByteCount(int charCount) * but fallback mechanism must be consulted for non-Latin-1 chars. */ + [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { if (chars is null || bytes is null) @@ -287,6 +292,7 @@ public override unsafe int GetBytes(string s, int charIndex, int charCount, byte [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int byteCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-EncoderNLS entry points to GetBytes. @@ -316,6 +322,7 @@ private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetBytesCommon + [RequiresUnsafe] private protected sealed override unsafe int GetBytesFast(char* pChars, int charsLength, byte* pBytes, int bytesLength, out int charsConsumed) { int bytesWritten = (int)Latin1Utility.NarrowUtf16ToLatin1(pChars, pBytes, (uint)Math.Min(charsLength, bytesLength)); @@ -330,6 +337,7 @@ private protected sealed override unsafe int GetBytesFast(char* pChars, int char * We never consult the fallback mechanism during decoding. */ + [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { if (bytes is null) @@ -380,6 +388,7 @@ public override int GetCharCount(ReadOnlySpan bytes) return bytes.Length; } + [RequiresUnsafe] private protected override unsafe int GetCharCountFast(byte* pBytes, int bytesLength, DecoderFallback? fallback, out int bytesConsumed) { // We never consult the fallback mechanism during GetChars. @@ -407,6 +416,7 @@ public override int GetMaxCharCount(int byteCount) * We never consult the fallback mechanism during decoding. */ + [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { if (bytes is null || chars is null) @@ -593,6 +603,7 @@ public override unsafe string GetString(byte[] bytes, int index, int count) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int charCount) { // Common helper method for all non-DecoderNLS entry points to GetChars. @@ -616,6 +627,7 @@ private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int } // called by the fallback mechanism + [RequiresUnsafe] private protected sealed override unsafe int GetCharsFast(byte* pBytes, int bytesLength, char* pChars, int charsLength, out int bytesConsumed) { int charsWritten = Math.Min(bytesLength, charsLength); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Utility.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Utility.cs index ab34210731862a..81465bf382373a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Utility.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Latin1Utility.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; @@ -17,6 +18,7 @@ internal static partial class Latin1Utility /// /// A Latin-1 char is defined as 0x0000 - 0x00FF, inclusive. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] public static unsafe nuint GetIndexOfFirstNonLatin1Char(char* pBuffer, nuint bufferLength /* in chars */) { // If SSE2 is supported, use those specific intrinsics instead of the generic vectorized @@ -29,6 +31,7 @@ public static unsafe nuint GetIndexOfFirstNonLatin1Char(char* pBuffer, nuint buf : GetIndexOfFirstNonLatin1Char_Default(pBuffer, bufferLength); } + [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonLatin1Char_Default(char* pBuffer, nuint bufferLength /* in chars */) { // Squirrel away the original buffer reference.This method works by determining the exact @@ -164,6 +167,7 @@ private static unsafe nuint GetIndexOfFirstNonLatin1Char_Default(char* pBuffer, } [CompExactlyDependsOn(typeof(Sse2))] + [RequiresUnsafe] private static unsafe nuint GetIndexOfFirstNonLatin1Char_Sse2(char* pBuffer, nuint bufferLength /* in chars */) { // This method contains logic optimized for both SSE2 and SSE41. Much of the logic in this method @@ -533,6 +537,7 @@ private static unsafe nuint GetIndexOfFirstNonLatin1Char_Sse2(char* pBuffer, nui /// or once elements have been converted. Returns the total number /// of elements that were able to be converted. /// + [RequiresUnsafe] public static unsafe nuint NarrowUtf16ToLatin1(char* pUtf16Buffer, byte* pLatin1Buffer, nuint elementCount) { nuint currentOffset = 0; @@ -762,6 +767,7 @@ public static unsafe nuint NarrowUtf16ToLatin1(char* pUtf16Buffer, byte* pLatin1 } [CompExactlyDependsOn(typeof(Sse2))] + [RequiresUnsafe] private static unsafe nuint NarrowUtf16ToLatin1_Sse2(char* pUtf16Buffer, byte* pLatin1Buffer, nuint elementCount) { // This method contains logic optimized for both SSE2 and SSE41. Much of the logic in this method @@ -943,6 +949,7 @@ private static unsafe nuint NarrowUtf16ToLatin1_Sse2(char* pUtf16Buffer, byte* p /// buffer , widening data while copying. /// specifies the element count of both the source and destination buffers. /// + [RequiresUnsafe] public static unsafe void WidenLatin1ToUtf16(byte* pLatin1Buffer, char* pUtf16Buffer, nuint elementCount) { // If SSE2 is supported, use those specific intrinsics instead of the generic vectorized @@ -961,6 +968,7 @@ public static unsafe void WidenLatin1ToUtf16(byte* pLatin1Buffer, char* pUtf16Bu } [CompExactlyDependsOn(typeof(Sse2))] + [RequiresUnsafe] private static unsafe void WidenLatin1ToUtf16_Sse2(byte* pLatin1Buffer, char* pUtf16Buffer, nuint elementCount) { // JIT turns the below into constants @@ -1066,6 +1074,7 @@ private static unsafe void WidenLatin1ToUtf16_Sse2(byte* pLatin1Buffer, char* pU } } + [RequiresUnsafe] private static unsafe void WidenLatin1ToUtf16_Fallback(byte* pLatin1Buffer, char* pUtf16Buffer, nuint elementCount) { Debug.Assert(!Sse2.IsSupported); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs b/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs index 83f9306b16ee71..0535ab1e2c87fc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs @@ -2323,6 +2323,7 @@ public StringBuilder Replace(Rune oldRune, Rune newRune, int startIndex, int cou /// The pointer to the start of the buffer. /// The number of characters in the buffer. [CLSCompliant(false)] + [RequiresUnsafe] public unsafe StringBuilder Append(char* value, int valueCount) { // We don't check null value as this case will throw null reference exception anyway diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs index c635e0fab3846c..97c80e5b7ce4e2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs @@ -130,6 +130,7 @@ public override unsafe int GetByteCount(string s) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { ArgumentNullException.ThrowIfNull(chars); @@ -218,6 +219,7 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { ArgumentNullException.ThrowIfNull(chars); @@ -261,6 +263,7 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { ArgumentNullException.ThrowIfNull(bytes); @@ -310,6 +313,7 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { ArgumentNullException.ThrowIfNull(bytes); @@ -350,6 +354,7 @@ public override unsafe string GetString(byte[] bytes, int index, int count) // // End of standard methods copied from EncodingNLS.cs // + [RequiresUnsafe] internal override unsafe int GetByteCount(char* chars, int count, EncoderNLS? encoder) { Debug.Assert(chars is not null, "[UTF32Encoding.GetByteCount]chars!=null"); @@ -481,6 +486,7 @@ internal override unsafe int GetByteCount(char* chars, int count, EncoderNLS? en return byteCount; } + [RequiresUnsafe] internal override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, EncoderNLS? encoder) { @@ -683,6 +689,7 @@ internal override unsafe int GetBytes(char* chars, int charCount, return (int)(bytes - byteStart); } + [RequiresUnsafe] internal override unsafe int GetCharCount(byte* bytes, int count, DecoderNLS? baseDecoder) { Debug.Assert(bytes is not null, "[UTF32Encoding.GetCharCount]bytes!=null"); @@ -825,6 +832,7 @@ internal override unsafe int GetCharCount(byte* bytes, int count, DecoderNLS? ba return charCount; } + [RequiresUnsafe] internal override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount, DecoderNLS? baseDecoder) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs index 1ae72a0fbd3931..94d9ffa2a06a55 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UTF7Encoding.cs @@ -166,6 +166,7 @@ public override unsafe int GetByteCount(string s) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { ArgumentNullException.ThrowIfNull(chars); @@ -254,6 +255,7 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { ArgumentNullException.ThrowIfNull(chars); @@ -297,6 +299,7 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { ArgumentNullException.ThrowIfNull(bytes); @@ -346,6 +349,7 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { ArgumentNullException.ThrowIfNull(bytes); @@ -386,6 +390,7 @@ public override unsafe string GetString(byte[] bytes, int index, int count) // // End of standard methods copied from EncodingNLS.cs // + [RequiresUnsafe] internal sealed override unsafe int GetByteCount(char* chars, int count, EncoderNLS? baseEncoder) { Debug.Assert(chars is not null, "[UTF7Encoding.GetByteCount]chars!=null"); @@ -395,6 +400,7 @@ internal sealed override unsafe int GetByteCount(char* chars, int count, Encoder return GetBytes(chars, count, null, 0, baseEncoder); } + [RequiresUnsafe] internal sealed override unsafe int GetBytes( char* chars, int charCount, byte* bytes, int byteCount, EncoderNLS? baseEncoder) { @@ -535,6 +541,7 @@ internal sealed override unsafe int GetBytes( return buffer.Count; } + [RequiresUnsafe] internal sealed override unsafe int GetCharCount(byte* bytes, int count, DecoderNLS? baseDecoder) { Debug.Assert(count >= 0, "[UTF7Encoding.GetCharCount]count >=0"); @@ -544,6 +551,7 @@ internal sealed override unsafe int GetCharCount(byte* bytes, int count, Decoder return GetChars(bytes, count, null, 0, baseDecoder); } + [RequiresUnsafe] internal sealed override unsafe int GetChars( byte* bytes, int byteCount, char* chars, int charCount, DecoderNLS? baseDecoder) { @@ -894,6 +902,7 @@ public override unsafe void Reset() } // This version just counts the fallback and doesn't actually copy anything. + [RequiresUnsafe] internal override unsafe int InternalFallback(byte[] bytes, byte* pBytes) // Right now this has both bytes and bytes[], since we might have extra bytes, hence the // array, and we might need the index, hence the byte* diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UTF8Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UTF8Encoding.cs index 1e92750495e402..6a6b0a60f43a74 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UTF8Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UTF8Encoding.cs @@ -172,6 +172,7 @@ public override unsafe int GetByteCount(string chars) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { if (chars is null) @@ -198,6 +199,7 @@ public override unsafe int GetByteCount(ReadOnlySpan chars) } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetByteCountCommon(char* pChars, int charCount) { // Common helper method for all non-EncoderNLS entry points to GetByteCount. @@ -228,6 +230,7 @@ private unsafe int GetByteCountCommon(char* pChars, int charCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharCountCommon + [RequiresUnsafe] private protected sealed override unsafe int GetByteCountFast(char* pChars, int charsLength, EncoderFallback? fallback, out int charsConsumed) { // The number of UTF-8 code units may exceed the number of UTF-16 code units, @@ -339,6 +342,7 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { if (chars is null || bytes is null) @@ -388,6 +392,7 @@ public override unsafe bool TryGetBytes(ReadOnlySpan chars, Span byt } [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int byteCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-EncoderNLS entry points to GetBytes. @@ -417,6 +422,7 @@ private unsafe int GetBytesCommon(char* pChars, int charCount, byte* pBytes, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetBytesCommon + [RequiresUnsafe] private protected sealed override unsafe int GetBytesFast(char* pChars, int charsLength, byte* pBytes, int bytesLength, out int charsConsumed) { // We don't care about the exact OperationStatus value returned by the workhorse routine; we only @@ -465,6 +471,7 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { if (bytes is null) @@ -534,6 +541,7 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { if (bytes is null || chars is null) @@ -590,6 +598,7 @@ public override unsafe bool TryGetChars(ReadOnlySpan bytes, Span cha // Note: We throw exceptions on individually encoded surrogates and other non-shortest forms. // If exceptions aren't turned on, then we drop all non-shortest &individual surrogates. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int charCount, bool throwForDestinationOverflow = true) { // Common helper method for all non-DecoderNLS entry points to GetChars. @@ -619,6 +628,7 @@ private unsafe int GetCharsCommon(byte* pBytes, int byteCount, char* pChars, int } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharsCommon + [RequiresUnsafe] private protected sealed override unsafe int GetCharsFast(byte* pBytes, int bytesLength, char* pChars, int charsLength, out int bytesConsumed) { // We don't care about the exact OperationStatus value returned by the workhorse routine; we only @@ -708,6 +718,7 @@ public override unsafe string GetString(byte[] bytes, int index, int count) // [MethodImpl(MethodImplOptions.AggressiveInlining)] + [RequiresUnsafe] private unsafe int GetCharCountCommon(byte* pBytes, int byteCount) { // Common helper method for all non-DecoderNLS entry points to GetCharCount. @@ -738,6 +749,7 @@ private unsafe int GetCharCountCommon(byte* pBytes, int byteCount) } [MethodImpl(MethodImplOptions.AggressiveInlining)] // called directly by GetCharCountCommon + [RequiresUnsafe] private protected sealed override unsafe int GetCharCountFast(byte* pBytes, int bytesLength, DecoderFallback? fallback, out int bytesConsumed) { // The number of UTF-16 code units will never exceed the number of UTF-8 code units, diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs index 66604610a9ff63..524e6a2f504dd3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf16Utility.Validation.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.Intrinsics; @@ -69,6 +70,7 @@ private static bool IsLastCharHighSurrogate(nuint maskHigh) /// /// Returns a pointer to the end of if the buffer is well-formed. /// + [RequiresUnsafe] public static char* GetPointerToFirstInvalidChar(char* pInputBuffer, int inputLength, out long utf8CodeUnitCountAdjustment, out int scalarCountAdjustment) { Debug.Assert(inputLength >= 0, "Input length must not be negative."); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Transcoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Transcoding.cs index 9c4a28c83240f3..1905339cccc376 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Transcoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Transcoding.cs @@ -4,6 +4,7 @@ using System.Buffers; using System.Buffers.Text; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; #if NET @@ -19,6 +20,7 @@ internal static unsafe partial class Utf8Utility // On method return, pInputBufferRemaining and pOutputBufferRemaining will both point to where // the next byte would have been consumed from / the next char would have been written to. // inputLength in bytes, outputCharsRemaining in chars. + [RequiresUnsafe] public static OperationStatus TranscodeToUtf16(byte* pInputBuffer, int inputLength, char* pOutputBuffer, int outputCharsRemaining, out byte* pInputBufferRemaining, out char* pOutputBufferRemaining) { Debug.Assert(inputLength >= 0, "Input length must not be negative."); @@ -837,6 +839,7 @@ public static OperationStatus TranscodeToUtf16(byte* pInputBuffer, int inputLeng // On method return, pInputBufferRemaining and pOutputBufferRemaining will both point to where // the next char would have been consumed from / the next byte would have been written to. // inputLength in chars, outputBytesRemaining in bytes. + [RequiresUnsafe] public static OperationStatus TranscodeToUtf8(char* pInputBuffer, int inputLength, byte* pOutputBuffer, int outputBytesRemaining, out char* pInputBufferRemaining, out byte* pOutputBufferRemaining) { const int CharsPerDWord = sizeof(uint) / sizeof(char); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Validation.cs b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Validation.cs index 821037a538b3c8..4fbc51c8521106 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Validation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Validation.cs @@ -3,6 +3,7 @@ using System.Buffers.Text; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Numerics; using System.Runtime.CompilerServices; #if NET @@ -23,6 +24,7 @@ internal static unsafe partial class Utf8Utility /// /// Returns a pointer to the end of if the buffer is well-formed. /// + [RequiresUnsafe] public static byte* GetPointerToFirstInvalidByte(byte* pInputBuffer, int inputLength, out int utf16CodeUnitCountAdjustment, out int scalarCountAdjustment) { Debug.Assert(inputLength >= 0, "Input length must not be negative."); diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs index b43fcff0e6fdbd..431dfbb3c90a6f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UnicodeEncoding.cs @@ -122,6 +122,7 @@ public override unsafe int GetByteCount(string s) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetByteCount(char* chars, int count) { ArgumentNullException.ThrowIfNull(chars); @@ -210,6 +211,7 @@ public override unsafe int GetBytes(char[] chars, int charIndex, int charCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { ArgumentNullException.ThrowIfNull(chars); @@ -253,6 +255,7 @@ public override unsafe int GetCharCount(byte[] bytes, int index, int count) // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetCharCount(byte* bytes, int count) { ArgumentNullException.ThrowIfNull(bytes); @@ -302,6 +305,7 @@ public override unsafe int GetChars(byte[] bytes, int byteIndex, int byteCount, // EncodingNLS, UTF7Encoding, UTF8Encoding, UTF32Encoding, ASCIIEncoding, UnicodeEncoding [CLSCompliant(false)] + [RequiresUnsafe] public override unsafe int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { ArgumentNullException.ThrowIfNull(bytes); @@ -342,6 +346,7 @@ public override unsafe string GetString(byte[] bytes, int index, int count) // // End of standard methods copied from EncodingNLS.cs // + [RequiresUnsafe] internal sealed override unsafe int GetByteCount(char* chars, int count, EncoderNLS? encoder) { Debug.Assert(chars is not null, "[UnicodeEncoding.GetByteCount]chars!=null"); @@ -630,6 +635,7 @@ internal sealed override unsafe int GetByteCount(char* chars, int count, Encoder return byteCount; } + [RequiresUnsafe] internal sealed override unsafe int GetBytes( char* chars, int charCount, byte* bytes, int byteCount, EncoderNLS? encoder) { @@ -982,6 +988,7 @@ internal sealed override unsafe int GetBytes( return (int)(bytes - byteStart); } + [RequiresUnsafe] internal sealed override unsafe int GetCharCount(byte* bytes, int count, DecoderNLS? baseDecoder) { Debug.Assert(bytes is not null, "[UnicodeEncoding.GetCharCount]bytes!=null"); @@ -1296,6 +1303,7 @@ internal sealed override unsafe int GetCharCount(byte* bytes, int count, Decoder return charCount; } + [RequiresUnsafe] internal sealed override unsafe int GetChars( byte* bytes, int byteCount, char* chars, int charCount, DecoderNLS? baseDecoder) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/IOCompletionCallbackHelper.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/IOCompletionCallbackHelper.cs index 6d1da459c9cc55..efbc5f79042533 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/IOCompletionCallbackHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/IOCompletionCallbackHelper.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Threading @@ -29,6 +30,7 @@ private static void IOCompletionCallback_Context(object? state) helper._ioCompletionCallback(helper._errorCode, helper._numBytes, helper._pNativeOverlapped); } + [RequiresUnsafe] public static void PerformSingleIOCompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* pNativeOverlapped) { Debug.Assert(pNativeOverlapped != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs index 89b2790e5fb4e5..46ddab7933869f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/NamedMutex.Unix.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.InteropServices; using Microsoft.Win32.SafeHandles; @@ -260,6 +261,7 @@ public void Abandon(NamedMutexOwnershipChain chain, Thread abandonedThread) } } + [RequiresUnsafe] private static unsafe void InitializeSharedData(void* v) { if (UsePThreadMutexes) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Overlapped.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Overlapped.cs index 35fbb26708627a..423e9429b33be0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Overlapped.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Overlapped.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Tracing; using System.Runtime.InteropServices; @@ -67,10 +68,12 @@ public IntPtr EventHandleIntPtr [Obsolete("This overload is not safe and has been deprecated. Use Pack(IOCompletionCallback?, object?) instead.")] [CLSCompliant(false)] + [RequiresUnsafe] public NativeOverlapped* Pack(IOCompletionCallback? iocb) => Pack(iocb, null); [CLSCompliant(false)] + [RequiresUnsafe] public NativeOverlapped* Pack(IOCompletionCallback? iocb, object? userData) { if (_pNativeOverlapped != null) @@ -92,10 +95,12 @@ public IntPtr EventHandleIntPtr [Obsolete("This overload is not safe and has been deprecated. Use UnsafePack(IOCompletionCallback?, object?) instead.")] [CLSCompliant(false)] + [RequiresUnsafe] public NativeOverlapped* UnsafePack(IOCompletionCallback? iocb) => UnsafePack(iocb, null); [CLSCompliant(false)] + [RequiresUnsafe] public NativeOverlapped* UnsafePack(IOCompletionCallback? iocb, object? userData) { if (_pNativeOverlapped != null) @@ -111,6 +116,7 @@ public IntPtr EventHandleIntPtr * Unpins the native Overlapped struct ====================================================================*/ [CLSCompliant(false)] + [RequiresUnsafe] public static Overlapped Unpack(NativeOverlapped* nativeOverlappedPtr) { ArgumentNullException.ThrowIfNull(nativeOverlappedPtr); @@ -119,6 +125,7 @@ public static Overlapped Unpack(NativeOverlapped* nativeOverlappedPtr) } [CLSCompliant(false)] + [RequiresUnsafe] public static void Free(NativeOverlapped* nativeOverlappedPtr) { ArgumentNullException.ThrowIfNull(nativeOverlappedPtr); @@ -127,6 +134,7 @@ public static void Free(NativeOverlapped* nativeOverlappedPtr) FreeNativeOverlapped(nativeOverlappedPtr); } + [RequiresUnsafe] private NativeOverlapped* AllocateNativeOverlapped(object? userData) { NativeOverlapped* pNativeOverlapped = null; @@ -202,6 +210,7 @@ public static void Free(NativeOverlapped* nativeOverlappedPtr) } } + [RequiresUnsafe] internal static void FreeNativeOverlapped(NativeOverlapped* pNativeOverlapped) { nuint handleCount = GCHandleCountRef(pNativeOverlapped); @@ -215,12 +224,15 @@ internal static void FreeNativeOverlapped(NativeOverlapped* pNativeOverlapped) // // The NativeOverlapped structure is followed by GC handle count and inline array of GC handles // + [RequiresUnsafe] private static ref nuint GCHandleCountRef(NativeOverlapped* pNativeOverlapped) => ref *(nuint*)(pNativeOverlapped + 1); + [RequiresUnsafe] private static ref GCHandle GCHandleRef(NativeOverlapped* pNativeOverlapped, nuint index) => ref *((GCHandle*)((nuint*)(pNativeOverlapped + 1) + 1) + index); + [RequiresUnsafe] internal static Overlapped GetOverlappedFromNative(NativeOverlapped* pNativeOverlapped) { object? target = GCHandleRef(pNativeOverlapped, 0).Target; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadBlockingInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadBlockingInfo.cs index f546fb68201c26..c87b6b06151f0d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadBlockingInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadBlockingInfo.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -47,6 +48,7 @@ internal unsafe struct ThreadBlockingInfo // Points to the next-most-recent blocking info for the thread private ThreadBlockingInfo* _next; // may be used by debuggers + [RequiresUnsafe] private void Push(void* objectPtr, ObjectKind objectKind, int timeoutMs) { Debug.Assert(objectPtr != null); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs index c133660deaab88..d83693ba4fca8e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; @@ -95,6 +96,7 @@ internal static RegisteredWaitHandle RegisterWaitForSingleObject( [CLSCompliant(false)] [SupportedOSPlatform("windows")] + [RequiresUnsafe] public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) => throw new PlatformNotSupportedException(SR.PlatformNotSupported_OverlappedIO); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Portable.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Portable.cs index 5ce4e29d2ce54f..60a9c1848cc243 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Portable.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Portable.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Threading @@ -16,12 +17,15 @@ namespace System.Threading /// public sealed partial class ThreadPoolBoundHandle : IDisposable { + [RequiresUnsafe] private unsafe NativeOverlapped* AllocateNativeOverlappedPortableCore(IOCompletionCallback callback, object? state, object? pinData) => AllocateNativeOverlappedPortableCore(callback, state, pinData, flowExecutionContext: true); + [RequiresUnsafe] private unsafe NativeOverlapped* UnsafeAllocateNativeOverlappedPortableCore(IOCompletionCallback callback, object? state, object? pinData) => AllocateNativeOverlappedPortableCore(callback, state, pinData, flowExecutionContext: false); + [RequiresUnsafe] private unsafe NativeOverlapped* AllocateNativeOverlappedPortableCore(IOCompletionCallback callback, object? state, object? pinData, bool flowExecutionContext) { ArgumentNullException.ThrowIfNull(callback); @@ -32,6 +36,7 @@ public sealed partial class ThreadPoolBoundHandle : IDisposable return overlapped._nativeOverlapped; } + [RequiresUnsafe] private unsafe NativeOverlapped* AllocateNativeOverlappedPortableCore(PreAllocatedOverlapped preAllocated) { ArgumentNullException.ThrowIfNull(preAllocated); @@ -56,6 +61,7 @@ public sealed partial class ThreadPoolBoundHandle : IDisposable } } + [RequiresUnsafe] private unsafe void FreeNativeOverlappedPortableCore(NativeOverlapped* overlapped) { ArgumentNullException.ThrowIfNull(overlapped); @@ -73,6 +79,7 @@ private unsafe void FreeNativeOverlappedPortableCore(NativeOverlapped* overlappe Overlapped.Free(overlapped); } + [RequiresUnsafe] private static unsafe object? GetNativeOverlappedStatePortableCore(NativeOverlapped* overlapped) { ArgumentNullException.ThrowIfNull(overlapped); @@ -82,6 +89,7 @@ private unsafe void FreeNativeOverlappedPortableCore(NativeOverlapped* overlappe return wrapper._userState; } + [RequiresUnsafe] private static unsafe ThreadPoolBoundHandleOverlapped GetOverlappedWrapper(NativeOverlapped* overlapped) { ThreadPoolBoundHandleOverlapped wrapper; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Unix.cs index 9643edf7f2d8d9..4235ebd50624e3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandle.Unix.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Threading @@ -123,6 +124,7 @@ public static ThreadPoolBoundHandle BindHandle(SafeHandle handle) /// This method was called after the was disposed. /// [CLSCompliant(false)] + [RequiresUnsafe] public unsafe NativeOverlapped* AllocateNativeOverlapped(IOCompletionCallback callback, object? state, object? pinData) => AllocateNativeOverlappedPortableCore(callback, state, pinData); @@ -171,6 +173,7 @@ public static ThreadPoolBoundHandle BindHandle(SafeHandle handle) /// This method was called after the was disposed. /// [CLSCompliant(false)] + [RequiresUnsafe] public unsafe NativeOverlapped* UnsafeAllocateNativeOverlapped(IOCompletionCallback callback, object? state, object? pinData) => UnsafeAllocateNativeOverlappedPortableCore(callback, state, pinData); @@ -203,6 +206,7 @@ public static ThreadPoolBoundHandle BindHandle(SafeHandle handle) /// /// [CLSCompliant(false)] + [RequiresUnsafe] public unsafe NativeOverlapped* AllocateNativeOverlapped(PreAllocatedOverlapped preAllocated) => AllocateNativeOverlappedPortableCore(preAllocated); /// @@ -229,6 +233,7 @@ public static ThreadPoolBoundHandle BindHandle(SafeHandle handle) /// This method was called after the was disposed. /// [CLSCompliant(false)] + [RequiresUnsafe] public unsafe void FreeNativeOverlapped(NativeOverlapped* overlapped) => FreeNativeOverlappedPortableCore(overlapped); /// @@ -248,6 +253,7 @@ public static ThreadPoolBoundHandle BindHandle(SafeHandle handle) /// is . /// [CLSCompliant(false)] + [RequiresUnsafe] public static unsafe object? GetNativeOverlappedState(NativeOverlapped* overlapped) => GetNativeOverlappedStatePortableCore(overlapped); public void Dispose() => DisposePortableCore(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs index 4034efe58d5b1e..18ca08a9b858a2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; + namespace System.Threading { /// @@ -31,6 +33,7 @@ public ThreadPoolBoundHandleOverlapped(IOCompletionCallback callback, object? st _nativeOverlapped->OffsetHigh = 0; } + [RequiresUnsafe] private static void CompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped) { ThreadPoolBoundHandleOverlapped overlapped = (ThreadPoolBoundHandleOverlapped)Unpack(nativeOverlapped); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs index 5200cbe6a76514..71541e383dadb1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace System.Threading @@ -28,6 +29,7 @@ internal OverlappedData Data get { return s_dataArray![_dataIndex]; } } + [RequiresUnsafe] internal static unsafe Win32ThreadPoolNativeOverlapped* Allocate(IOCompletionCallback callback, object? state, object? pinData, PreAllocatedOverlapped? preAllocated, bool flowExecutionControl) { Win32ThreadPoolNativeOverlapped* overlapped = AllocateNew(); @@ -43,6 +45,7 @@ internal OverlappedData Data return overlapped; } + [RequiresUnsafe] private static unsafe Win32ThreadPoolNativeOverlapped* AllocateNew() { IntPtr freePtr; @@ -154,6 +157,7 @@ private void SetData(IOCompletionCallback callback, object? state, object? pinDa } } + [RequiresUnsafe] internal static unsafe void Free(Win32ThreadPoolNativeOverlapped* overlapped) { // Reset all data. @@ -181,6 +185,7 @@ internal static unsafe void Free(Win32ThreadPoolNativeOverlapped* overlapped) return (Win32ThreadPoolNativeOverlapped*)overlapped; } + [RequiresUnsafe] internal static unsafe void CompleteWithCallback(uint errorCode, uint bytesWritten, Win32ThreadPoolNativeOverlapped* overlapped) { OverlappedData data = overlapped->Data; diff --git a/src/tools/illink/src/ILLink.CodeFix/Resources.resx b/src/tools/illink/src/ILLink.CodeFix/Resources.resx index 5fccb02ad6bb19..0bd940a98334e2 100644 --- a/src/tools/illink/src/ILLink.CodeFix/Resources.resx +++ b/src/tools/illink/src/ILLink.CodeFix/Resources.resx @@ -135,4 +135,7 @@ Add DynamicallyAccessedMembers attribute to source of warning + + Add RequiresUnsafe attribute to method with pointer types + \ No newline at end of file diff --git a/src/tools/illink/src/ILLink.CodeFix/UnsafeMethodMissingRequiresUnsafeCodeFixProvider.cs b/src/tools/illink/src/ILLink.CodeFix/UnsafeMethodMissingRequiresUnsafeCodeFixProvider.cs new file mode 100644 index 00000000000000..67769e6394bb4f --- /dev/null +++ b/src/tools/illink/src/ILLink.CodeFix/UnsafeMethodMissingRequiresUnsafeCodeFixProvider.cs @@ -0,0 +1,83 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if DEBUG +using System.Collections.Immutable; +using System.Composition; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using ILLink.CodeFixProvider; +using ILLink.RoslynAnalyzer; +using ILLink.Shared; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CodeActions; +using Microsoft.CodeAnalysis.CodeFixes; +using Microsoft.CodeAnalysis.Editing; +using Microsoft.CodeAnalysis.Simplification; + +namespace ILLink.CodeFix +{ + [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(UnsafeMethodMissingRequiresUnsafeCodeFixProvider)), Shared] + public sealed class UnsafeMethodMissingRequiresUnsafeCodeFixProvider : Microsoft.CodeAnalysis.CodeFixes.CodeFixProvider + { + public static ImmutableArray SupportedDiagnostics => + ImmutableArray.Create(DiagnosticDescriptors.GetDiagnosticDescriptor(DiagnosticId.UnsafeMethodMissingRequiresUnsafe)); + + public sealed override ImmutableArray FixableDiagnosticIds => + SupportedDiagnostics.Select(dd => dd.Id).ToImmutableArray(); + + public sealed override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer; + + public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) + { + var document = context.Document; + var diagnostic = context.Diagnostics.First(); + + if (await document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false) is not { } root) + return; + + var node = root.FindNode(diagnostic.Location.SourceSpan, getInnermostNodeForTie: true); + var declarationNode = node.AncestorsAndSelf().FirstOrDefault( + n => n is Microsoft.CodeAnalysis.CSharp.Syntax.BaseMethodDeclarationSyntax + or Microsoft.CodeAnalysis.CSharp.Syntax.LocalFunctionStatementSyntax + or Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax + or Microsoft.CodeAnalysis.CSharp.Syntax.IndexerDeclarationSyntax); + if (declarationNode is null) + return; + + var title = new LocalizableResourceString( + nameof(Resources.UnsafeMethodMissingRequiresUnsafeCodeFixTitle), + Resources.ResourceManager, + typeof(Resources)).ToString(); + + context.RegisterCodeFix(CodeAction.Create( + title: title, + createChangedDocument: ct => AddRequiresUnsafeAttributeAsync(document, declarationNode, ct), + equivalenceKey: title), diagnostic); + } + + private static async Task AddRequiresUnsafeAttributeAsync( + Document document, + SyntaxNode declarationNode, + CancellationToken cancellationToken) + { + if (await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false) is not { } model) + return document; + + if (model.Compilation.GetBestTypeByMetadataName(RequiresUnsafeAnalyzer.FullyQualifiedRequiresUnsafeAttribute) is not { } attributeSymbol) + return document; + + var editor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false); + var generator = editor.Generator; + + var attribute = generator.Attribute(generator.TypeExpression(attributeSymbol)) + .WithAdditionalAnnotations(Simplifier.Annotation, Simplifier.AddImportsAnnotation); + + editor.AddAttribute(declarationNode, attribute); + + return editor.GetChangedDocument(); + } + } +} +#endif diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresUnsafeAnalyzer.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresUnsafeAnalyzer.cs index d365a36977abd0..57f8bc961df4f9 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresUnsafeAnalyzer.cs +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresUnsafeAnalyzer.cs @@ -16,8 +16,8 @@ namespace ILLink.RoslynAnalyzer [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class RequiresUnsafeAnalyzer : RequiresAnalyzerBase { - private const string RequiresUnsafeAttribute = nameof(RequiresUnsafeAttribute); - public const string FullyQualifiedRequiresUnsafeAttribute = "System.Diagnostics.CodeAnalysis." + RequiresUnsafeAttribute; + internal const string RequiresUnsafeAttributeName = "RequiresUnsafeAttribute"; + public const string FullyQualifiedRequiresUnsafeAttribute = "System.Diagnostics.CodeAnalysis." + RequiresUnsafeAttributeName; private static readonly DiagnosticDescriptor s_requiresUnsafeOnStaticCtor = DiagnosticDescriptors.GetDiagnosticDescriptor(DiagnosticId.RequiresUnsafeOnStaticConstructor); private static readonly DiagnosticDescriptor s_requiresUnsafeOnEntryPoint = DiagnosticDescriptors.GetDiagnosticDescriptor(DiagnosticId.RequiresUnsafeOnEntryPoint); @@ -27,7 +27,7 @@ public sealed class RequiresUnsafeAnalyzer : RequiresAnalyzerBase public override ImmutableArray SupportedDiagnostics => ImmutableArray.Create(s_requiresUnsafeRule, s_requiresUnsafeAttributeMismatch, s_requiresUnsafeOnStaticCtor, s_requiresUnsafeOnEntryPoint); - private protected override string RequiresAttributeName => RequiresUnsafeAttribute; + private protected override string RequiresAttributeName => RequiresUnsafeAttributeName; internal override string RequiresAttributeFullyQualifiedName => FullyQualifiedRequiresUnsafeAttribute; @@ -84,15 +84,11 @@ protected override bool IsInRequiresScope(ISymbol containingSymbol, in Diagnosti return true; if (node is ConstructorDeclarationSyntax ctor && ctor.Modifiers.Any(SyntaxKind.UnsafeKeyword)) return true; + if (node is FieldDeclarationSyntax field && field.Modifiers.Any(SyntaxKind.UnsafeKeyword)) + return true; if (node is TypeDeclarationSyntax type && type.Modifiers.Any(SyntaxKind.UnsafeKeyword)) return true; - // Break out of lambdas/anonymous methods - they create a new scope - if (node.IsKind(SyntaxKind.AnonymousMethodExpression) - || node.IsKind(SyntaxKind.SimpleLambdaExpression) - || node.IsKind(SyntaxKind.ParenthesizedLambdaExpression)) - break; - node = node.Parent; } diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/UnsafeMethodMissingRequiresUnsafeAnalyzer.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/UnsafeMethodMissingRequiresUnsafeAnalyzer.cs new file mode 100644 index 00000000000000..fc0508f5035c5f --- /dev/null +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/UnsafeMethodMissingRequiresUnsafeAnalyzer.cs @@ -0,0 +1,73 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if DEBUG +using System.Collections.Immutable; +using ILLink.Shared; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Diagnostics; + +namespace ILLink.RoslynAnalyzer +{ + [DiagnosticAnalyzer (LanguageNames.CSharp)] + public sealed class UnsafeMethodMissingRequiresUnsafeAnalyzer : DiagnosticAnalyzer + { + private static readonly DiagnosticDescriptor s_rule = DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.UnsafeMethodMissingRequiresUnsafe, diagnosticSeverity: DiagnosticSeverity.Info); + + public override ImmutableArray SupportedDiagnostics => ImmutableArray.Create (s_rule); + + public override void Initialize (AnalysisContext context) + { + context.EnableConcurrentExecution (); + context.ConfigureGeneratedCodeAnalysis (GeneratedCodeAnalysisFlags.None); + context.RegisterCompilationStartAction (context => { + if (!context.Options.IsMSBuildPropertyValueTrue (MSBuildPropertyOptionNames.EnableUnsafeAnalyzer)) + return; + + if (context.Compilation.GetTypeByMetadataName (RequiresUnsafeAnalyzer.FullyQualifiedRequiresUnsafeAttribute) is null) + return; + + context.RegisterSymbolAction ( + AnalyzeMethod, + SymbolKind.Method); + }); + } + + private static void AnalyzeMethod (SymbolAnalysisContext context) + { + if (context.Symbol is not IMethodSymbol method) + return; + + if (!HasPointerInSignature (method)) + return; + + if (method.HasAttribute (RequiresUnsafeAnalyzer.RequiresUnsafeAttributeName)) + return; + + // For property/indexer accessors, check the containing property instead + if (method.AssociatedSymbol is IPropertySymbol property + && property.HasAttribute (RequiresUnsafeAnalyzer.RequiresUnsafeAttributeName)) + return; + + foreach (var location in method.Locations) { + context.ReportDiagnostic (Diagnostic.Create (s_rule, location, method.GetDisplayName ())); + } + } + + private static bool HasPointerInSignature (IMethodSymbol method) + { + if (IsPointerType (method.ReturnType)) + return true; + + foreach (var param in method.Parameters) { + if (IsPointerType (param.Type)) + return true; + } + + return false; + } + + private static bool IsPointerType (ITypeSymbol type) => type is IPointerTypeSymbol or IFunctionPointerTypeSymbol; + } +} +#endif diff --git a/src/tools/illink/src/ILLink.Shared/DiagnosticId.cs b/src/tools/illink/src/ILLink.Shared/DiagnosticId.cs index 6d1c738dea865d..d1224b487188f3 100644 --- a/src/tools/illink/src/ILLink.Shared/DiagnosticId.cs +++ b/src/tools/illink/src/ILLink.Shared/DiagnosticId.cs @@ -226,6 +226,7 @@ public enum DiagnosticId RequiresUnsafeAttributeMismatch = 5001, RequiresUnsafeOnStaticConstructor = 5002, RequiresUnsafeOnEntryPoint = 5003, + UnsafeMethodMissingRequiresUnsafe = 5004, _EndRequiresUnsafeWarningsSentinel, #endif } diff --git a/src/tools/illink/src/ILLink.Shared/SharedStrings.resx b/src/tools/illink/src/ILLink.Shared/SharedStrings.resx index 65a4972e5eec82..0625ab61ef41a2 100644 --- a/src/tools/illink/src/ILLink.Shared/SharedStrings.resx +++ b/src/tools/illink/src/ILLink.Shared/SharedStrings.resx @@ -1293,4 +1293,10 @@ The use of 'RequiresUnsafeAttribute' on entry points is disallowed since the method will be called from outside the visible app. + + Methods with pointer types in their signature should be annotated with 'RequiresUnsafeAttribute'. + + + Method '{0}' has pointer types in its signature but is not annotated with 'RequiresUnsafeAttribute'. + diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresUnsafeAnalyzerTests.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresUnsafeAnalyzerTests.cs index c34b04caca8215..49a709960ca8c6 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresUnsafeAnalyzerTests.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresUnsafeAnalyzerTests.cs @@ -20,7 +20,7 @@ public class RequiresUnsafeAnalyzerTests namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } }"; @@ -396,6 +396,70 @@ public unsafe C() await VerifyRequiresUnsafeAnalyzer(source: src); } + + [Fact] + public async Task RequiresUnsafeInsideLambdaInUnsafeMethod() + { + var src = """ + using System; + using System.Diagnostics.CodeAnalysis; + + public class C + { + [RequiresUnsafe] + public int M1() => 0; + + public unsafe void M2() + { + Action a = () => M1(); + a(); + } + } + """; + + await VerifyRequiresUnsafeAnalyzer(source: src); + } + + [Fact] + public async Task RequiresUnsafeInsideAnonymousDelegateInUnsafeMethod() + { + var src = """ + using System; + using System.Diagnostics.CodeAnalysis; + + public class C + { + [RequiresUnsafe] + public int M1() => 0; + + public unsafe void M2() + { + Action a = delegate { M1(); }; + a(); + } + } + """; + + await VerifyRequiresUnsafeAnalyzer(source: src); + } + + [Fact] + public async Task RequiresUnsafeInsideUnsafeFieldInitializer() + { + var src = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + [RequiresUnsafe] + public static int M1() => 0; + + private static unsafe int _field = M1(); + } + """; + + await VerifyRequiresUnsafeAnalyzer(source: src); + } } } #endif diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresUnsafeCodeFixTests.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresUnsafeCodeFixTests.cs index 244dbfb562acb1..3ef160f71e6eb9 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresUnsafeCodeFixTests.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/RequiresUnsafeCodeFixTests.cs @@ -72,7 +72,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -98,7 +98,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -133,7 +133,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -158,7 +158,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -193,7 +193,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -218,7 +218,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -256,7 +256,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -284,7 +284,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -322,7 +322,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -354,7 +354,7 @@ public unsafe void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -386,7 +386,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -418,7 +418,7 @@ public unsafe int P namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -451,7 +451,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -480,7 +480,7 @@ public class C namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -505,7 +505,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -537,7 +537,7 @@ public static void M1() { } namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -562,7 +562,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -594,7 +594,7 @@ public static void M1() { } namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -619,7 +619,7 @@ public static void M1() { } namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -651,7 +651,7 @@ public class C namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -679,7 +679,7 @@ public int P namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -715,7 +715,7 @@ public int P namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -737,7 +737,7 @@ public int P namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -776,7 +776,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -806,7 +806,7 @@ int Local() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -845,7 +845,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -873,7 +873,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -912,7 +912,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -940,7 +940,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -977,7 +977,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1004,7 +1004,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1045,7 +1045,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1073,7 +1073,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1112,7 +1112,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } @@ -1147,7 +1147,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } @@ -1195,7 +1195,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } @@ -1232,7 +1232,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } @@ -1282,7 +1282,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } @@ -1320,7 +1320,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } @@ -1367,7 +1367,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1393,7 +1393,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1436,7 +1436,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1464,7 +1464,7 @@ public void M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1501,7 +1501,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1523,7 +1523,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1571,7 +1571,7 @@ public C() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1593,7 +1593,7 @@ public C() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1646,7 +1646,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1672,7 +1672,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1728,7 +1728,7 @@ public int M2(int x) namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1759,7 +1759,7 @@ public int M2(int x) namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1796,7 +1796,7 @@ public int M2(bool condition) namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1825,7 +1825,7 @@ public int M2(bool condition) namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1862,7 +1862,7 @@ public int M2() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; @@ -1893,7 +1893,7 @@ static int LocalFunc() namespace System.Diagnostics.CodeAnalysis { - [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)] + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] public sealed class RequiresUnsafeAttribute : Attribute { } } """; diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/UnsafeMethodMissingRequiresUnsafeTests.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/UnsafeMethodMissingRequiresUnsafeTests.cs new file mode 100644 index 00000000000000..b606022621af78 --- /dev/null +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/UnsafeMethodMissingRequiresUnsafeTests.cs @@ -0,0 +1,278 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if DEBUG +using System; +using System.Threading.Tasks; +using ILLink.Shared; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.Testing; +using Microsoft.CodeAnalysis.Text; +using Xunit; +using VerifyCS = ILLink.RoslynAnalyzer.Tests.CSharpCodeFixVerifier< + ILLink.RoslynAnalyzer.UnsafeMethodMissingRequiresUnsafeAnalyzer, + ILLink.CodeFix.UnsafeMethodMissingRequiresUnsafeCodeFixProvider>; + +namespace ILLink.RoslynAnalyzer.Tests +{ + public class UnsafeMethodMissingRequiresUnsafeTests + { + static readonly string RequiresUnsafeAttributeDefinition = """ + + namespace System.Diagnostics.CodeAnalysis + { + [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, Inherited = false)] + public sealed class RequiresUnsafeAttribute : Attribute { } + } + """; + + static Task VerifyCodeFix( + string source, + string fixedSource, + DiagnosticResult[] baselineExpected, + DiagnosticResult[] fixedExpected, + int? numberOfIterations = null) + { + var test = new VerifyCS.Test { + TestCode = source, + FixedCode = fixedSource, + }; + test.ExpectedDiagnostics.AddRange(baselineExpected); + test.TestState.AnalyzerConfigFiles.Add( + ("/.editorconfig", SourceText.From(@$" +is_global = true +build_property.{MSBuildPropertyOptionNames.EnableUnsafeAnalyzer} = true"))); + test.SolutionTransforms.Add((solution, projectId) => { + var project = solution.GetProject(projectId)!; + var compilationOptions = (CSharpCompilationOptions)project.CompilationOptions!; + compilationOptions = compilationOptions.WithAllowUnsafe(true); + return solution.WithProjectCompilationOptions(projectId, compilationOptions); + }); + if (numberOfIterations != null) { + test.NumberOfIncrementalIterations = numberOfIterations; + test.NumberOfFixAllIterations = numberOfIterations; + } + test.FixedState.ExpectedDiagnostics.AddRange(fixedExpected); + return test.RunAsync(); + } + + static Task VerifyNoDiagnostic(string source) + { + var test = new VerifyCS.Test { + TestCode = source, + FixedCode = source, + }; + test.TestState.AnalyzerConfigFiles.Add( + ("/.editorconfig", SourceText.From(@$" +is_global = true +build_property.{MSBuildPropertyOptionNames.EnableUnsafeAnalyzer} = true"))); + test.SolutionTransforms.Add((solution, projectId) => { + var project = solution.GetProject(projectId)!; + var compilationOptions = (CSharpCompilationOptions)project.CompilationOptions!; + compilationOptions = compilationOptions.WithAllowUnsafe(true); + return solution.WithProjectCompilationOptions(projectId, compilationOptions); + }); + return test.RunAsync(); + } + + [Fact] + public async Task MethodAlreadyAttributed_NoDiagnostic() + { + var source = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + [RequiresUnsafe] + public unsafe int* M() => default; + } + """ + RequiresUnsafeAttributeDefinition; + + await VerifyNoDiagnostic(source); + } + + [Fact] + public async Task UnsafeMethodWithoutPointerTypes_NoDiagnostic() + { + var source = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + public unsafe void M() { } + } + """ + RequiresUnsafeAttributeDefinition; + + await VerifyNoDiagnostic(source); + } + + [Fact] + public async Task NonUnsafeMethod_NoDiagnostic() + { + var source = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + public void M() { } + } + """ + RequiresUnsafeAttributeDefinition; + + await VerifyNoDiagnostic(source); + } + + [Fact] + public async Task CodeFix_MethodReturningPointer_AddsAttribute() + { + var source = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + public unsafe int* M() => default; + } + """ + RequiresUnsafeAttributeDefinition; + + var fixedSource = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + [RequiresUnsafe] + public unsafe int* M() => default; + } + """ + RequiresUnsafeAttributeDefinition; + + await VerifyCodeFix( + source, + fixedSource, + baselineExpected: new[] { + VerifyCS.Diagnostic(DiagnosticId.UnsafeMethodMissingRequiresUnsafe) + .WithSpan(5, 24, 5, 25) + .WithArguments("C.M()") + .WithSeverity(DiagnosticSeverity.Info) + }, + fixedExpected: Array.Empty ()); + } + + [Fact] + public async Task CodeFix_MethodTakingPointerParam_AddsAttribute() + { + var source = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + public unsafe void M(int* p) { } + } + """ + RequiresUnsafeAttributeDefinition; + + var fixedSource = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + [RequiresUnsafe] + public unsafe void M(int* p) { } + } + """ + RequiresUnsafeAttributeDefinition; + + await VerifyCodeFix( + source, + fixedSource, + baselineExpected: new[] { + VerifyCS.Diagnostic(DiagnosticId.UnsafeMethodMissingRequiresUnsafe) + .WithSpan(5, 24, 5, 25) + .WithArguments("C.M(Int32*)") + .WithSeverity(DiagnosticSeverity.Info) + }, + fixedExpected: Array.Empty ()); + } + + [Fact] + public async Task CodeFix_MethodTakingFunctionPointer_AddsAttribute() + { + var source = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + public unsafe void M(delegate* f) { } + } + """ + RequiresUnsafeAttributeDefinition; + + var fixedSource = """ + using System.Diagnostics.CodeAnalysis; + + public class C + { + [RequiresUnsafe] + public unsafe void M(delegate* f) { } + } + """ + RequiresUnsafeAttributeDefinition; + + await VerifyCodeFix( + source, + fixedSource, + baselineExpected: new[] { + VerifyCS.Diagnostic(DiagnosticId.UnsafeMethodMissingRequiresUnsafe) + .WithSpan(5, 24, 5, 25) + .WithArguments("C.M(delegate*)") + .WithSeverity(DiagnosticSeverity.Info) + }, + fixedExpected: Array.Empty ()); + } + + [Fact] + public async Task CodeFix_PropertyReturningPointer_AddsAttribute() + { + var source = """ + using System.Diagnostics.CodeAnalysis; + + public unsafe class C + { + public int* P => default; + } + """ + RequiresUnsafeAttributeDefinition; + + var fixedSource = """ + using System.Diagnostics.CodeAnalysis; + + public unsafe class C + { + [RequiresUnsafe] + public int* P => default; + } + """ + RequiresUnsafeAttributeDefinition; + + await VerifyCodeFix( + source, + fixedSource, + baselineExpected: new[] { + VerifyCS.Diagnostic(DiagnosticId.UnsafeMethodMissingRequiresUnsafe) + .WithSpan(5, 22, 5, 29) + .WithArguments("C.P.get") + .WithSeverity(DiagnosticSeverity.Info) + }, + fixedExpected: Array.Empty ()); + } + + [Fact] + public async Task PropertyAlreadyAttributed_NoDiagnostic() + { + var source = """ + using System.Diagnostics.CodeAnalysis; + + public unsafe class C + { + [RequiresUnsafe] + public int* P => default; + } + """ + RequiresUnsafeAttributeDefinition; + + await VerifyNoDiagnostic(source); + } + } +} +#endif diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/CommandLine.DependenciesTests.g.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/CommandLine.DependenciesTests.g.cs new file mode 100644 index 00000000000000..89f7d62c3e1375 --- /dev/null +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/CommandLine.DependenciesTests.g.cs @@ -0,0 +1,19 @@ +using System; +using System.Threading.Tasks; +using Xunit; + +namespace ILLink.RoslynAnalyzer.Tests.CommandLine +{ + public sealed partial class DependenciesTests : LinkerTestBase + { + + protected override string TestSuiteName => "CommandLine.Dependencies"; + + [Fact] + public Task MultipleEntryPointRoots_Lib() + { + return RunTest(allowMissingWarnings: true); + } + + } +}