diff --git a/.gitignore b/.gitignore
index 078e129dee0..c48971ae780 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,8 +20,6 @@ launchSettings.json
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
-x64/
-x86/
build/
bld/
[Bb]in/
diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
index ecc2fdd2a15..f895e30628d 100644
--- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
+++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
@@ -476,6 +476,13 @@
+
+
+
+
+
+
+
@@ -852,4 +859,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128.cs
new file mode 100644
index 00000000000..f61310e4e9f
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128.cs
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using Internal.Runtime.CompilerServices;
+
+namespace System.Runtime.Intrinsics
+{
+ [Intrinsic]
+ [DebuggerDisplay("{DisplayString,nq}")]
+ [DebuggerTypeProxy(typeof(Vector128DebugView<>))]
+ [StructLayout(LayoutKind.Sequential, Size = 16)]
+ public struct Vector128 where T : struct
+ {
+ // These fields exist to ensure the alignment is 8, rather than 1.
+ // This also allows the debug view to work https://github.com/dotnet/coreclr/issues/15694)
+ private ulong _00;
+ private ulong _01;
+
+ private unsafe string DisplayString
+ {
+ get
+ {
+ // The IsPrimitive check ends up working for `bool`, `char`, `IntPtr`, and `UIntPtr`
+ // which are not actually supported by any current architecture. This shouldn't be
+ // an issue however and greatly simplifies the check
+
+ if (typeof(T).IsPrimitive)
+ {
+ var items = new T[16 / Unsafe.SizeOf()];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), this);
+ return $"({string.Join(", ", items)})";
+ }
+ else
+ {
+ return SR.NotSupported_Type;
+ }
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128DebugView.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128DebugView.cs
new file mode 100644
index 00000000000..7119757b793
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128DebugView.cs
@@ -0,0 +1,118 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Internal.Runtime.CompilerServices;
+
+namespace System.Runtime.Intrinsics
+{
+ internal struct Vector128DebugView where T : struct
+ {
+ private Vector128 _value;
+
+ public Vector128DebugView(Vector128 value)
+ {
+ _value = value;
+ }
+
+ public byte[] ByteView
+ {
+ get
+ {
+ var items = new byte[16];
+ Unsafe.WriteUnaligned(ref items[0], _value);
+ return items;
+ }
+ }
+
+ public double[] DoubleView
+ {
+ get
+ {
+ var items = new double[2];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public short[] Int16View
+ {
+ get
+ {
+ var items = new short[8];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public int[] Int32View
+ {
+ get
+ {
+ var items = new int[4];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public long[] Int64View
+ {
+ get
+ {
+ var items = new long[2];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public sbyte[] SByteView
+ {
+ get
+ {
+ var items = new sbyte[16];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public float[] SingleView
+ {
+ get
+ {
+ var items = new float[4];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public ushort[] UInt16View
+ {
+ get
+ {
+ var items = new ushort[8];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public uint[] UInt32View
+ {
+ get
+ {
+ var items = new uint[4];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public ulong[] UInt64View
+ {
+ get
+ {
+ var items = new ulong[2];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256.cs
new file mode 100644
index 00000000000..88fd9973e33
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256.cs
@@ -0,0 +1,46 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using Internal.Runtime.CompilerServices;
+
+namespace System.Runtime.Intrinsics
+{
+ [Intrinsic]
+ [DebuggerDisplay("{DisplayString,nq}")]
+ [DebuggerTypeProxy(typeof(Vector256DebugView<>))]
+ [StructLayout(LayoutKind.Sequential, Size = 32)]
+ public struct Vector256 where T : struct
+ {
+ // These fields exist to ensure the alignment is 8, rather than 1.
+ // This also allows the debug view to work https://github.com/dotnet/coreclr/issues/15694)
+ private ulong _00;
+ private ulong _01;
+ private ulong _02;
+ private ulong _03;
+
+ private unsafe string DisplayString
+ {
+ get
+ {
+ // The IsPrimitive check ends up working for `bool`, `char`, `IntPtr`, and `UIntPtr`
+ // which are not actually supported by any current architecture. This shouldn't be
+ // an issue however and greatly simplifies the check
+
+ if (typeof(T).IsPrimitive)
+ {
+ var items = new T[32 / Unsafe.SizeOf()];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), this);
+ return $"({string.Join(", ", items)})";
+ }
+ else
+ {
+ return SR.NotSupported_Type;
+ }
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256DebugView.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256DebugView.cs
new file mode 100644
index 00000000000..f07277604c2
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256DebugView.cs
@@ -0,0 +1,118 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Internal.Runtime.CompilerServices;
+
+namespace System.Runtime.Intrinsics
+{
+ internal struct Vector256DebugView where T : struct
+ {
+ private Vector256 _value;
+
+ public Vector256DebugView(Vector256 value)
+ {
+ _value = value;
+ }
+
+ public byte[] ByteView
+ {
+ get
+ {
+ var items = new byte[32];
+ Unsafe.WriteUnaligned(ref items[0], _value);
+ return items;
+ }
+ }
+
+ public double[] DoubleView
+ {
+ get
+ {
+ var items = new double[4];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public short[] Int16View
+ {
+ get
+ {
+ var items = new short[16];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public int[] Int32View
+ {
+ get
+ {
+ var items = new int[8];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public long[] Int64View
+ {
+ get
+ {
+ var items = new long[4];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public sbyte[] SByteView
+ {
+ get
+ {
+ var items = new sbyte[32];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public float[] SingleView
+ {
+ get
+ {
+ var items = new float[8];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public ushort[] UInt16View
+ {
+ get
+ {
+ var items = new ushort[16];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public uint[] UInt32View
+ {
+ get
+ {
+ var items = new uint[8];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public ulong[] UInt64View
+ {
+ get
+ {
+ var items = new ulong[4];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64.cs
new file mode 100644
index 00000000000..776fe2017db
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64.cs
@@ -0,0 +1,43 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using Internal.Runtime.CompilerServices;
+
+namespace System.Runtime.Intrinsics
+{
+ [Intrinsic]
+ [DebuggerDisplay("{DisplayString,nq}")]
+ [DebuggerTypeProxy(typeof(Vector64DebugView<>))]
+ [StructLayout(LayoutKind.Sequential, Size = 8)]
+ public struct Vector64 where T : struct
+ {
+ // These fields exist to ensure the alignment is 8, rather than 1.
+ // This also allows the debug view to work https://github.com/dotnet/coreclr/issues/15694)
+ private ulong _00;
+
+ private unsafe string DisplayString
+ {
+ get
+ {
+ // The IsPrimitive check ends up working for `bool`, `char`, `IntPtr`, and `UIntPtr`
+ // which are not actually supported by any current architecture. This shouldn't be
+ // an issue however and greatly simplifies the check
+
+ if (typeof(T).IsPrimitive)
+ {
+ var items = new T[8 / Unsafe.SizeOf()];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), this);
+ return $"({string.Join(", ", items)})";
+ }
+ else
+ {
+ return SR.NotSupported_Type;
+ }
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64DebugView.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64DebugView.cs
new file mode 100644
index 00000000000..129832a3c39
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64DebugView.cs
@@ -0,0 +1,118 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using Internal.Runtime.CompilerServices;
+
+namespace System.Runtime.Intrinsics
+{
+ internal struct Vector64DebugView where T : struct
+ {
+ private Vector64 _value;
+
+ public Vector64DebugView(Vector64 value)
+ {
+ _value = value;
+ }
+
+ public byte[] ByteView
+ {
+ get
+ {
+ var items = new byte[8];
+ Unsafe.WriteUnaligned(ref items[0], _value);
+ return items;
+ }
+ }
+
+ public double[] DoubleView
+ {
+ get
+ {
+ var items = new double[1];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public short[] Int16View
+ {
+ get
+ {
+ var items = new short[4];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public int[] Int32View
+ {
+ get
+ {
+ var items = new int[2];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public long[] Int64View
+ {
+ get
+ {
+ var items = new long[1];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public sbyte[] SByteView
+ {
+ get
+ {
+ var items = new sbyte[8];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public float[] SingleView
+ {
+ get
+ {
+ var items = new float[2];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public ushort[] UInt16View
+ {
+ get
+ {
+ var items = new ushort[4];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public uint[] UInt32View
+ {
+ get
+ {
+ var items = new uint[2];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+
+ public ulong[] UInt64View
+ {
+ get
+ {
+ var items = new ulong[1];
+ Unsafe.WriteUnaligned(ref Unsafe.As(ref items[0]), _value);
+ return items;
+ }
+ }
+ }
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.PlatformNotSupported.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.PlatformNotSupported.cs
new file mode 100644
index 00000000000..5df8f266dfa
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.PlatformNotSupported.cs
@@ -0,0 +1,86 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.Intrinsics;
+
+namespace System.Runtime.Intrinsics.X86
+{
+ ///
+ /// This class provides access to Intel AES hardware instructions via intrinsics
+ ///
+ [CLSCompliant(false)]
+ public static class Aes
+ {
+ public static bool IsSupported { get { return false; } }
+
+ ///
+ /// __m128i _mm_aesdec_si128 (__m128i a, __m128i RoundKey)
+ /// AESDEC xmm, xmm/m128
+ ///
+ public static Vector128 Decrypt(Vector128 value, Vector128 roundKey) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm_aesdec_si128 (__m128i a, __m128i RoundKey)
+ /// AESDEC xmm, xmm/m128
+ ///
+ public static Vector128 Decrypt(Vector128 value, Vector128 roundKey) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128i _mm_aesdeclast_si128 (__m128i a, __m128i RoundKey)
+ /// AESDECLAST xmm, xmm/m128
+ ///
+ public static Vector128 DecryptLast(Vector128 value, Vector128 roundKey) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm_aesdeclast_si128 (__m128i a, __m128i RoundKey)
+ /// AESDECLAST xmm, xmm/m128
+ ///
+ public static Vector128 DecryptLast(Vector128 value, Vector128 roundKey) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128i _mm_aesenc_si128 (__m128i a, __m128i RoundKey)
+ /// AESENC xmm, xmm/m128
+ ///
+ public static Vector128 Encrypt(Vector128 value, Vector128 roundKey) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm_aesenc_si128 (__m128i a, __m128i RoundKey)
+ /// AESENC xmm, xmm/m128
+ ///
+ public static Vector128 Encrypt(Vector128 value, Vector128 roundKey) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128i _mm_aesenclast_si128 (__m128i a, __m128i RoundKey)
+ /// AESENCLAST xmm, xmm/m128
+ ///
+ public static Vector128 EncryptLast(Vector128 value, Vector128 roundKey) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm_aesenclast_si128 (__m128i a, __m128i RoundKey)
+ /// AESENCLAST xmm, xmm/m128
+ ///
+ public static Vector128 EncryptLast(Vector128 value, Vector128 roundKey) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128i _mm_aesimc_si128 (__m128i a)
+ /// AESIMC xmm, xmm/m128
+ ///
+ public static Vector128 InvisibleMixColumn(Vector128 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm_aesimc_si128 (__m128i a)
+ /// AESIMC xmm, xmm/m128
+ ///
+ public static Vector128 InvisibleMixColumn(Vector128 value) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128i _mm_aeskeygenassist_si128 (__m128i a, const int imm8)
+ /// AESKEYGENASSIST xmm, xmm/m128, imm8
+ ///
+ public static Vector128 KeygenAssist(Vector128 value, byte control) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm_aeskeygenassist_si128 (__m128i a, const int imm8)
+ /// AESKEYGENASSIST xmm, xmm/m128, imm8
+ ///
+ public static Vector128 KeygenAssist(Vector128 value, byte control) { throw new PlatformNotSupportedException(); }
+
+ }
+
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs
new file mode 100644
index 00000000000..349919a21ca
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs
@@ -0,0 +1,86 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.Intrinsics;
+
+namespace System.Runtime.Intrinsics.X86
+{
+ ///
+ /// This class provides access to Intel AES hardware instructions via intrinsics
+ ///
+ [CLSCompliant(false)]
+ public static class Aes
+ {
+ public static bool IsSupported { get => IsSupported; }
+
+ ///
+ /// __m128i _mm_aesdec_si128 (__m128i a, __m128i RoundKey)
+ /// AESDEC xmm, xmm/m128
+ ///
+ public static Vector128 Decrypt(Vector128 value, Vector128 roundKey) => Decrypt(value, roundKey);
+ ///
+ /// __m128i _mm_aesdec_si128 (__m128i a, __m128i RoundKey)
+ /// AESDEC xmm, xmm/m128
+ ///
+ public static Vector128 Decrypt(Vector128 value, Vector128 roundKey) => Decrypt(value, roundKey);
+
+ ///
+ /// __m128i _mm_aesdeclast_si128 (__m128i a, __m128i RoundKey)
+ /// AESDECLAST xmm, xmm/m128
+ ///
+ public static Vector128 DecryptLast(Vector128 value, Vector128 roundKey) => DecryptLast(value, roundKey);
+ ///
+ /// __m128i _mm_aesdeclast_si128 (__m128i a, __m128i RoundKey)
+ /// AESDECLAST xmm, xmm/m128
+ ///
+ public static Vector128 DecryptLast(Vector128 value, Vector128 roundKey) => DecryptLast(value, roundKey);
+
+ ///
+ /// __m128i _mm_aesenc_si128 (__m128i a, __m128i RoundKey)
+ /// AESENC xmm, xmm/m128
+ ///
+ public static Vector128 Encrypt(Vector128 value, Vector128 roundKey) => Encrypt(value, roundKey);
+ ///
+ /// __m128i _mm_aesenc_si128 (__m128i a, __m128i RoundKey)
+ /// AESENC xmm, xmm/m128
+ ///
+ public static Vector128 Encrypt(Vector128 value, Vector128 roundKey) => Encrypt(value, roundKey);
+
+ ///
+ /// __m128i _mm_aesenclast_si128 (__m128i a, __m128i RoundKey)
+ /// AESENCLAST xmm, xmm/m128
+ ///
+ public static Vector128 EncryptLast(Vector128 value, Vector128 roundKey) => EncryptLast(value, roundKey);
+ ///
+ /// __m128i _mm_aesenclast_si128 (__m128i a, __m128i RoundKey)
+ /// AESENCLAST xmm, xmm/m128
+ ///
+ public static Vector128 EncryptLast(Vector128 value, Vector128 roundKey) => EncryptLast(value, roundKey);
+
+ ///
+ /// __m128i _mm_aesimc_si128 (__m128i a)
+ /// AESIMC xmm, xmm/m128
+ ///
+ public static Vector128 InvisibleMixColumn(Vector128 value) => InvisibleMixColumn(value);
+ ///
+ /// __m128i _mm_aesimc_si128 (__m128i a)
+ /// AESIMC xmm, xmm/m128
+ ///
+ public static Vector128 InvisibleMixColumn(Vector128 value) => InvisibleMixColumn(value);
+
+ ///
+ /// __m128i _mm_aeskeygenassist_si128 (__m128i a, const int imm8)
+ /// AESKEYGENASSIST xmm, xmm/m128, imm8
+ ///
+ public static Vector128 KeygenAssist(Vector128 value, byte control) => KeygenAssist(value, control);
+ ///
+ /// __m128i _mm_aeskeygenassist_si128 (__m128i a, const int imm8)
+ /// AESKEYGENASSIST xmm, xmm/m128, imm8
+ ///
+ public static Vector128 KeygenAssist(Vector128 value, byte control) => KeygenAssist(value, control);
+
+ }
+
+}
diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs
new file mode 100644
index 00000000000..1fd61ec3e1e
--- /dev/null
+++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs
@@ -0,0 +1,1238 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.Intrinsics;
+
+namespace System.Runtime.Intrinsics.X86
+{
+ ///
+ /// This class provides access to Intel AVX hardware instructions via intrinsics
+ ///
+ [CLSCompliant(false)]
+ public static class Avx
+ {
+ public static bool IsSupported { get { return false; } }
+
+ ///
+ /// __m256 _mm256_add_ps (__m256 a, __m256 b)
+ /// VADDPS ymm, ymm, ymm/m256
+ ///
+ public static Vector256 Add(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_add_pd (__m256d a, __m256d b)
+ /// VADDPD ymm, ymm, ymm/m256
+ ///
+ public static Vector256 Add(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_addsub_ps (__m256 a, __m256 b)
+ /// VADDSUBPS ymm, ymm, ymm/m256
+ ///
+ public static Vector256 AddSubtract(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_addsub_pd (__m256d a, __m256d b)
+ /// VADDSUBPD ymm, ymm, ymm/m256
+ ///
+ public static Vector256 AddSubtract(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_and_ps (__m256 a, __m256 b)
+ /// VANDPS ymm, ymm, ymm/m256
+ ///
+ public static Vector256 And(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_and_pd (__m256d a, __m256d b)
+ /// VANDPD ymm, ymm, ymm/m256
+ ///
+ public static Vector256 And(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_andnot_ps (__m256 a, __m256 b)
+ /// VANDNPS ymm, ymm, ymm/m256
+ ///
+ public static Vector256 AndNot(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_andnot_pd (__m256d a, __m256d b)
+ /// VANDNPD ymm, ymm, ymm/m256
+ ///
+ public static Vector256 AndNot(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_blend_ps (__m256 a, __m256 b, const int imm8)
+ /// VBLENDPS ymm, ymm, ymm/m256, imm8
+ ///
+ public static Vector256 Blend(Vector256 left, Vector256 right, byte control) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_blend_pd (__m256d a, __m256d b, const int imm8)
+ /// VBLENDPD ymm, ymm, ymm/m256, imm8
+ ///
+ public static Vector256 Blend(Vector256 left, Vector256 right, byte control) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_blendv_ps (__m256 a, __m256 b, __m256 mask)
+ /// VBLENDVPS ymm, ymm, ymm/m256, ymm
+ ///
+ public static Vector256 BlendVariable(Vector256 left, Vector256 right, Vector256 mask) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_blendv_pd (__m256d a, __m256d b, __m256d mask)
+ /// VBLENDVPD ymm, ymm, ymm/m256, ymm
+ ///
+ public static Vector256 BlendVariable(Vector256 left, Vector256 right, Vector256 mask) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128 _mm_broadcast_ss (float const * mem_addr)
+ /// VBROADCASTSS xmm, m32
+ ///
+ public static unsafe Vector128 BroadcastScalarToVector128(float* source) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_broadcast_ss (float const * mem_addr)
+ /// VBROADCASTSS ymm, m32
+ ///
+ public static unsafe Vector256 BroadcastScalarToVector256(float* source) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_broadcast_sd (double const * mem_addr)
+ /// VBROADCASTSD ymm, m64
+ ///
+ public static unsafe Vector256 BroadcastScalarToVector256(double* source) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_broadcast_ps (__m128 const * mem_addr)
+ /// VBROADCASTF128, ymm, m128
+ ///
+ public static unsafe Vector256 BroadcastVector128ToVector256(float* address) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_broadcast_pd (__m128d const * mem_addr)
+ /// VBROADCASTF128, ymm, m128
+ ///
+ public static unsafe Vector256 BroadcastVector128ToVector256(double* address) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_ceil_ps (__m256 a)
+ /// VROUNDPS ymm, ymm/m256, imm8(10)
+ ///
+ public static Vector256 Ceiling(Vector256 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_ceil_pd (__m256d a)
+ /// VROUNDPD ymm, ymm/m256, imm8(10)
+ ///
+ public static Vector256 Ceiling(Vector256 value) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128 _mm_cmp_ps (__m128 a, __m128 b, const int imm8)
+ /// VCMPPS xmm, xmm, xmm/m128, imm8
+ ///
+ public static Vector128 Compare(Vector128 left, Vector128 right, FloatComparisonMode mode) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128d _mm_cmp_pd (__m128d a, __m128d b, const int imm8)
+ /// VCMPPD xmm, xmm, xmm/m128, imm8
+ ///
+ public static Vector128 Compare(Vector128 left, Vector128 right, FloatComparisonMode mode) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256 _mm256_cmp_ps (__m256 a, __m256 b, const int imm8)
+ /// VCMPPS ymm, ymm, ymm/m256, imm8
+ ///
+ public static Vector256 Compare(Vector256 left, Vector256 right, FloatComparisonMode mode) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_cmp_pd (__m256d a, __m256d b, const int imm8)
+ /// VCMPPD ymm, ymm, ymm/m256, imm8
+ ///
+ public static Vector256 Compare(Vector256 left, Vector256 right, FloatComparisonMode mode) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128d _mm_cmp_sd (__m128d a, __m128d b, const int imm8)
+ /// VCMPSS xmm, xmm, xmm/m32, imm8
+ ///
+ public static Vector128 CompareScalar(Vector128 left, Vector128 right, FloatComparisonMode mode) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128 _mm_cmp_ss (__m128 a, __m128 b, const int imm8)
+ /// VCMPSD xmm, xmm, xmm/m64, imm8
+ ///
+ public static Vector128 CompareScalar(Vector128 left, Vector128 right, FloatComparisonMode mode) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// float _mm256_cvtss_f32 (__m256 a)
+ /// HELPER: VMOVSS
+ ///
+ public static float ConvertToSingle(Vector256 value) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128i _mm256_cvtpd_epi32 (__m256d a)
+ /// VCVTPD2DQ xmm, ymm/m256
+ ///
+ public static Vector128 ConvertToVector128Int32(Vector256 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128 _mm256_cvtpd_ps (__m256d a)
+ /// VCVTPD2PS xmm, ymm/m256
+ ///
+ public static Vector128 ConvertToVector128Single(Vector256 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256i _mm256_cvtps_epi32 (__m256 a)
+ /// VCVTPS2DQ ymm, ymm/m256
+ ///
+ public static Vector256 ConvertToVector256Int32(Vector256 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256 _mm256_cvtepi32_ps (__m256i a)
+ /// VCVTDQ2PS ymm, ymm/m256
+ ///
+ public static Vector256 ConvertToVector256Single(Vector256 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_cvtps_pd (__m128 a)
+ /// VCVTPS2PD ymm, xmm/m128
+ ///
+ public static Vector256 ConvertToVector256Double(Vector128 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_cvtepi32_pd (__m128i a)
+ /// VCVTDQ2PD ymm, xmm/m128
+ ///
+ public static Vector256 ConvertToVector256Double(Vector128 value) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128i _mm256_cvttpd_epi32 (__m256d a)
+ /// VCVTTPD2DQ xmm, ymm/m256
+ ///
+ public static Vector128 ConvertToVector128Int32WithTruncation(Vector256 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256i _mm256_cvttps_epi32 (__m256 a)
+ /// VCVTTPS2DQ ymm, ymm/m256
+ ///
+ public static Vector256 ConvertToVector256Int32WithTruncation(Vector256 value) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_div_ps (__m256 a, __m256 b)
+ /// VDIVPS ymm, ymm, ymm/m256
+ ///
+ public static Vector256 Divide(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_div_pd (__m256d a, __m256d b)
+ /// VDIVPD ymm, ymm, ymm/m256
+ ///
+ public static Vector256 Divide(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_dp_ps (__m256 a, __m256 b, const int imm8)
+ /// VDPPS ymm, ymm, ymm/m256, imm8
+ ///
+ public static Vector256 DotProduct(Vector256 left, Vector256 right, byte control) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_moveldup_ps (__m256 a)
+ /// VMOVSLDUP ymm, ymm/m256
+ ///
+ public static Vector256 DuplicateEvenIndexed(Vector256 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_movedup_pd (__m256d a)
+ /// VMOVDDUP ymm, ymm/m256
+ ///
+ public static Vector256 DuplicateEvenIndexed(Vector256 value) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_movehdup_ps (__m256 a)
+ /// VMOVSHDUP ymm, ymm/m256
+ ///
+ public static Vector256 DuplicateOddIndexed(Vector256 value) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __int8 _mm256_extract_epi8 (__m256i a, const int index)
+ /// HELPER
+ ///
+ public static sbyte Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __int8 _mm256_extract_epi8 (__m256i a, const int index)
+ /// HELPER
+ ///
+ public static byte Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __int16 _mm256_extract_epi16 (__m256i a, const int index)
+ /// HELPER
+ ///
+ public static short Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __int16 _mm256_extract_epi16 (__m256i a, const int index)
+ /// HELPER
+ ///
+ public static ushort Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __int32 _mm256_extract_epi32 (__m256i a, const int index)
+ /// HELPER
+ ///
+ public static int Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __int32 _mm256_extract_epi32 (__m256i a, const int index)
+ /// HELPER
+ ///
+ public static uint Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __int64 _mm256_extract_epi64 (__m256i a, const int index)
+ /// HELPER
+ ///
+ public static long Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __int64 _mm256_extract_epi64 (__m256i a, const int index)
+ /// HELPER
+ ///
+ public static ulong Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128 _mm256_extractf128_ps (__m256 a, const int imm8)
+ /// VEXTRACTF128 xmm/m128, ymm, imm8
+ /// __m128d _mm256_extractf128_pd (__m256d a, const int imm8)
+ /// VEXTRACTF128 xmm/m128, ymm, imm8
+ /// __m128i _mm256_extractf128_si256 (__m256i a, const int imm8)
+ /// VEXTRACTF128 xmm/m128, ymm, imm8
+ ///
+ public static Vector128 ExtractVector128(Vector256 value, byte index) where T : struct { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128i _mm256_extractf128_si256 (__m256i a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(byte* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm256_extractf128_si256 (__m256i a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(sbyte* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm256_extractf128_si256 (__m256i a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(short* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm256_extractf128_si256 (__m256i a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(ushort* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm256_extractf128_si256 (__m256i a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(int* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm256_extractf128_si256 (__m256i a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(uint* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm256_extractf128_si256 (__m256i a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(long* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128i _mm256_extractf128_si256 (__m256i a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(ulong* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128 _mm256_extractf128_ps (__m256 a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(float* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m128d _mm256_extractf128_pd (__m256d a, const int imm8)
+ /// VEXTRACTF128 m128, ymm, imm8
+ ///
+ public static unsafe void ExtractVector128(double* address, Vector256 value, byte index) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256d _mm256_castpd128_pd256 (__m128d a)
+ /// HELPER - No Codegen
+ /// __m256 _mm256_castps128_ps256 (__m128 a)
+ /// HELPER - No Codegen
+ /// __m256i _mm256_castsi128_si256 (__m128i a)
+ /// HELPER - No Codegen
+ ///
+ public static Vector256 ExtendToVector256(Vector128 value) where T : struct { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_floor_ps (__m256 a)
+ /// VROUNDPS ymm, ymm/m256, imm8(9)
+ ///
+ public static Vector256 Floor(Vector256 value) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_floor_pd (__m256d a)
+ /// VROUNDPS ymm, ymm/m256, imm8(9)
+ ///
+ public static Vector256 Floor(Vector256 value) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m128d _mm256_castpd256_pd128 (__m256d a)
+ /// HELPER - No Codegen
+ /// __m128 _mm256_castps256_ps128 (__m256 a)
+ /// HELPER - No Codegen
+ /// __m128i _mm256_castsi256_si128 (__m256i a)
+ /// HELPER - No Codegen
+ ///
+ public static Vector128 GetLowerHalf(Vector256 value) where T : struct { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_hadd_ps (__m256 a, __m256 b)
+ /// VHADDPS ymm, ymm, ymm/m256
+ ///
+ public static Vector256 HorizontalAdd(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_hadd_pd (__m256d a, __m256d b)
+ /// VHADDPD ymm, ymm, ymm/m256
+ ///
+ public static Vector256 HorizontalAdd(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256 _mm256_hsub_ps (__m256 a, __m256 b)
+ /// VHSUBPS ymm, ymm, ymm/m256
+ ///
+ public static Vector256 HorizontalSubtract(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256d _mm256_hsub_pd (__m256d a, __m256d b)
+ /// VHSUBPD ymm, ymm, ymm/m256
+ ///
+ public static Vector256 HorizontalSubtract(Vector256 left, Vector256 right) { throw new PlatformNotSupportedException(); }
+
+ ///
+ /// __m256i _mm256_insert_epi8 (__m256i a, __int8 i, const int index)
+ /// HELPER
+ ///
+ public static Vector256 Insert(Vector256 value, sbyte data, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256i _mm256_insert_epi8 (__m256i a, __int8 i, const int index)
+ /// HELPER
+ ///
+ public static Vector256 Insert(Vector256 value, byte data, byte index) { throw new PlatformNotSupportedException(); }
+ ///
+ /// __m256i _mm256_insert_epi16 (__m256i a, __int16 i, const int index)
+ /// HELPER
+ ///
+ public static Vector256 Insert(Vector256