From f75fedc0ab2bc6fa6167297ab5dde5d86267d106 Mon Sep 17 00:00:00 2001 From: Michael Zuckerman Date: Thu, 14 Apr 2016 06:48:09 +0000 Subject: [PATCH] [Clang][AVX512][Builtin] Adding intrinsics of vpmovus{d|q}{b|w|d}{128|256|512} instruction set Differential Revision: http://reviews.llvm.org/D19050 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266278 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/BuiltinsX86.def | 30 +++ lib/Headers/avx512fintrin.h | 148 ++++++++++++++ lib/Headers/avx512vlintrin.h | 294 ++++++++++++++++++++++++++++ test/CodeGen/avx512f-builtins.c | 120 ++++++++++++ test/CodeGen/avx512vl-builtins.c | 240 +++++++++++++++++++++++ 5 files changed, 832 insertions(+) diff --git a/include/clang/Basic/BuiltinsX86.def b/include/clang/Basic/BuiltinsX86.def index 7331412bd3..0c1f5febec 100644 --- a/include/clang/Basic/BuiltinsX86.def +++ b/include/clang/Basic/BuiltinsX86.def @@ -2042,6 +2042,36 @@ TARGET_BUILTIN(__builtin_ia32_pmovsqw128_mask, "V8sV2LLiV8sUc","","avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovsqw128mem_mask, "vV8s*V2LLiUc","","avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovsqw256_mask, "V8sV4LLiV8sUc","","avx512vl") TARGET_BUILTIN(__builtin_ia32_pmovsqw256mem_mask, "vV8s*V4LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdb512_mask, "V16cV16iV16cUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusdb512mem_mask, "vV16c*V16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusdw512_mask, "V16sV16iV16sUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusdw512mem_mask, "vV16s*V16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqb512_mask, "V16cV8LLiV16cUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqb512mem_mask, "vV16c*V8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqd512_mask, "V8iV8LLiV8iUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqd512mem_mask, "vV8i*V8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqw512_mask, "V8sV8LLiV8sUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusqw512mem_mask, "vV8s*V8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovusdb128_mask, "V16cV4iV16cUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdb128mem_mask, "vV16c*V4iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdb256_mask, "V16cV8iV16cUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdb256mem_mask, "vV16c*V8iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdw128_mask, "V8sV4iV8sUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdw128mem_mask, "vV8s*V4iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdw256_mask, "V8sV8iV8sUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusdw256mem_mask, "vV8s*V8iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqb128_mask, "V16cV2LLiV16cUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqb128mem_mask, "vV16c*V2LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqb256_mask, "V16cV4LLiV16cUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqb256mem_mask, "vV16c*V4LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqd128_mask, "V4iV2LLiV4iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqd128mem_mask, "vV4i*V2LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqd256_mask, "V4iV4LLiV4iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqd256mem_mask, "vV4i*V4LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqw128_mask, "V8sV2LLiV8sUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqw128mem_mask, "vV8s*V2LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqw256_mask, "V8sV4LLiV8sUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovusqw256mem_mask, "vV8s*V4LLiUc","","avx512vl") #undef BUILTIN #undef TARGET_BUILTIN diff --git a/lib/Headers/avx512fintrin.h b/lib/Headers/avx512fintrin.h index 38d49af9ae..2699127bc6 100644 --- a/lib/Headers/avx512fintrin.h +++ b/lib/Headers/avx512fintrin.h @@ -5765,6 +5765,154 @@ _mm512_mask_cvtsepi64_storeu_epi16 (void * __P, __mmask8 __M, __m512i __A) __builtin_ia32_pmovsqw512mem_mask ((__v8hi *) __P, (__v8di) __A, __M); } +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_cvtusepi32_epi8 (__m512i __A) +{ + return (__m128i) __builtin_ia32_pmovusdb512_mask ((__v16si) __A, + (__v16qi) _mm_undefined_si128 (), + (__mmask16) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi32_epi8 (__m128i __O, __mmask16 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovusdb512_mask ((__v16si) __A, + (__v16qi) __O, + __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtusepi32_epi8 (__mmask16 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovusdb512_mask ((__v16si) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi32_storeu_epi8 (void * __P, __mmask16 __M, __m512i __A) +{ + __builtin_ia32_pmovusdb512mem_mask ((__v16qi *) __P, (__v16si) __A, __M); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_cvtusepi32_epi16 (__m512i __A) +{ + return (__m256i) __builtin_ia32_pmovusdw512_mask ((__v16si) __A, + (__v16hi) _mm256_undefined_si256 (), + (__mmask16) -1); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi32_epi16 (__m256i __O, __mmask16 __M, __m512i __A) +{ + return (__m256i) __builtin_ia32_pmovusdw512_mask ((__v16si) __A, + (__v16hi) __O, + __M); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtusepi32_epi16 (__mmask16 __M, __m512i __A) +{ + return (__m256i) __builtin_ia32_pmovusdw512_mask ((__v16si) __A, + (__v16hi) _mm256_setzero_si256 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi32_storeu_epi16 (void *__P, __mmask16 __M, __m512i __A) +{ + __builtin_ia32_pmovusdw512mem_mask ((__v16hi*) __P, (__v16si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_cvtusepi64_epi8 (__m512i __A) +{ + return (__m128i) __builtin_ia32_pmovusqb512_mask ((__v8di) __A, + (__v16qi) _mm_undefined_si128 (), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi64_epi8 (__m128i __O, __mmask8 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovusqb512_mask ((__v8di) __A, + (__v16qi) __O, + __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtusepi64_epi8 (__mmask8 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovusqb512_mask ((__v8di) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi64_storeu_epi8 (void * __P, __mmask8 __M, __m512i __A) +{ + __builtin_ia32_pmovusqb512mem_mask ((__v16qi *) __P, (__v8di) __A, __M); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_cvtusepi64_epi32 (__m512i __A) +{ + return (__m256i) __builtin_ia32_pmovusqd512_mask ((__v8di) __A, + (__v8si) _mm256_undefined_si256 (), + (__mmask8) -1); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi64_epi32 (__m256i __O, __mmask8 __M, __m512i __A) +{ + return (__m256i) __builtin_ia32_pmovusqd512_mask ((__v8di) __A, + (__v8si) __O, __M); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtusepi64_epi32 (__mmask8 __M, __m512i __A) +{ + return (__m256i) __builtin_ia32_pmovusqd512_mask ((__v8di) __A, + (__v8si) _mm256_setzero_si256 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi64_storeu_epi32 (void* __P, __mmask8 __M, __m512i __A) +{ + __builtin_ia32_pmovusqd512mem_mask ((__v8si*) __P, (__v8di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_cvtusepi64_epi16 (__m512i __A) +{ + return (__m128i) __builtin_ia32_pmovusqw512_mask ((__v8di) __A, + (__v8hi) _mm_undefined_si128 (), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi64_epi16 (__m128i __O, __mmask8 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovusqw512_mask ((__v8di) __A, + (__v8hi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtusepi64_epi16 (__mmask8 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovusqw512_mask ((__v8di) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtusepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A) +{ + __builtin_ia32_pmovusqw512mem_mask ((__v8hi*) __P, (__v8di) __A, __M); +} + #undef __DEFAULT_FN_ATTRS #endif // __AVX512FINTRIN_H diff --git a/lib/Headers/avx512vlintrin.h b/lib/Headers/avx512vlintrin.h index 51eadfb156..df00884fec 100644 --- a/lib/Headers/avx512vlintrin.h +++ b/lib/Headers/avx512vlintrin.h @@ -8218,6 +8218,300 @@ _mm256_mask_cvtsepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) __builtin_ia32_pmovsqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); } +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtusepi32_epi8 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusdb128_mask ((__v4si) __A, + (__v16qi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi32_epi8 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusdb128_mask ((__v4si) __A, + (__v16qi) __O, + __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtusepi32_epi8 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusdb128_mask ((__v4si) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovusdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtusepi32_epi8 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusdb256_mask ((__v8si) __A, + (__v16qi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi32_epi8 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusdb256_mask ((__v8si) __A, + (__v16qi) __O, + __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtusepi32_epi8 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusdb256_mask ((__v8si) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) +{ + __builtin_ia32_pmovusdb256mem_mask ((__v16qi*) __P, (__v8si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtusepi32_epi16 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusdw128_mask ((__v4si) __A, + (__v8hi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi32_epi16 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusdw128_mask ((__v4si) __A, + (__v8hi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtusepi32_epi16 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusdw128_mask ((__v4si) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovusdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtusepi32_epi16 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusdw256_mask ((__v8si) __A, + (__v8hi) _mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi32_epi16 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusdw256_mask ((__v8si) __A, + (__v8hi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtusepi32_epi16 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusdw256_mask ((__v8si) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) +{ + __builtin_ia32_pmovusdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtusepi64_epi8 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusqb128_mask ((__v2di) __A, + (__v16qi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi64_epi8 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusqb128_mask ((__v2di) __A, + (__v16qi) __O, + __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtusepi64_epi8 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusqb128_mask ((__v2di) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovusqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtusepi64_epi8 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusqb256_mask ((__v4di) __A, + (__v16qi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi64_epi8 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusqb256_mask ((__v4di) __A, + (__v16qi) __O, + __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtusepi64_epi8 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusqb256_mask ((__v4di) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) +{ + __builtin_ia32_pmovusqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtusepi64_epi32 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusqd128_mask ((__v2di) __A, + (__v4si)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi64_epi32 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusqd128_mask ((__v2di) __A, + (__v4si) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtusepi64_epi32 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusqd128_mask ((__v2di) __A, + (__v4si) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovusqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtusepi64_epi32 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusqd256_mask ((__v4di) __A, + (__v4si)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi64_epi32 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusqd256_mask ((__v4di) __A, + (__v4si) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtusepi64_epi32 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusqd256_mask ((__v4di) __A, + (__v4si) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A) +{ + __builtin_ia32_pmovusqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtusepi64_epi16 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusqw128_mask ((__v2di) __A, + (__v8hi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi64_epi16 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusqw128_mask ((__v2di) __A, + (__v8hi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtusepi64_epi16 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovusqw128_mask ((__v2di) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtusepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovusqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtusepi64_epi16 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusqw256_mask ((__v4di) __A, + (__v8hi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi64_epi16 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusqw256_mask ((__v4di) __A, + (__v8hi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtusepi64_epi16 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovusqw256_mask ((__v4di) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtusepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) +{ + return __builtin_ia32_pmovusqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); +} + #undef __DEFAULT_FN_ATTRS #undef __DEFAULT_FN_ATTRS_BOTH diff --git a/test/CodeGen/avx512f-builtins.c b/test/CodeGen/avx512f-builtins.c index a13d92e981..cde81e47ae 100644 --- a/test/CodeGen/avx512f-builtins.c +++ b/test/CodeGen/avx512f-builtins.c @@ -3819,3 +3819,123 @@ void test_mm512_mask_cvtsepi64_storeu_epi16(void * __P, __mmask8 __M, __m512i __ // CHECK: @llvm.x86.avx512.mask.pmovs.qw.mem.512 return _mm512_mask_cvtsepi64_storeu_epi16(__P, __M, __A); } + +__m128i test_mm512_cvtusepi32_epi8(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtusepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.512 + return _mm512_cvtusepi32_epi8(__A); +} + +__m128i test_mm512_mask_cvtusepi32_epi8(__m128i __O, __mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.512 + return _mm512_mask_cvtusepi32_epi8(__O, __M, __A); +} + +__m128i test_mm512_maskz_cvtusepi32_epi8(__mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtusepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.512 + return _mm512_maskz_cvtusepi32_epi8(__M, __A); +} + +void test_mm512_mask_cvtusepi32_storeu_epi8(void * __P, __mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi32_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.mem.512 + return _mm512_mask_cvtusepi32_storeu_epi8(__P, __M, __A); +} + +__m256i test_mm512_cvtusepi32_epi16(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtusepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.512 + return _mm512_cvtusepi32_epi16(__A); +} + +__m256i test_mm512_mask_cvtusepi32_epi16(__m256i __O, __mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.512 + return _mm512_mask_cvtusepi32_epi16(__O, __M, __A); +} + +__m256i test_mm512_maskz_cvtusepi32_epi16(__mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtusepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.512 + return _mm512_maskz_cvtusepi32_epi16(__M, __A); +} + +void test_mm512_mask_cvtusepi32_storeu_epi16(void *__P, __mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi32_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.mem.512 + return _mm512_mask_cvtusepi32_storeu_epi16(__P, __M, __A); +} + +__m128i test_mm512_cvtusepi64_epi8(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtusepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.512 + return _mm512_cvtusepi64_epi8(__A); +} + +__m128i test_mm512_mask_cvtusepi64_epi8(__m128i __O, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.512 + return _mm512_mask_cvtusepi64_epi8(__O, __M, __A); +} + +__m128i test_mm512_maskz_cvtusepi64_epi8(__mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtusepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.512 + return _mm512_maskz_cvtusepi64_epi8(__M, __A); +} + +void test_mm512_mask_cvtusepi64_storeu_epi8(void * __P, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi64_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.mem.512 + return _mm512_mask_cvtusepi64_storeu_epi8(__P, __M, __A); +} + +__m256i test_mm512_cvtusepi64_epi32(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtusepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.512 + return _mm512_cvtusepi64_epi32(__A); +} + +__m256i test_mm512_mask_cvtusepi64_epi32(__m256i __O, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.512 + return _mm512_mask_cvtusepi64_epi32(__O, __M, __A); +} + +__m256i test_mm512_maskz_cvtusepi64_epi32(__mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtusepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.512 + return _mm512_maskz_cvtusepi64_epi32(__M, __A); +} + +void test_mm512_mask_cvtusepi64_storeu_epi32(void* __P, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi64_storeu_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.mem.512 + return _mm512_mask_cvtusepi64_storeu_epi32(__P, __M, __A); +} + +__m128i test_mm512_cvtusepi64_epi16(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtusepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.512 + return _mm512_cvtusepi64_epi16(__A); +} + +__m128i test_mm512_mask_cvtusepi64_epi16(__m128i __O, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.512 + return _mm512_mask_cvtusepi64_epi16(__O, __M, __A); +} + +__m128i test_mm512_maskz_cvtusepi64_epi16(__mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtusepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.512 + return _mm512_maskz_cvtusepi64_epi16(__M, __A); +} + +void test_mm512_mask_cvtusepi64_storeu_epi16(void *__P, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtusepi64_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.mem.512 + return _mm512_mask_cvtusepi64_storeu_epi16(__P, __M, __A); +} diff --git a/test/CodeGen/avx512vl-builtins.c b/test/CodeGen/avx512vl-builtins.c index 229510430f..63cc1ea4d3 100644 --- a/test/CodeGen/avx512vl-builtins.c +++ b/test/CodeGen/avx512vl-builtins.c @@ -5638,3 +5638,243 @@ void test_mm256_mask_cvtsepi64_storeu_epi16(void * __P, __mmask8 __M, __m256i __ // CHECK: @llvm.x86.avx512.mask.pmovs.qw.mem.256 return _mm256_mask_cvtsepi64_storeu_epi16(__P, __M, __A); } + +__m128i test_mm_cvtusepi32_epi8(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtusepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.128 + return _mm_cvtusepi32_epi8(__A); +} + +__m128i test_mm_mask_cvtusepi32_epi8(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.128 + return _mm_mask_cvtusepi32_epi8(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtusepi32_epi8(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtusepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.128 + return _mm_maskz_cvtusepi32_epi8(__M, __A); +} + +void test_mm_mask_cvtusepi32_storeu_epi8(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi32_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.mem.128 + return _mm_mask_cvtusepi32_storeu_epi8(__P, __M, __A); +} + +__m128i test_mm256_cvtusepi32_epi8(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtusepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.256 + return _mm256_cvtusepi32_epi8(__A); +} + +__m128i test_mm256_mask_cvtusepi32_epi8(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.256 + return _mm256_mask_cvtusepi32_epi8(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtusepi32_epi8(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtusepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.256 + return _mm256_maskz_cvtusepi32_epi8(__M, __A); +} + +void test_mm256_mask_cvtusepi32_storeu_epi8(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi32_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.db.mem.256 + return _mm256_mask_cvtusepi32_storeu_epi8(__P, __M, __A); +} + +__m128i test_mm_cvtusepi32_epi16(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtusepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.128 + return _mm_cvtusepi32_epi16(__A); +} + +__m128i test_mm_mask_cvtusepi32_epi16(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.128 + return _mm_mask_cvtusepi32_epi16(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtusepi32_epi16(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtusepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.128 + return _mm_maskz_cvtusepi32_epi16(__M, __A); +} + +void test_mm_mask_cvtusepi32_storeu_epi16(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi32_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.mem.128 + return _mm_mask_cvtusepi32_storeu_epi16(__P, __M, __A); +} + +__m128i test_mm256_cvtusepi32_epi16(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtusepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.256 + return _mm256_cvtusepi32_epi16(__A); +} + +__m128i test_mm256_mask_cvtusepi32_epi16(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.256 + return _mm256_mask_cvtusepi32_epi16(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtusepi32_epi16(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtusepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.256 + return _mm256_maskz_cvtusepi32_epi16(__M, __A); +} + +void test_mm256_mask_cvtusepi32_storeu_epi16(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi32_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.dw.mem.256 + return _mm256_mask_cvtusepi32_storeu_epi16(__P, __M, __A); +} + +__m128i test_mm_cvtusepi64_epi8(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtusepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.128 + return _mm_cvtusepi64_epi8(__A); +} + +__m128i test_mm_mask_cvtusepi64_epi8(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.128 + return _mm_mask_cvtusepi64_epi8(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtusepi64_epi8(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtusepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.128 + return _mm_maskz_cvtusepi64_epi8(__M, __A); +} + +void test_mm_mask_cvtusepi64_storeu_epi8(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi64_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.mem.128 + return _mm_mask_cvtusepi64_storeu_epi8(__P, __M, __A); +} + +__m128i test_mm256_cvtusepi64_epi8(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtusepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.256 + return _mm256_cvtusepi64_epi8(__A); +} + +__m128i test_mm256_mask_cvtusepi64_epi8(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.256 + return _mm256_mask_cvtusepi64_epi8(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtusepi64_epi8(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtusepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.256 + return _mm256_maskz_cvtusepi64_epi8(__M, __A); +} + +void test_mm256_mask_cvtusepi64_storeu_epi8(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi64_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmovus.qb.mem.256 + return _mm256_mask_cvtusepi64_storeu_epi8(__P, __M, __A); +} + +__m128i test_mm_cvtusepi64_epi32(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtusepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.128 + return _mm_cvtusepi64_epi32(__A); +} + +__m128i test_mm_mask_cvtusepi64_epi32(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.128 + return _mm_mask_cvtusepi64_epi32(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtusepi64_epi32(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtusepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.128 + return _mm_maskz_cvtusepi64_epi32(__M, __A); +} + +void test_mm_mask_cvtusepi64_storeu_epi32(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi64_storeu_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.mem.128 + return _mm_mask_cvtusepi64_storeu_epi32(__P, __M, __A); +} + +__m128i test_mm256_cvtusepi64_epi32(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtusepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.256 + return _mm256_cvtusepi64_epi32(__A); +} + +__m128i test_mm256_mask_cvtusepi64_epi32(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.256 + return _mm256_mask_cvtusepi64_epi32(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtusepi64_epi32(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtusepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.256 + return _mm256_maskz_cvtusepi64_epi32(__M, __A); +} + +void test_mm256_mask_cvtusepi64_storeu_epi32(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi64_storeu_epi32 + // CHECK: @llvm.x86.avx512.mask.pmovus.qd.mem.256 + return _mm256_mask_cvtusepi64_storeu_epi32(__P, __M, __A); +} + +__m128i test_mm_cvtusepi64_epi16(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtusepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.128 + return _mm_cvtusepi64_epi16(__A); +} + +__m128i test_mm_mask_cvtusepi64_epi16(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.128 + return _mm_mask_cvtusepi64_epi16(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtusepi64_epi16(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtusepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.128 + return _mm_maskz_cvtusepi64_epi16(__M, __A); +} + +void test_mm_mask_cvtusepi64_storeu_epi16(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtusepi64_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.mem.128 + return _mm_mask_cvtusepi64_storeu_epi16(__P, __M, __A); +} + +__m128i test_mm256_cvtusepi64_epi16(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtusepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.256 + return _mm256_cvtusepi64_epi16(__A); +} + +__m128i test_mm256_mask_cvtusepi64_epi16(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.256 + return _mm256_mask_cvtusepi64_epi16(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtusepi64_epi16(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtusepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.256 + return _mm256_maskz_cvtusepi64_epi16(__M, __A); +} + +void test_mm256_mask_cvtusepi64_storeu_epi16(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtusepi64_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmovus.qw.mem.256 + return _mm256_mask_cvtusepi64_storeu_epi16(__P, __M, __A); +} -- 2.40.0