From 77b48ee863eaf16948aa4fc0b37adf625abba290 Mon Sep 17 00:00:00 2001 From: Fei Peng Date: Wed, 19 Sep 2018 15:57:35 -0700 Subject: [PATCH] Add all integer overloads for AVX2/SSSE3 AlignRight Commit migrated from https://github.com/dotnet/coreclr/commit/3ccad6222e34b0b5d1fbd8f65ab93dff89e0179a --- .../Intrinsics/X86/Avx2.PlatformNotSupported.cs | 52 +++++++++++++++++++++- .../src/System/Runtime/Intrinsics/X86/Avx2.cs | 52 +++++++++++++++++++++- .../Intrinsics/X86/Ssse3.PlatformNotSupported.cs | 48 ++++++++++++++++++++ .../src/System/Runtime/Intrinsics/X86/Ssse3.cs | 49 ++++++++++++++++++++ 4 files changed, 197 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.PlatformNotSupported.cs index 247f9e1..74486fc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.PlatformNotSupported.cs @@ -102,6 +102,54 @@ namespace System.Runtime.Intrinsics.X86 public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) { throw new PlatformNotSupportedException(); } /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// /// __m256i _mm256_and_si256 (__m256i a, __m256i b) /// VPAND ymm, ymm, ymm/m256 /// @@ -227,12 +275,12 @@ namespace System.Runtime.Intrinsics.X86 /// /// __m256i _mm256_blendv_epi8 (__m256i a, __m256i b, __m256i mask) - /// PBLENDVB ymm, ymm, ymm/m256, ymm + /// VPBLENDVB ymm, ymm, ymm/m256, ymm /// public static Vector256 BlendVariable(Vector256 left, Vector256 right, Vector256 mask) { throw new PlatformNotSupportedException(); } /// /// __m256i _mm256_blendv_epi8 (__m256i a, __m256i b, __m256i mask) - /// PBLENDVB ymm, ymm, ymm/m256, ymm + /// VPBLENDVB ymm, ymm, ymm/m256, ymm /// public static Vector256 BlendVariable(Vector256 left, Vector256 right, Vector256 mask) { throw new PlatformNotSupportedException(); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs index b510c51..01dda51 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/X86/Avx2.cs @@ -102,6 +102,54 @@ namespace System.Runtime.Intrinsics.X86 public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) => AlignRight(left, right, mask); /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m256i _mm256_alignr_epi8 (__m256i a, __m256i b, const int count) + /// VPALIGNR ymm, ymm, ymm/m256, imm8 + /// This intrinsic generates VPALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector256 AlignRight(Vector256 left, Vector256 right, byte mask) => AlignRight(left, right, mask); + + /// /// __m256i _mm256_and_si256 (__m256i a, __m256i b) /// VPAND ymm, ymm, ymm/m256 /// @@ -227,12 +275,12 @@ namespace System.Runtime.Intrinsics.X86 /// /// __m256i _mm256_blendv_epi8 (__m256i a, __m256i b, __m256i mask) - /// PBLENDVB ymm, ymm, ymm/m256, ymm + /// VPBLENDVB ymm, ymm, ymm/m256, ymm /// public static Vector256 BlendVariable(Vector256 left, Vector256 right, Vector256 mask) => BlendVariable(left, right, mask); /// /// __m256i _mm256_blendv_epi8 (__m256i a, __m256i b, __m256i mask) - /// PBLENDVB ymm, ymm, ymm/m256, ymm + /// VPBLENDVB ymm, ymm, ymm/m256, ymm /// public static Vector256 BlendVariable(Vector256 left, Vector256 right, Vector256 mask) => BlendVariable(left, right, mask); 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 a99f7f6..45856d6 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 @@ -40,6 +40,54 @@ namespace System.Runtime.Intrinsics.X86 public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) { throw new PlatformNotSupportedException(); } /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) { throw new PlatformNotSupportedException(); } + + /// /// __m128i _mm_hadd_epi16 (__m128i a, __m128i b) /// PHADDW 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 6fd7778..d735630 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 @@ -40,6 +40,55 @@ namespace System.Runtime.Intrinsics.X86 public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) => AlignRight(left, right, mask); /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) => AlignRight(left, right, mask); + + /// + /// __m128i _mm_alignr_epi8 (__m128i a, __m128i b, int count) + /// PALIGNR xmm, xmm/m128, imm8 + /// This intrinsic generates PALIGNR that operates over bytes rather than elements of the vectors. + /// + public static Vector128 AlignRight(Vector128 left, Vector128 right, byte mask) => AlignRight(left, right, mask); + + /// /// __m128i _mm_hadd_epi16 (__m128i a, __m128i b) /// PHADDW xmm, xmm/m128 /// -- 2.7.4