forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Sve.IsSupported support (dotnet#97814)
* Add Sve.IsSupported support * Remove debugging * Add RequiresPreviewFeaturesAttribute in PlatformNotSupported file * fix the base class name * Add mono checks * Review cleanups * Remove dummy sve test * Fix Sve.PlatformNotSupported.cs * Remove intrinsic marking --------- Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
- Loading branch information
1 parent
9655619
commit b449152
Showing
15 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
/*****************************************************************************/ | ||
#ifndef HARDWARE_INTRINSIC | ||
#error Define HARDWARE_INTRINSIC before including this file | ||
#endif | ||
/*****************************************************************************/ | ||
|
||
// clang-format off | ||
|
||
#ifdef FEATURE_HW_INTRINSICS | ||
// *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** | ||
// ISA Function name SIMD size NumArg EncodesExtraTypeArg Instructions Category Flags | ||
// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE} | ||
// *************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************** | ||
// SVE Intrinsics | ||
|
||
|
||
#endif // FEATURE_HW_INTRINSIC | ||
|
||
#undef HARDWARE_INTRINSIC | ||
|
||
// clang-format on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.PlatformNotSupported.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// 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.Intrinsics; | ||
using System.Numerics; | ||
|
||
namespace System.Runtime.Intrinsics.Arm | ||
{ | ||
/// <summary> | ||
/// This class provides access to the ARM SVE hardware instructions via intrinsics | ||
/// </summary> | ||
[CLSCompliant(false)] | ||
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Sve is in preview.")] | ||
#if SYSTEM_PRIVATE_CORELIB | ||
public | ||
#else | ||
internal | ||
#endif | ||
abstract class Sve : AdvSimd | ||
{ | ||
internal Sve() { } | ||
|
||
public static new bool IsSupported { [Intrinsic] get { return false; } } | ||
|
||
public new abstract class Arm64 : AdvSimd.Arm64 | ||
{ | ||
internal Arm64() { } | ||
|
||
public static new bool IsSupported { [Intrinsic] get { return false; } } | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// 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.Intrinsics; | ||
using System.Numerics; | ||
|
||
namespace System.Runtime.Intrinsics.Arm | ||
{ | ||
/// <summary> | ||
/// This class provides access to the ARM SVE hardware instructions via intrinsics | ||
/// </summary> | ||
[Intrinsic] | ||
[CLSCompliant(false)] | ||
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Sve is in preview.")] | ||
public abstract class Sve : AdvSimd | ||
{ | ||
internal Sve() { } | ||
|
||
public static new bool IsSupported { get => IsSupported; } | ||
|
||
[Intrinsic] | ||
public new abstract class Arm64 : AdvSimd.Arm64 | ||
{ | ||
internal Arm64() { } | ||
|
||
public static new bool IsSupported { get => IsSupported; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace JIT.HardwareIntrinsics.Arm._Sve | ||
{ | ||
public static partial class Program | ||
{ | ||
static Program() | ||
{ | ||
JIT.HardwareIntrinsics.Arm.Program.PrintSupportedIsa(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>Embedded</DebugType> | ||
<Optimize /> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="Program.Sve.cs" /> | ||
<Compile Include="..\Shared\Helpers.cs" /> | ||
<Compile Include="..\Shared\Program.cs" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>Embedded</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="Program.Sve.cs" /> | ||
<Compile Include="..\Shared\Helpers.cs" /> | ||
<Compile Include="..\Shared\Program.cs" /> | ||
</ItemGroup> | ||
</Project> |