From: Ilya Tocar Date: Fri, 16 Jan 2015 11:01:08 +0000 (+0000) Subject: Add new names for intrinsics. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3e362970f97326d8ebeaa99aaabac6a6c97f6e8f;p=gcc.git Add new names for intrinsics. gcc/ * config/i386/avx2intrin.h (_mm256_bslli_epi128, _mm256_bsrli_epi128): New. * config/i386/emmintrin.h (_mm_bsrli_si128, _mm_bslli_si128): Ditto. testsuite/ * gcc.target/i386/sse-14.c: Test new intrinsic. * gcc.target/i386/sse-22.c: Ditto. From-SVN: r219719 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d9fbca10fc..27713b00752 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-01-16 Ilya Tocar + + * config/i386/avx2intrin.h (_mm256_bslli_epi128, + _mm256_bsrli_epi128): New. + * config/i386/emmintrin.h (_mm_bsrli_si128, _mm_bslli_si128): Ditto. + 2015-01-15 Jiong Wang * expmed.c (store_bit_field_using_insv): Improve warning message. diff --git a/gcc/config/i386/avx2intrin.h b/gcc/config/i386/avx2intrin.h index 669f1dc7a31..b2a2f488c01 100644 --- a/gcc/config/i386/avx2intrin.h +++ b/gcc/config/i386/avx2intrin.h @@ -643,6 +643,13 @@ _mm256_sign_epi32 (__m256i __X, __m256i __Y) } #ifdef __OPTIMIZE__ +extern __inline __m256i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm256_bslli_epi128 (__m256i __A, const int __N) +{ + return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8); +} + extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_slli_si256 (__m256i __A, const int __N) @@ -650,6 +657,8 @@ _mm256_slli_si256 (__m256i __A, const int __N) return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8); } #else +#define _mm256_bslli_epi128(A, N) \ + ((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8)) #define _mm256_slli_si256(A, N) \ ((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8)) #endif @@ -725,6 +734,13 @@ _mm256_sra_epi32 (__m256i __A, __m128i __B) } #ifdef __OPTIMIZE__ +extern __inline __m256i +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm256_bsrli_epi128 (__m256i __A, const int __N) +{ + return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8); +} + extern __inline __m256i __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm256_srli_si256 (__m256i __A, const int __N) @@ -732,6 +748,8 @@ _mm256_srli_si256 (__m256i __A, const int __N) return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8); } #else +#define _mm256_bsrli_epi128(A, N) \ + ((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8)) #define _mm256_srli_si256(A, N) \ ((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8)) #endif diff --git a/gcc/config/i386/emmintrin.h b/gcc/config/i386/emmintrin.h index ad37fac4622..b19f05a1021 100644 --- a/gcc/config/i386/emmintrin.h +++ b/gcc/config/i386/emmintrin.h @@ -1164,6 +1164,18 @@ _mm_srai_epi32 (__m128i __A, int __B) } #ifdef __OPTIMIZE__ +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_bsrli_si128 (__m128i __A, const int __N) +{ + return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8); +} + +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_bslli_si128 (__m128i __A, const int __N) +{ + return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8); +} + extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_srli_si128 (__m128i __A, const int __N) { @@ -1176,6 +1188,10 @@ _mm_slli_si128 (__m128i __A, const int __N) return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8); } #else +#define _mm_bsrli_si128(A, N) \ + ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8)) +#define _mm_bslli_si128(A, N) \ + ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8)) #define _mm_srli_si128(A, N) \ ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8)) #define _mm_slli_si128(A, N) \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0c4b8eb8b5b..0ab8f94610c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-16 Ilya Tocar + + * gcc.target/i386/sse-14.c: Test new intrinsic. + * gcc.target/i386/sse-22.c: Ditto. + 2015-01-16 Paolo Carlini PR c++/58614 diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c index f3f6c5ce051..e8791e387dc 100644 --- a/gcc/testsuite/gcc.target/i386/sse-14.c +++ b/gcc/testsuite/gcc.target/i386/sse-14.c @@ -601,6 +601,8 @@ test_2 (_mm_alignr_pi8, __m64, __m64, __m64, 1) /* emmintrin.h */ test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1) +test_1 (_mm_bsrli_si128, __m128i, __m128i, 1) +test_1 (_mm_bslli_si128, __m128i, __m128i, 1) test_1 (_mm_srli_si128, __m128i, __m128i, 1) test_1 (_mm_slli_si128, __m128i, __m128i, 1) test_1 (_mm_extract_epi16, int, __m128i, 1) diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c index 0d7bd1673c9..72017f5f681 100644 --- a/gcc/testsuite/gcc.target/i386/sse-22.c +++ b/gcc/testsuite/gcc.target/i386/sse-22.c @@ -138,6 +138,8 @@ test_1 (_mm_prefetch, void, void *, _MM_HINT_NTA) #endif #include test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1) +test_1 (_mm_bsrli_si128, __m128i, __m128i, 1) +test_1 (_mm_bslli_si128, __m128i, __m128i, 1) test_1 (_mm_srli_si128, __m128i, __m128i, 1) test_1 (_mm_slli_si128, __m128i, __m128i, 1) test_1 (_mm_extract_epi16, int, __m128i, 1) @@ -269,6 +271,8 @@ test_2 ( _mm256_blend_epi16, __m256i, __m256i, __m256i, 1) test_1 ( _mm256_shuffle_epi32, __m256i, __m256i, 1) test_1 ( _mm256_shufflehi_epi16, __m256i, __m256i, 1) test_1 ( _mm256_shufflelo_epi16, __m256i, __m256i, 1) +test_1 ( _mm256_bslli_epi128, __m256i, __m256i, 8) +test_1 ( _mm256_bsrli_epi128, __m256i, __m256i, 8) test_1 ( _mm256_slli_si256, __m256i, __m256i, 8) test_1 ( _mm256_srli_si256, __m256i, __m256i, 8) test_2 ( _mm_blend_epi32, __m128i, __m128i, __m128i, 1)