From 2cc8a13354b1e984bad1ade41472d579aa6f43d1 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 6 Mar 2023 10:02:54 -0800 Subject: [PATCH 1/2] Ensure that the new Vector512 related ISAs are covered by ILLink Substitutions --- .../ILLink.Substitutions.NoX86Intrinsics.xml | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoX86Intrinsics.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoX86Intrinsics.xml index 859ceebde69d9..9ed12df60f026 100644 --- a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoX86Intrinsics.xml +++ b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoX86Intrinsics.xml @@ -3,6 +3,9 @@ + + + @@ -21,6 +24,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -111,6 +150,5 @@ - From df34b304c1d7d6955dce0a6f92516fd20633ccba Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 6 Mar 2023 10:38:35 -0800 Subject: [PATCH 2/2] Define the Avx512F and derived classes --- .../System.Private.CoreLib.Shared.projitems | 10 ++- .../X86/Avx512BW.PlatformNotSupported.cs | 33 ++++++++++ .../System/Runtime/Intrinsics/X86/Avx512BW.cs | 34 ++++++++++ .../X86/Avx512CD.PlatformNotSupported.cs | 33 ++++++++++ .../System/Runtime/Intrinsics/X86/Avx512CD.cs | 34 ++++++++++ .../X86/Avx512DQ.PlatformNotSupported.cs | 33 ++++++++++ .../System/Runtime/Intrinsics/X86/Avx512DQ.cs | 34 ++++++++++ .../X86/Avx512F.PlatformNotSupported.cs | 33 ++++++++++ .../System/Runtime/Intrinsics/X86/Avx512F.cs | 34 ++++++++++ .../ref/System.Runtime.Intrinsics.cs | 66 ++++++++++++++++++- 10 files changed, 342 insertions(+), 2 deletions(-) create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.PlatformNotSupported.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512CD.PlatformNotSupported.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512CD.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.PlatformNotSupported.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.PlatformNotSupported.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index f28e4c0ac8eba..6f2d52f360447 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -2422,6 +2422,10 @@ + + + + @@ -2442,6 +2446,10 @@ + + + + @@ -2574,4 +2582,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.PlatformNotSupported.cs new file mode 100644 index 0000000000000..31ae3725d46fb --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.PlatformNotSupported.cs @@ -0,0 +1,33 @@ +// 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.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; + +namespace System.Runtime.Intrinsics.X86 +{ + /// This class provides access to X86 AVX512BW hardware instructions via intrinsics + [CLSCompliant(false)] + public abstract class Avx512BW : Avx512F + { + internal Avx512BW() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + + public new abstract class VL : Avx512F.VL + { + internal VL() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + } + + public new abstract class X64 : Avx512F.X64 + { + internal X64() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + } + } +} 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 new file mode 100644 index 0000000000000..b0fe1c60f8b33 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512BW.cs @@ -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; + +namespace System.Runtime.Intrinsics.X86 +{ + /// This class provides access to X86 AVX512BW hardware instructions via intrinsics + [Intrinsic] + [CLSCompliant(false)] + public abstract class Avx512BW : Avx512F + { + internal Avx512BW() { } + + public static new bool IsSupported { get => IsSupported; } + + [Intrinsic] + public new abstract class VL : Avx512F.VL + { + internal VL() { } + + public static new bool IsSupported { get => IsSupported; } + } + + [Intrinsic] + public new abstract class X64 : Avx512F.X64 + { + internal X64() { } + + public static new bool IsSupported { get => IsSupported; } + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512CD.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512CD.PlatformNotSupported.cs new file mode 100644 index 0000000000000..6004737e1dd8b --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512CD.PlatformNotSupported.cs @@ -0,0 +1,33 @@ +// 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.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; + +namespace System.Runtime.Intrinsics.X86 +{ + /// This class provides access to X86 AVX512CD hardware instructions via intrinsics + [CLSCompliant(false)] + public abstract class Avx512CD : Avx512F + { + internal Avx512CD() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + + public new abstract class VL : Avx512F.VL + { + internal VL() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + } + + public new abstract class X64 : Avx512F.X64 + { + internal X64() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512CD.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512CD.cs new file mode 100644 index 0000000000000..c2a80f48aefbe --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512CD.cs @@ -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; + +namespace System.Runtime.Intrinsics.X86 +{ + /// This class provides access to X86 AVX512CD hardware instructions via intrinsics + [Intrinsic] + [CLSCompliant(false)] + public abstract class Avx512CD : Avx512F + { + internal Avx512CD() { } + + public static new bool IsSupported { get => IsSupported; } + + [Intrinsic] + public new abstract class VL : Avx512F.VL + { + internal VL() { } + + public static new bool IsSupported { get => IsSupported; } + } + + [Intrinsic] + public new abstract class X64 : Avx512F.X64 + { + internal X64() { } + + public static new bool IsSupported { get => IsSupported; } + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.PlatformNotSupported.cs new file mode 100644 index 0000000000000..bdab068b8484b --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.PlatformNotSupported.cs @@ -0,0 +1,33 @@ +// 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.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; + +namespace System.Runtime.Intrinsics.X86 +{ + /// This class provides access to X86 AVX512DQ hardware instructions via intrinsics + [CLSCompliant(false)] + public abstract class Avx512DQ : Avx512F + { + internal Avx512DQ() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + + public new abstract class VL : Avx512F.VL + { + internal VL() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + } + + public new abstract class X64 : Avx512F.X64 + { + internal X64() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + } + } +} 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 new file mode 100644 index 0000000000000..01004e8b8e9ee --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512DQ.cs @@ -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; + +namespace System.Runtime.Intrinsics.X86 +{ + /// This class provides access to X86 AVX512DQ hardware instructions via intrinsics + [Intrinsic] + [CLSCompliant(false)] + public abstract class Avx512DQ : Avx512F + { + internal Avx512DQ() { } + + public static new bool IsSupported { get => IsSupported; } + + [Intrinsic] + public new abstract class VL : Avx512F.VL + { + internal VL() { } + + public static new bool IsSupported { get => IsSupported; } + } + + [Intrinsic] + public new abstract class X64 : Avx512F.X64 + { + internal X64() { } + + public static new bool IsSupported { get => IsSupported; } + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.PlatformNotSupported.cs new file mode 100644 index 0000000000000..4d23668759a6a --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.PlatformNotSupported.cs @@ -0,0 +1,33 @@ +// 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.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; + +namespace System.Runtime.Intrinsics.X86 +{ + /// This class provides access to X86 AVX512F hardware instructions via intrinsics + [CLSCompliant(false)] + public abstract class Avx512F : Avx2 + { + internal Avx512F() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + + public abstract class VL + { + internal VL() { } + + public static bool IsSupported { [Intrinsic] get { return false; } } + } + + public new abstract class X64 : Avx2.X64 + { + internal X64() { } + + public static new bool IsSupported { [Intrinsic] get { return false; } } + } + } +} 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 new file mode 100644 index 0000000000000..afd7d48a622c1 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx512F.cs @@ -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; + +namespace System.Runtime.Intrinsics.X86 +{ + /// This class provides access to X86 AVX512F hardware instructions via intrinsics + [Intrinsic] + [CLSCompliant(false)] + public abstract class Avx512F : Avx2 + { + internal Avx512F() { } + + public static new bool IsSupported { get => IsSupported; } + + [Intrinsic] + public abstract class VL + { + internal VL() { } + + public static bool IsSupported { get => IsSupported; } + } + + [Intrinsic] + public new abstract class X64 : Avx2.X64 + { + internal X64() { } + + public static new bool IsSupported { get => IsSupported; } + } + } +} diff --git a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs index e8a8b67d415c3..be37529d8ec9b 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -4374,6 +4374,70 @@ internal X64() { } } } [System.CLSCompliantAttribute(false)] + public abstract partial class Avx512BW : System.Runtime.Intrinsics.X86.Avx512F + { + internal Avx512BW() { } + public static new bool IsSupported { get { throw null; } } + public new abstract partial class VL : System.Runtime.Intrinsics.X86.Avx512F.VL + { + internal VL() { } + public static new bool IsSupported { get { throw null; } } + } + public new abstract partial class X64 : System.Runtime.Intrinsics.X86.Avx512F.X64 + { + internal X64() { } + public static new bool IsSupported { get { throw null; } } + } + } + [System.CLSCompliantAttribute(false)] + public abstract partial class Avx512CD : System.Runtime.Intrinsics.X86.Avx512F + { + internal Avx512CD() { } + public static new bool IsSupported { get { throw null; } } + public new abstract partial class VL : System.Runtime.Intrinsics.X86.Avx512F.VL + { + internal VL() { } + public static new bool IsSupported { get { throw null; } } + } + public new abstract partial class X64 : System.Runtime.Intrinsics.X86.Avx512F.X64 + { + internal X64() { } + public static new bool IsSupported { get { throw null; } } + } + } + [System.CLSCompliantAttribute(false)] + public abstract partial class Avx512DQ : System.Runtime.Intrinsics.X86.Avx512F + { + internal Avx512DQ() { } + public static new bool IsSupported { get { throw null; } } + public new abstract partial class VL : System.Runtime.Intrinsics.X86.Avx512F.VL + { + internal VL() { } + public static new bool IsSupported { get { throw null; } } + } + public new abstract partial class X64 : System.Runtime.Intrinsics.X86.Avx512F.X64 + { + internal X64() { } + public static new bool IsSupported { get { throw null; } } + } + } + [System.CLSCompliantAttribute(false)] + public abstract partial class Avx512F : System.Runtime.Intrinsics.X86.Avx2 + { + internal Avx512F() { } + public static new bool IsSupported { get { throw null; } } + public abstract partial class VL + { + internal VL() { } + public static bool IsSupported { get { throw null; } } + } + public new abstract partial class X64 : System.Runtime.Intrinsics.X86.Avx2.X64 + { + internal X64() { } + public static new bool IsSupported { get { throw null; } } + } + } + [System.CLSCompliantAttribute(false)] [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("AvxVnni is in preview.")] public abstract class AvxVnni : System.Runtime.Intrinsics.X86.Avx2 { @@ -5210,7 +5274,7 @@ internal X64() { } public static new bool IsSupported { get { throw null; } } } } - + [System.CLSCompliantAttribute(false)] public abstract partial class X86Base {