From 598d26c2ca54ffd6dc57dd96a5939f9479a50522 Mon Sep 17 00:00:00 2001 From: Fei Peng Date: Tue, 26 Jun 2018 16:20:54 -0700 Subject: [PATCH] Fix Aes and Ssse3.Shuffle intrinsic APIs Commit migrated from https://github.com/dotnet/coreclr/commit/1aec8f9ff3c1aa575be0ecad9b2920d25436281c --- .../Intrinsics/X86/Aes.PlatformNotSupported.cs | 32 +--------------------- .../src/System/Runtime/Intrinsics/X86/Aes.cs | 32 +--------------------- .../Intrinsics/X86/Ssse3.PlatformNotSupported.cs | 6 ++++ .../src/System/Runtime/Intrinsics/X86/Ssse3.cs | 6 ++++ 4 files changed, 14 insertions(+), 62 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.PlatformNotSupported.cs index 5df8f26..c31da39 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.PlatformNotSupported.cs @@ -19,66 +19,36 @@ namespace System.Runtime.Intrinsics.X86 /// __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(); } + public static Vector128 InverseMixColumns(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/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs index 349919a..75db4b1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Aes.cs @@ -19,66 +19,36 @@ namespace System.Runtime.Intrinsics.X86 /// __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); + public static Vector128 InverseMixColumns(Vector128 value) => InverseMixColumns(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/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Ssse3.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Ssse3.PlatformNotSupported.cs index 20e9bbb..7a930c4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Ssse3.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Ssse3.PlatformNotSupported.cs @@ -90,6 +90,12 @@ namespace System.Runtime.Intrinsics.X86 public static Vector128 Shuffle(Vector128 value, Vector128 mask) { throw new PlatformNotSupportedException(); } /// + /// __m128i _mm_shuffle_epi8 (__m128i a, __m128i b) + /// PSHUFB xmm, xmm/m128 + /// + public static Vector128 Shuffle(Vector128 value, Vector128 mask) { throw new PlatformNotSupportedException(); } + + /// /// __m128i _mm_sign_epi8 (__m128i a, __m128i b) /// PSIGNB xmm, xmm/m128 /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Ssse3.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Ssse3.cs index 0403a0a..fc32c29 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Ssse3.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Ssse3.cs @@ -90,6 +90,12 @@ namespace System.Runtime.Intrinsics.X86 public static Vector128 Shuffle(Vector128 value, Vector128 mask) => Shuffle(value, mask); /// + /// __m128i _mm_shuffle_epi8 (__m128i a, __m128i b) + /// PSHUFB xmm, xmm/m128 + /// + public static Vector128 Shuffle(Vector128 value, Vector128 mask) => Shuffle(value, mask); + + /// /// __m128i _mm_sign_epi8 (__m128i a, __m128i b) /// PSIGNB xmm, xmm/m128 /// -- 2.7.4