From 0a3508a8d39746b070f9ad4e3aabe3e0c3fbeed8 Mon Sep 17 00:00:00 2001 From: Michael Zuckerman Date: Thu, 14 Apr 2016 07:56:51 +0000 Subject: [PATCH] [Clang][AVX512][BUILTIN] Adding support for intrinsics of vpmov{d|q}{b|w|d}{128|256|512} instruction set Differential Revision: http://reviews.llvm.org/D19055 llvm-svn: 266280 --- clang/include/clang/Basic/BuiltinsX86.def | 30 +++ clang/lib/Headers/avx512fintrin.h | 145 +++++++++++++++ clang/lib/Headers/avx512vlintrin.h | 292 ++++++++++++++++++++++++++++++ clang/test/CodeGen/avx512f-builtins.c | 120 ++++++++++++ clang/test/CodeGen/avx512vl-builtins.c | 240 ++++++++++++++++++++++++ 5 files changed, 827 insertions(+) diff --git a/clang/include/clang/Basic/BuiltinsX86.def b/clang/include/clang/Basic/BuiltinsX86.def index 0c1f5fe..fd01f48 100644 --- a/clang/include/clang/Basic/BuiltinsX86.def +++ b/clang/include/clang/Basic/BuiltinsX86.def @@ -2072,6 +2072,36 @@ 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") +TARGET_BUILTIN(__builtin_ia32_pmovdb512_mask, "V16cV16iV16cUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovdb512mem_mask, "vV16c*V16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovdw512_mask, "V16sV16iV16sUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovdw512mem_mask, "vV16s*V16iUs","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqb512_mask, "V16cV8LLiV16cUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqb512mem_mask, "vV16c*V8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqd512_mask, "V8iV8LLiV8iUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqd512mem_mask, "vV8i*V8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqw512_mask, "V8sV8LLiV8sUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovqw512mem_mask, "vV8s*V8LLiUc","","avx512f") +TARGET_BUILTIN(__builtin_ia32_pmovdb128_mask, "V16cV4iV16cUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdb128mem_mask, "vV16c*V4iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdb256_mask, "V16cV8iV16cUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdb256mem_mask, "vV16c*V8iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdw128_mask, "V8sV4iV8sUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdw128mem_mask, "vV8s*V4iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdw256_mask, "V8sV8iV8sUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovdw256mem_mask, "vV8s*V8iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqb128_mask, "V16cV2LLiV16cUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqb128mem_mask, "vV16c*V2LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqb256_mask, "V16cV4LLiV16cUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqb256mem_mask, "vV16c*V4LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqd128_mask, "V4iV2LLiV4iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqd128mem_mask, "vV4i*V2LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqd256_mask, "V4iV4LLiV4iUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqd256mem_mask, "vV4i*V4LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqw128_mask, "V8sV2LLiV8sUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqw128mem_mask, "vV8s*V2LLiUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqw256_mask, "V8sV4LLiV8sUc","","avx512vl") +TARGET_BUILTIN(__builtin_ia32_pmovqw256mem_mask, "vV8s*V4LLiUc","","avx512vl") #undef BUILTIN #undef TARGET_BUILTIN diff --git a/clang/lib/Headers/avx512fintrin.h b/clang/lib/Headers/avx512fintrin.h index 2699127..8d0d981 100644 --- a/clang/lib/Headers/avx512fintrin.h +++ b/clang/lib/Headers/avx512fintrin.h @@ -5913,6 +5913,151 @@ _mm512_mask_cvtusepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A) __builtin_ia32_pmovusqw512mem_mask ((__v8hi*) __P, (__v8di) __A, __M); } +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_cvtepi32_epi8 (__m512i __A) +{ + return (__m128i) __builtin_ia32_pmovdb512_mask ((__v16si) __A, + (__v16qi) _mm_undefined_si128 (), + (__mmask16) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi32_epi8 (__m128i __O, __mmask16 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovdb512_mask ((__v16si) __A, + (__v16qi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtepi32_epi8 (__mmask16 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovdb512_mask ((__v16si) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi32_storeu_epi8 (void * __P, __mmask16 __M, __m512i __A) +{ + __builtin_ia32_pmovdb512mem_mask ((__v16qi *) __P, (__v16si) __A, __M); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_cvtepi32_epi16 (__m512i __A) +{ + return (__m256i) __builtin_ia32_pmovdw512_mask ((__v16si) __A, + (__v16hi) _mm256_undefined_si256 (), + (__mmask16) -1); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi32_epi16 (__m256i __O, __mmask16 __M, __m512i __A) +{ + return (__m256i) __builtin_ia32_pmovdw512_mask ((__v16si) __A, + (__v16hi) __O, __M); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtepi32_epi16 (__mmask16 __M, __m512i __A) +{ + return (__m256i) __builtin_ia32_pmovdw512_mask ((__v16si) __A, + (__v16hi) _mm256_setzero_si256 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi32_storeu_epi16 (void * __P, __mmask16 __M, __m512i __A) +{ + __builtin_ia32_pmovdw512mem_mask ((__v16hi *) __P, (__v16si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_cvtepi64_epi8 (__m512i __A) +{ + return (__m128i) __builtin_ia32_pmovqb512_mask ((__v8di) __A, + (__v16qi) _mm_undefined_si128 (), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi64_epi8 (__m128i __O, __mmask8 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovqb512_mask ((__v8di) __A, + (__v16qi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtepi64_epi8 (__mmask8 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovqb512_mask ((__v8di) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m512i __A) +{ + __builtin_ia32_pmovqb512mem_mask ((__v16qi *) __P, (__v8di) __A, __M); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_cvtepi64_epi32 (__m512i __A) +{ + return (__m256i) __builtin_ia32_pmovqd512_mask ((__v8di) __A, + (__v8si) _mm256_undefined_si256 (), + (__mmask8) -1); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi64_epi32 (__m256i __O, __mmask8 __M, __m512i __A) +{ + return (__m256i) __builtin_ia32_pmovqd512_mask ((__v8di) __A, + (__v8si) __O, __M); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtepi64_epi32 (__mmask8 __M, __m512i __A) +{ + return (__m256i) __builtin_ia32_pmovqd512_mask ((__v8di) __A, + (__v8si) _mm256_setzero_si256 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi64_storeu_epi32 (void* __P, __mmask8 __M, __m512i __A) +{ + __builtin_ia32_pmovqd512mem_mask ((__v8si *) __P, (__v8di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_cvtepi64_epi16 (__m512i __A) +{ + return (__m128i) __builtin_ia32_pmovqw512_mask ((__v8di) __A, + (__v8hi) _mm_undefined_si128 (), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi64_epi16 (__m128i __O, __mmask8 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovqw512_mask ((__v8di) __A, + (__v8hi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm512_maskz_cvtepi64_epi16 (__mmask8 __M, __m512i __A) +{ + return (__m128i) __builtin_ia32_pmovqw512_mask ((__v8di) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm512_mask_cvtepi64_storeu_epi16 (void *__P, __mmask8 __M, __m512i __A) +{ + __builtin_ia32_pmovqw512mem_mask ((__v8hi *) __P, (__v8di) __A, __M); +} + #undef __DEFAULT_FN_ATTRS #endif // __AVX512FINTRIN_H diff --git a/clang/lib/Headers/avx512vlintrin.h b/clang/lib/Headers/avx512vlintrin.h index df00884..0f0d5c7 100644 --- a/clang/lib/Headers/avx512vlintrin.h +++ b/clang/lib/Headers/avx512vlintrin.h @@ -8512,6 +8512,298 @@ _mm256_mask_cvtusepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) return __builtin_ia32_pmovusqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); } +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtepi32_epi8 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovdb128_mask ((__v4si) __A, + (__v16qi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtepi32_epi8 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovdb128_mask ((__v4si) __A, + (__v16qi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtepi32_epi8 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovdb128_mask ((__v4si) __A, + (__v16qi) + _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovdb128mem_mask ((__v16qi *) __P, (__v4si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtepi32_epi8 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A, + (__v16qi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi32_epi8 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A, + (__v16qi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtepi32_epi8 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovdb256_mask ((__v8si) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi32_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) +{ + __builtin_ia32_pmovdb256mem_mask ((__v16qi *) __P, (__v8si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtepi32_epi16 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovdw128_mask ((__v4si) __A, + (__v8hi) _mm_setzero_si128 (), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtepi32_epi16 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovdw128_mask ((__v4si) __A, + (__v8hi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtepi32_epi16 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovdw128_mask ((__v4si) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovdw128mem_mask ((__v8hi *) __P, (__v4si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtepi32_epi16 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovdw256_mask ((__v8si) __A, + (__v8hi)_mm_setzero_si128 (), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi32_epi16 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovdw256_mask ((__v8si) __A, + (__v8hi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtepi32_epi16 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovdw256_mask ((__v8si) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi32_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) +{ + __builtin_ia32_pmovdw256mem_mask ((__v8hi *) __P, (__v8si) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtepi64_epi8 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovqb128_mask ((__v2di) __A, + (__v16qi) _mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtepi64_epi8 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovqb128_mask ((__v2di) __A, + (__v16qi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtepi64_epi8 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovqb128_mask ((__v2di) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovqb128mem_mask ((__v16qi *) __P, (__v2di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtepi64_epi8 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovqb256_mask ((__v4di) __A, + (__v16qi) _mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi64_epi8 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovqb256_mask ((__v4di) __A, + (__v16qi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtepi64_epi8 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovqb256_mask ((__v4di) __A, + (__v16qi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi64_storeu_epi8 (void * __P, __mmask8 __M, __m256i __A) +{ + __builtin_ia32_pmovqb256mem_mask ((__v16qi *) __P, (__v4di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtepi64_epi32 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovqd128_mask ((__v2di) __A, + (__v4si)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtepi64_epi32 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovqd128_mask ((__v2di) __A, + (__v4si) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtepi64_epi32 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovqd128_mask ((__v2di) __A, + (__v4si) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovqd128mem_mask ((__v4si *) __P, (__v2di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtepi64_epi32 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovqd256_mask ((__v4di) __A, + (__v4si) _mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi64_epi32 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovqd256_mask ((__v4di) __A, + (__v4si) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtepi64_epi32 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovqd256_mask ((__v4di) __A, + (__v4si) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi64_storeu_epi32 (void * __P, __mmask8 __M, __m256i __A) +{ + __builtin_ia32_pmovqd256mem_mask ((__v4si *) __P, (__v4di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_cvtepi64_epi16 (__m128i __A) +{ + return (__m128i) __builtin_ia32_pmovqw128_mask ((__v2di) __A, + (__v8hi) _mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_mask_cvtepi64_epi16 (__m128i __O, __mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovqw128_mask ((__v2di) __A, + (__v8hi)__O, + __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_maskz_cvtepi64_epi16 (__mmask8 __M, __m128i __A) +{ + return (__m128i) __builtin_ia32_pmovqw128_mask ((__v2di) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m128i __A) +{ + __builtin_ia32_pmovqw128mem_mask ((__v8hi *) __P, (__v2di) __A, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_cvtepi64_epi16 (__m256i __A) +{ + return (__m128i) __builtin_ia32_pmovqw256_mask ((__v4di) __A, + (__v8hi)_mm_undefined_si128(), + (__mmask8) -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi64_epi16 (__m128i __O, __mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovqw256_mask ((__v4di) __A, + (__v8hi) __O, __M); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm256_maskz_cvtepi64_epi16 (__mmask8 __M, __m256i __A) +{ + return (__m128i) __builtin_ia32_pmovqw256_mask ((__v4di) __A, + (__v8hi) _mm_setzero_si128 (), + __M); +} + +static __inline__ void __DEFAULT_FN_ATTRS +_mm256_mask_cvtepi64_storeu_epi16 (void * __P, __mmask8 __M, __m256i __A) +{ + __builtin_ia32_pmovqw256mem_mask ((__v8hi *) __P, (__v4di) __A, __M); +} + #undef __DEFAULT_FN_ATTRS #undef __DEFAULT_FN_ATTRS_BOTH diff --git a/clang/test/CodeGen/avx512f-builtins.c b/clang/test/CodeGen/avx512f-builtins.c index cde81e4..dc61276 100644 --- a/clang/test/CodeGen/avx512f-builtins.c +++ b/clang/test/CodeGen/avx512f-builtins.c @@ -3939,3 +3939,123 @@ void test_mm512_mask_cvtusepi64_storeu_epi16(void *__P, __mmask8 __M, __m512i __ // CHECK: @llvm.x86.avx512.mask.pmovus.qw.mem.512 return _mm512_mask_cvtusepi64_storeu_epi16(__P, __M, __A); } + +__m128i test_mm512_cvtepi32_epi8(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.512 + return _mm512_cvtepi32_epi8(__A); +} + +__m128i test_mm512_mask_cvtepi32_epi8(__m128i __O, __mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.512 + return _mm512_mask_cvtepi32_epi8(__O, __M, __A); +} + +__m128i test_mm512_maskz_cvtepi32_epi8(__mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.512 + return _mm512_maskz_cvtepi32_epi8(__M, __A); +} + +void test_mm512_mask_cvtepi32_storeu_epi8(void * __P, __mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi32_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.mem.512 + return _mm512_mask_cvtepi32_storeu_epi8(__P, __M, __A); +} + +__m256i test_mm512_cvtepi32_epi16(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.512 + return _mm512_cvtepi32_epi16(__A); +} + +__m256i test_mm512_mask_cvtepi32_epi16(__m256i __O, __mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.512 + return _mm512_mask_cvtepi32_epi16(__O, __M, __A); +} + +__m256i test_mm512_maskz_cvtepi32_epi16(__mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.512 + return _mm512_maskz_cvtepi32_epi16(__M, __A); +} + +void test_mm512_mask_cvtepi32_storeu_epi16(void * __P, __mmask16 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi32_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.mem.512 + return _mm512_mask_cvtepi32_storeu_epi16(__P, __M, __A); +} + +__m128i test_mm512_cvtepi64_epi8(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.512 + return _mm512_cvtepi64_epi8(__A); +} + +__m128i test_mm512_mask_cvtepi64_epi8(__m128i __O, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.512 + return _mm512_mask_cvtepi64_epi8(__O, __M, __A); +} + +__m128i test_mm512_maskz_cvtepi64_epi8(__mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.512 + return _mm512_maskz_cvtepi64_epi8(__M, __A); +} + +void test_mm512_mask_cvtepi64_storeu_epi8(void * __P, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi64_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.mem.512 + return _mm512_mask_cvtepi64_storeu_epi8(__P, __M, __A); +} + +__m256i test_mm512_cvtepi64_epi32(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.512 + return _mm512_cvtepi64_epi32(__A); +} + +__m256i test_mm512_mask_cvtepi64_epi32(__m256i __O, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.512 + return _mm512_mask_cvtepi64_epi32(__O, __M, __A); +} + +__m256i test_mm512_maskz_cvtepi64_epi32(__mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.512 + return _mm512_maskz_cvtepi64_epi32(__M, __A); +} + +void test_mm512_mask_cvtepi64_storeu_epi32(void* __P, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi64_storeu_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.mem.512 + return _mm512_mask_cvtepi64_storeu_epi32(__P, __M, __A); +} + +__m128i test_mm512_cvtepi64_epi16(__m512i __A) { + // CHECK-LABEL: @test_mm512_cvtepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.512 + return _mm512_cvtepi64_epi16(__A); +} + +__m128i test_mm512_mask_cvtepi64_epi16(__m128i __O, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.512 + return _mm512_mask_cvtepi64_epi16(__O, __M, __A); +} + +__m128i test_mm512_maskz_cvtepi64_epi16(__mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_maskz_cvtepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.512 + return _mm512_maskz_cvtepi64_epi16(__M, __A); +} + +void test_mm512_mask_cvtepi64_storeu_epi16(void *__P, __mmask8 __M, __m512i __A) { + // CHECK-LABEL: @test_mm512_mask_cvtepi64_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.mem.512 + return _mm512_mask_cvtepi64_storeu_epi16(__P, __M, __A); +} diff --git a/clang/test/CodeGen/avx512vl-builtins.c b/clang/test/CodeGen/avx512vl-builtins.c index 63cc1ea..2e7e678 100644 --- a/clang/test/CodeGen/avx512vl-builtins.c +++ b/clang/test/CodeGen/avx512vl-builtins.c @@ -5878,3 +5878,243 @@ void test_mm256_mask_cvtusepi64_storeu_epi16(void * __P, __mmask8 __M, __m256i _ // CHECK: @llvm.x86.avx512.mask.pmovus.qw.mem.256 return _mm256_mask_cvtusepi64_storeu_epi16(__P, __M, __A); } + +__m128i test_mm_cvtepi32_epi8(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.128 + return _mm_cvtepi32_epi8(__A); +} + +__m128i test_mm_mask_cvtepi32_epi8(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.128 + return _mm_mask_cvtepi32_epi8(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtepi32_epi8(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.128 + return _mm_maskz_cvtepi32_epi8(__M, __A); +} + +void test_mm_mask_cvtepi32_storeu_epi8(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi32_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.mem.128 + return _mm_mask_cvtepi32_storeu_epi8(__P, __M, __A); +} + +__m128i test_mm256_cvtepi32_epi8(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.256 + return _mm256_cvtepi32_epi8(__A); +} + +__m128i test_mm256_mask_cvtepi32_epi8(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.256 + return _mm256_mask_cvtepi32_epi8(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtepi32_epi8(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtepi32_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.256 + return _mm256_maskz_cvtepi32_epi8(__M, __A); +} + +void test_mm256_mask_cvtepi32_storeu_epi8(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi32_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.db.mem.256 + return _mm256_mask_cvtepi32_storeu_epi8(__P, __M, __A); +} + +__m128i test_mm_cvtepi32_epi16(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.128 + return _mm_cvtepi32_epi16(__A); +} + +__m128i test_mm_mask_cvtepi32_epi16(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.128 + return _mm_mask_cvtepi32_epi16(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtepi32_epi16(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.128 + return _mm_maskz_cvtepi32_epi16(__M, __A); +} + +void test_mm_mask_cvtepi32_storeu_epi16(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi32_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.mem.128 + return _mm_mask_cvtepi32_storeu_epi16(__P, __M, __A); +} + +__m128i test_mm256_cvtepi32_epi16(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.256 + return _mm256_cvtepi32_epi16(__A); +} + +__m128i test_mm256_mask_cvtepi32_epi16(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.256 + return _mm256_mask_cvtepi32_epi16(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtepi32_epi16(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtepi32_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.256 + return _mm256_maskz_cvtepi32_epi16(__M, __A); +} + +void test_mm256_mask_cvtepi32_storeu_epi16(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi32_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.dw.mem.256 + return _mm256_mask_cvtepi32_storeu_epi16(__P, __M, __A); +} + +__m128i test_mm_cvtepi64_epi8(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.128 + return _mm_cvtepi64_epi8(__A); +} + +__m128i test_mm_mask_cvtepi64_epi8(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.128 + return _mm_mask_cvtepi64_epi8(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtepi64_epi8(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.128 + return _mm_maskz_cvtepi64_epi8(__M, __A); +} + +void test_mm_mask_cvtepi64_storeu_epi8(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi64_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.mem.128 + return _mm_mask_cvtepi64_storeu_epi8(__P, __M, __A); +} + +__m128i test_mm256_cvtepi64_epi8(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.256 + return _mm256_cvtepi64_epi8(__A); +} + +__m128i test_mm256_mask_cvtepi64_epi8(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.256 + return _mm256_mask_cvtepi64_epi8(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtepi64_epi8(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtepi64_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.256 + return _mm256_maskz_cvtepi64_epi8(__M, __A); +} + +void test_mm256_mask_cvtepi64_storeu_epi8(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi64_storeu_epi8 + // CHECK: @llvm.x86.avx512.mask.pmov.qb.mem.256 + return _mm256_mask_cvtepi64_storeu_epi8(__P, __M, __A); +} + +__m128i test_mm_cvtepi64_epi32(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.128 + return _mm_cvtepi64_epi32(__A); +} + +__m128i test_mm_mask_cvtepi64_epi32(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.128 + return _mm_mask_cvtepi64_epi32(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtepi64_epi32(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.128 + return _mm_maskz_cvtepi64_epi32(__M, __A); +} + +void test_mm_mask_cvtepi64_storeu_epi32(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi64_storeu_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.mem.128 + return _mm_mask_cvtepi64_storeu_epi32(__P, __M, __A); +} + +__m128i test_mm256_cvtepi64_epi32(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.256 + return _mm256_cvtepi64_epi32(__A); +} + +__m128i test_mm256_mask_cvtepi64_epi32(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.256 + return _mm256_mask_cvtepi64_epi32(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtepi64_epi32(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtepi64_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.256 + return _mm256_maskz_cvtepi64_epi32(__M, __A); +} + +void test_mm256_mask_cvtepi64_storeu_epi32(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi64_storeu_epi32 + // CHECK: @llvm.x86.avx512.mask.pmov.qd.mem.256 + return _mm256_mask_cvtepi64_storeu_epi32(__P, __M, __A); +} + +__m128i test_mm_cvtepi64_epi16(__m128i __A) { + // CHECK-LABEL: @test_mm_cvtepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.128 + return _mm_cvtepi64_epi16(__A); +} + +__m128i test_mm_mask_cvtepi64_epi16(__m128i __O, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.128 + return _mm_mask_cvtepi64_epi16(__O, __M, __A); +} + +__m128i test_mm_maskz_cvtepi64_epi16(__mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_maskz_cvtepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.128 + return _mm_maskz_cvtepi64_epi16(__M, __A); +} + +void test_mm_mask_cvtepi64_storeu_epi16(void * __P, __mmask8 __M, __m128i __A) { + // CHECK-LABEL: @test_mm_mask_cvtepi64_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.mem.128 + return _mm_mask_cvtepi64_storeu_epi16(__P, __M, __A); +} + +__m128i test_mm256_cvtepi64_epi16(__m256i __A) { + // CHECK-LABEL: @test_mm256_cvtepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.256 + return _mm256_cvtepi64_epi16(__A); +} + +__m128i test_mm256_mask_cvtepi64_epi16(__m128i __O, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.256 + return _mm256_mask_cvtepi64_epi16(__O, __M, __A); +} + +__m128i test_mm256_maskz_cvtepi64_epi16(__mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_maskz_cvtepi64_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.256 + return _mm256_maskz_cvtepi64_epi16(__M, __A); +} + +void test_mm256_mask_cvtepi64_storeu_epi16(void * __P, __mmask8 __M, __m256i __A) { + // CHECK-LABEL: @test_mm256_mask_cvtepi64_storeu_epi16 + // CHECK: @llvm.x86.avx512.mask.pmov.qw.mem.256 + return _mm256_mask_cvtepi64_storeu_epi16(__P, __M, __A); +} -- 2.7.4