<Target Name="GetDocumentationFile"
Returns="$(DocumentationFile)"/>
+ <PropertyGroup>
+ <DefineConstants Condition="'$(IsPrerelease)' != 'false' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'">$(DefineConstants),USE_INTERNAL_ACCESSIBILITY</DefineConstants>
+ </PropertyGroup>
+
<!-- Adds Nullable annotation attributes to netstandard <= 2.0 builds -->
<Choose>
<When Condition="'$(Nullable)' != '' and ($(TargetFramework.StartsWith('netstandard1')) or '$(TargetFramework)' == 'netstandard2.0' or $(TargetFramework.StartsWith('netcoreapp2')) or '$(TargetFrameworkIdentifier)' == '.NETFramework')">
/// This class provides access to the ARM AdvSIMD hardware instructions via intrinsics
/// </summary>
[CLSCompliant(false)]
- public abstract class AdvSimd : ArmBase
+#if USE_INTERNAL_ACCESSIBILITY
+ internal
+#else
+ public
+#endif
+ abstract class AdvSimd : ArmBase
{
internal AdvSimd() { }
/// This class provides access to the ARM base hardware instructions via intrinsics
/// </summary>
[CLSCompliant(false)]
- public abstract class ArmBase
+#if USE_INTERNAL_ACCESSIBILITY
+ internal
+#else
+ public
+#endif
+ abstract class ArmBase
{
internal ArmBase() { }
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
+using System.Runtime.Intrinsics.Arm;
using System.Runtime.Intrinsics.X86;
#if SYSTEM_PRIVATE_CORELIB
Vector128<ulong> vecWide = Sse2.UnpackLow(vecNarrow, Vector128<byte>.Zero).AsUInt64();
Unsafe.WriteUnaligned<ulong>(ref Unsafe.As<char, byte>(ref outputBuffer), Sse2.X64.ConvertToUInt64(vecWide));
}
+ else if (AdvSimd.Arm64.IsSupported)
+ {
+ Vector128<byte> vecNarrow = AdvSimd.DuplicateToVector128(value).AsByte();
+ Vector128<ulong> vecWide = AdvSimd.Arm64.ZipLow(vecNarrow, Vector128<byte>.Zero).AsUInt64();
+ Unsafe.WriteUnaligned<ulong>(ref Unsafe.As<char, byte>(ref outputBuffer), vecWide.ToScalar());
+ }
else
{
if (BitConverter.IsLittleEndian)
<ItemGroup Condition="'$(IsPrerelease)' != 'false' AND '$(TargetFramework)' != '$(NetCoreAppCurrent)'">
<Compile Include="System\Globalization\GlobalizationMode.cs" />
<Compile Include="System\Runtime\Intrinsics\Intrinsics.Shims.cs" />
+ <Compile Include="$(CoreLibSharedDir)\System\Runtime\Intrinsics\Arm\AdvSimd.PlatformNotSupported.cs" Link="System\Runtime\Intrinsics\Arm\AdvSimd.PlatformNotSupported.cs" />
+ <Compile Include="$(CoreLibSharedDir)\System\Runtime\Intrinsics\Arm\ArmBase.PlatformNotSupported.cs" Link="System\Runtime\Intrinsics\Arm\ArmBase.PlatformNotSupported.cs" />
<Compile Include="System\ThrowHelper.cs" />
<Compile Include="System\Utf8Extensions.Portable.cs" />
<Compile Include="System\Utf8String.Portable.cs" />
public static Vector128<ulong> AsUInt64<T>(this Vector128<T> vector) where T : struct => throw new PlatformNotSupportedException();
public static T GetElement<T>(this Vector128<T> vector, int index) where T : struct => throw new PlatformNotSupportedException();
public static T ToScalar<T>(this Vector64<T> vector) where T : struct => throw new PlatformNotSupportedException();
+ public static unsafe Vector128<ulong> CreateScalar(ulong value) => throw new PlatformNotSupportedException();
+ public static T ToScalar<T>(this Vector128<T> vector) where T : struct => throw new PlatformNotSupportedException();
}
internal readonly struct Vector128<T>
where T : struct
}
}
-namespace System.Runtime.Intrinsics.Arm
+namespace System.Runtime.CompilerServices
{
- internal abstract class ArmBase
+ // Calls to methods or references to fields marked with this attribute may be replaced at
+ // some call sites with jit intrinsic expansions.
+ // Types marked with this attribute may be specially treated by the runtime/compiler.
+ [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Field, Inherited = false)]
+ internal sealed class IntrinsicAttribute : Attribute
{
- public abstract class Arm64
- {
- public const bool IsSupported = false;
- public static int LeadingZeroCount(ulong value) => throw new PlatformNotSupportedException();
- public static uint ReverseElementBits(ulong value) => throw new PlatformNotSupportedException();
- }
- public const bool IsSupported = false;
- public static int LeadingZeroCount(uint value) => throw new PlatformNotSupportedException();
- public static uint ReverseElementBits(uint value) => throw new PlatformNotSupportedException();
- }
-
- internal abstract class AdvSimd : ArmBase
- {
- public new abstract class Arm64 : ArmBase.Arm64
- {
- public static Vector64<byte> AddAcross(Vector64<byte> value) => throw new PlatformNotSupportedException();
- }
- public static Vector64<byte> PopCount(Vector64<byte> value) => throw new PlatformNotSupportedException();
}
}