From 1aec8f9ff3c1aa575be0ecad9b2920d25436281c 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 --- .../X86/Aes.PlatformNotSupported.cs | 32 +------------------ .../System/Runtime/Intrinsics/X86/Aes.cs | 32 +------------------ .../X86/Ssse3.PlatformNotSupported.cs | 6 ++++ .../System/Runtime/Intrinsics/X86/Ssse3.cs | 6 ++++ 4 files changed, 14 insertions(+), 62 deletions(-) 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 index 5df8f266dfac..c31da3964d88 100644 --- 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 @@ -15,44 +15,24 @@ 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 @@ -63,18 +43,8 @@ public static class Aes /// __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 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 index 349919a21ca6..75db4b1979ed 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Aes.cs @@ -15,44 +15,24 @@ 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 @@ -63,18 +43,8 @@ public static class Aes /// __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 diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Ssse3.PlatformNotSupported.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Ssse3.PlatformNotSupported.cs index 20e9bbb8b75d..7a930c499a64 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Ssse3.PlatformNotSupported.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Ssse3.PlatformNotSupported.cs @@ -89,6 +89,12 @@ public static class Ssse3 /// 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/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Ssse3.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Ssse3.cs index 0403a0a4e270..fc32c29496a7 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Ssse3.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Ssse3.cs @@ -89,6 +89,12 @@ public static class Ssse3 /// 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