r268385 - [Clang][avx512][Builtin] Adding intrinsics for cvtw2mask{128|256|512} instruction set

Pete Cooper via cfe-commits cfe-commits at lists.llvm.org
Tue May 3 11:39:37 PDT 2016


Hi Michael

I was seeing issues with the CHECK lines referencing explicit value numbers.  i.e., %1, %2, etc.

In r268416 I changed these to use a regex.  I hope this was ok.  Please let me know if you have an alternative you would prefer.

Thanks,
Pete
> On May 3, 2016, at 7:12 AM, Michael Zuckerman via cfe-commits <cfe-commits at lists.llvm.org> wrote:
> 
> Author: mzuckerm
> Date: Tue May  3 09:12:23 2016
> New Revision: 268385
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=268385&view=rev
> Log:
> [Clang][avx512][Builtin] Adding intrinsics for cvtw2mask{128|256|512} instruction set
> 
> Differential Revision: http://reviews.llvm.org/D19766
> 
> Modified:
>    cfe/trunk/include/clang/Basic/BuiltinsX86.def
>    cfe/trunk/lib/Headers/avx512bwintrin.h
>    cfe/trunk/lib/Headers/avx512vlbwintrin.h
>    cfe/trunk/test/CodeGen/avx512bw-builtins.c
>    cfe/trunk/test/CodeGen/avx512vlbw-builtins.c
> 
> Modified: cfe/trunk/include/clang/Basic/BuiltinsX86.def
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=268385&r1=268384&r2=268385&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/BuiltinsX86.def (original)
> +++ cfe/trunk/include/clang/Basic/BuiltinsX86.def Tue May  3 09:12:23 2016
> @@ -2256,6 +2256,9 @@ TARGET_BUILTIN(__builtin_ia32_vcvtph2ps_
> TARGET_BUILTIN(__builtin_ia32_vcvtph2ps256_mask, "V8fV8sV8fUc","","avx512vl")
> TARGET_BUILTIN(__builtin_ia32_vcvtps2ph_mask, "V8sV4fIiV8sUc","","avx512vl")
> TARGET_BUILTIN(__builtin_ia32_vcvtps2ph256_mask, "V8sV8fIiV8sUc","","avx512vl")
> +TARGET_BUILTIN(__builtin_ia32_cvtw2mask512, "UiV32s","","avx512bw")
> +TARGET_BUILTIN(__builtin_ia32_cvtw2mask128, "UcV8s","","avx512bw,avx512vl")
> +TARGET_BUILTIN(__builtin_ia32_cvtw2mask256, "UsV16s","","avx512bw,avx512vl")
> 
> #undef BUILTIN
> #undef TARGET_BUILTIN
> 
> Modified: cfe/trunk/lib/Headers/avx512bwintrin.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=268385&r1=268384&r2=268385&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Headers/avx512bwintrin.h (original)
> +++ cfe/trunk/lib/Headers/avx512bwintrin.h Tue May  3 09:12:23 2016
> @@ -2063,6 +2063,12 @@ _mm512_movepi8_mask (__m512i __A)
>   return (__mmask64) __builtin_ia32_cvtb2mask512 ((__v64qi) __A);
> }
> 
> +static __inline__ __mmask32 __DEFAULT_FN_ATTRS
> +_mm512_movepi16_mask (__m512i __A)
> +{
> +  return (__mmask32) __builtin_ia32_cvtw2mask512 ((__v32hi) __A);
> +}
> +
> static __inline__ __m512i __DEFAULT_FN_ATTRS
> _mm512_movm_epi8 (__mmask64 __A)
> {
> 
> Modified: cfe/trunk/lib/Headers/avx512vlbwintrin.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512vlbwintrin.h?rev=268385&r1=268384&r2=268385&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Headers/avx512vlbwintrin.h (original)
> +++ cfe/trunk/lib/Headers/avx512vlbwintrin.h Tue May  3 09:12:23 2016
> @@ -3181,6 +3181,18 @@ _mm256_movepi8_mask (__m256i __A)
>   return (__mmask32) __builtin_ia32_cvtb2mask256 ((__v32qi) __A);
> }
> 
> +static __inline__ __mmask8 __DEFAULT_FN_ATTRS
> +_mm_movepi16_mask (__m128i __A)
> +{
> +  return (__mmask8) __builtin_ia32_cvtw2mask128 ((__v8hi) __A);
> +}
> +
> +static __inline__ __mmask16 __DEFAULT_FN_ATTRS
> +_mm256_movepi16_mask (__m256i __A)
> +{
> +  return (__mmask16) __builtin_ia32_cvtw2mask256 ((__v16hi) __A);
> +}
> +
> static __inline__ __m128i __DEFAULT_FN_ATTRS
> _mm_movm_epi8 (__mmask16 __A)
> {
> 
> Modified: cfe/trunk/test/CodeGen/avx512bw-builtins.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512bw-builtins.c?rev=268385&r1=268384&r2=268385&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/avx512bw-builtins.c (original)
> +++ cfe/trunk/test/CodeGen/avx512bw-builtins.c Tue May  3 09:12:23 2016
> @@ -1530,3 +1530,10 @@ __m512i test_mm512_sad_epu8(__m512i __A,
>   // CHECK: @llvm.x86.avx512.psad.bw.512
>   return _mm512_sad_epu8(__A, __B); 
> }
> +
> +__mmask32 test_mm512_movepi16_mask(__m512i __A) {
> +  // CHECK-LABEL: @test_mm512_movepi16_mask
> +  // CHECK: @llvm.x86.avx512.cvtw2mask.512
> +  return _mm512_movepi16_mask(__A); 
> +}
> +
> 
> Modified: cfe/trunk/test/CodeGen/avx512vlbw-builtins.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vlbw-builtins.c?rev=268385&r1=268384&r2=268385&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/avx512vlbw-builtins.c (original)
> +++ cfe/trunk/test/CodeGen/avx512vlbw-builtins.c Tue May  3 09:12:23 2016
> @@ -2375,3 +2375,15 @@ __m256i test_mm256_maskz_dbsad_epu8(__mm
>   // CHECK: @llvm.x86.avx512.mask.dbpsadbw.256
>   return _mm256_maskz_dbsad_epu8(__U, __A, __B, 170); 
> }
> +__mmask8 test_mm_movepi16_mask(__m128i __A) {
> +  // CHECK-LABEL: @test_mm_movepi16_mask
> +  // CHECK: @llvm.x86.avx512.cvtw2mask.128
> +  return _mm_movepi16_mask(__A); 
> +}
> +
> +__mmask16 test_mm256_movepi16_mask(__m256i __A) {
> +  // CHECK-LABEL: @test_mm256_movepi16_mask
> +  // CHECK: @llvm.x86.avx512.cvtw2mask.256
> +  return _mm256_movepi16_mask(__A); 
> +}
> +
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list