-
Notifications
You must be signed in to change notification settings - Fork 5k
Add Sve.IsSupported support #97814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add Sve.IsSupported support #97814
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cf31dd8
Add Sve.IsSupported support
a74nh 6f1633c
Remove debugging
a74nh f4c6bf7
Add RequiresPreviewFeaturesAttribute in PlatformNotSupported file
kunalspathak fe0c6c6
fix the base class name
kunalspathak 15cd4a5
Add mono checks
a74nh f8dee50
Review cleanups
a74nh 62f3a58
Remove dummy sve test
a74nh 92f736a
Fix Sve.PlatformNotSupported.cs
a74nh 25532ae
Remove intrinsic marking
a74nh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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; } } | ||
} | ||
} | ||
a74nh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
31 changes: 31 additions & 0 deletions
31
src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sve.cs
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.