r269649 - [Clang][AVX512] completing missing intrinsics [vsqrt|vrsqrt|vrcp14 ].
Michael Zuckerman via cfe-commits
cfe-commits at lists.llvm.org
Mon May 16 04:42:01 PDT 2016
Author: mzuckerm
Date: Mon May 16 06:42:01 2016
New Revision: 269649
URL: http://llvm.org/viewvc/llvm-project?rev=269649&view=rev
Log:
[Clang][AVX512] completing missing intrinsics [vsqrt|vrsqrt|vrcp14 ].
Differential Revision: http://reviews.llvm.org/D20068
Modified:
cfe/trunk/lib/Headers/avx512fintrin.h
cfe/trunk/test/CodeGen/avx512f-builtins.c
Modified: cfe/trunk/lib/Headers/avx512fintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512fintrin.h?rev=269649&r1=269648&r2=269649&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Mon May 16 06:42:01 2016
@@ -1287,6 +1287,25 @@ _mm512_sqrt_pd(__m512d __a)
_MM_FROUND_CUR_DIRECTION);
}
+static __inline__ __m512d __DEFAULT_FN_ATTRS
+_mm512_mask_sqrt_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A,
+ (__v8df) __W,
+ (__mmask8) __U,
+ _MM_FROUND_CUR_DIRECTION);
+}
+
+static __inline__ __m512d __DEFAULT_FN_ATTRS
+_mm512_maskz_sqrt_pd (__mmask8 __U, __m512d __A)
+{
+ return (__m512d) __builtin_ia32_sqrtpd512_mask ((__v8df) __A,
+ (__v8df)
+ _mm512_setzero_pd (),
+ (__mmask8) __U,
+ _MM_FROUND_CUR_DIRECTION);
+}
+
static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_sqrt_ps(__m512 __a)
{
@@ -1296,6 +1315,24 @@ _mm512_sqrt_ps(__m512 __a)
_MM_FROUND_CUR_DIRECTION);
}
+static __inline__ __m512 __DEFAULT_FN_ATTRS
+_mm512_mask_sqrt_ps(__m512 __W, __mmask8 __U, __m512 __A)
+{
+ return (__m512)__builtin_ia32_sqrtps512_mask((__v16sf)__A,
+ (__v16sf) __W,
+ (__mmask16) __U,
+ _MM_FROUND_CUR_DIRECTION);
+}
+
+static __inline__ __m512 __DEFAULT_FN_ATTRS
+_mm512_maskz_sqrt_ps( __mmask8 __U, __m512 __A)
+{
+ return (__m512)__builtin_ia32_sqrtps512_mask((__v16sf)__A,
+ (__v16sf) _mm512_setzero_ps (),
+ (__mmask16) __U,
+ _MM_FROUND_CUR_DIRECTION);
+}
+
static __inline__ __m512d __DEFAULT_FN_ATTRS
_mm512_rsqrt14_pd(__m512d __A)
{
@@ -1304,6 +1341,23 @@ _mm512_rsqrt14_pd(__m512d __A)
_mm512_setzero_pd (),
(__mmask8) -1);}
+static __inline__ __m512d __DEFAULT_FN_ATTRS
+_mm512_mask_rsqrt14_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A,
+ (__v8df) __W,
+ (__mmask8) __U);
+}
+
+static __inline__ __m512d __DEFAULT_FN_ATTRS
+_mm512_maskz_rsqrt14_pd (__mmask8 __U, __m512d __A)
+{
+ return (__m512d) __builtin_ia32_rsqrt14pd512_mask ((__v8df) __A,
+ (__v8df)
+ _mm512_setzero_pd (),
+ (__mmask8) __U);
+}
+
static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_rsqrt14_ps(__m512 __A)
{
@@ -1313,6 +1367,23 @@ _mm512_rsqrt14_ps(__m512 __A)
(__mmask16) -1);
}
+static __inline__ __m512 __DEFAULT_FN_ATTRS
+_mm512_mask_rsqrt14_ps (__m512 __W, __mmask16 __U, __m512 __A)
+{
+ return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A,
+ (__v16sf) __W,
+ (__mmask16) __U);
+}
+
+static __inline__ __m512 __DEFAULT_FN_ATTRS
+_mm512_maskz_rsqrt14_ps (__mmask16 __U, __m512 __A)
+{
+ return (__m512) __builtin_ia32_rsqrt14ps512_mask ((__v16sf) __A,
+ (__v16sf)
+ _mm512_setzero_ps (),
+ (__mmask16) __U);
+}
+
static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_rsqrt14_ss(__m128 __A, __m128 __B)
{
@@ -1378,6 +1449,23 @@ _mm512_rcp14_pd(__m512d __A)
(__mmask8) -1);
}
+static __inline__ __m512d __DEFAULT_FN_ATTRS
+_mm512_mask_rcp14_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A,
+ (__v8df) __W,
+ (__mmask8) __U);
+}
+
+static __inline__ __m512d __DEFAULT_FN_ATTRS
+_mm512_maskz_rcp14_pd (__mmask8 __U, __m512d __A)
+{
+ return (__m512d) __builtin_ia32_rcp14pd512_mask ((__v8df) __A,
+ (__v8df)
+ _mm512_setzero_pd (),
+ (__mmask8) __U);
+}
+
static __inline__ __m512 __DEFAULT_FN_ATTRS
_mm512_rcp14_ps(__m512 __A)
{
@@ -1386,6 +1474,24 @@ _mm512_rcp14_ps(__m512 __A)
_mm512_setzero_ps (),
(__mmask16) -1);
}
+
+static __inline__ __m512 __DEFAULT_FN_ATTRS
+_mm512_mask_rcp14_ps (__m512 __W, __mmask16 __U, __m512 __A)
+{
+ return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A,
+ (__v16sf) __W,
+ (__mmask16) __U);
+}
+
+static __inline__ __m512 __DEFAULT_FN_ATTRS
+_mm512_maskz_rcp14_ps (__mmask16 __U, __m512 __A)
+{
+ return (__m512) __builtin_ia32_rcp14ps512_mask ((__v16sf) __A,
+ (__v16sf)
+ _mm512_setzero_ps (),
+ (__mmask16) __U);
+}
+
static __inline__ __m128 __DEFAULT_FN_ATTRS
_mm_rcp14_ss(__m128 __A, __m128 __B)
{
Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=269649&r1=269648&r2=269649&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Mon May 16 06:42:01 2016
@@ -12,6 +12,20 @@ __m512d test_mm512_sqrt_pd(__m512d a)
return _mm512_sqrt_pd(a);
}
+__m512d test_mm512_mask_sqrt_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_sqrt_pd
+ // CHECK: @llvm.x86.avx512.mask.sqrt.pd.512
+ return _mm512_mask_sqrt_pd (__W,__U,__A);
+}
+
+__m512d test_mm512_maskz_sqrt_pd (__mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_maskz_sqrt_pd
+ // CHECK: @llvm.x86.avx512.mask.sqrt.pd.512
+ return _mm512_maskz_sqrt_pd (__U,__A);
+}
+
__m512 test_mm512_sqrt_ps(__m512 a)
{
// CHECK-LABEL: @test_mm512_sqrt_ps
@@ -19,6 +33,20 @@ __m512 test_mm512_sqrt_ps(__m512 a)
return _mm512_sqrt_ps(a);
}
+__m512 test_mm512_mask_sqrt_ps(__m512 __W, __mmask8 __U, __m512 __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_sqrt_ps
+ // CHECK: @llvm.x86.avx512.mask.sqrt.ps.512
+ return _mm512_mask_sqrt_ps( __W, __U, __A);
+}
+
+__m512 test_mm512_maskz_sqrt_ps( __mmask8 __U, __m512 __A)
+{
+ // CHECK-LABEL: @test_mm512_maskz_sqrt_ps
+ // CHECK: @llvm.x86.avx512.mask.sqrt.ps.512
+ return _mm512_maskz_sqrt_ps(__U ,__A);
+}
+
__m512d test_mm512_rsqrt14_pd(__m512d a)
{
// CHECK-LABEL: @test_mm512_rsqrt14_pd
@@ -26,6 +54,20 @@ __m512d test_mm512_rsqrt14_pd(__m512d a)
return _mm512_rsqrt14_pd(a);
}
+__m512d test_mm512_mask_rsqrt14_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_rsqrt14_pd
+ // CHECK: @llvm.x86.avx512.rsqrt14.pd.512
+ return _mm512_mask_rsqrt14_pd (__W,__U,__A);
+}
+
+__m512d test_mm512_maskz_rsqrt14_pd (__mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_maskz_rsqrt14_pd
+ // CHECK: @llvm.x86.avx512.rsqrt14.pd.512
+ return _mm512_maskz_rsqrt14_pd (__U,__A);
+}
+
__m512 test_mm512_rsqrt14_ps(__m512 a)
{
// CHECK-LABEL: @test_mm512_rsqrt14_ps
@@ -33,6 +75,20 @@ __m512 test_mm512_rsqrt14_ps(__m512 a)
return _mm512_rsqrt14_ps(a);
}
+__m512 test_mm512_mask_rsqrt14_ps (__m512 __W, __mmask16 __U, __m512 __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_rsqrt14_ps
+ // CHECK: @llvm.x86.avx512.rsqrt14.ps.512
+ return _mm512_mask_rsqrt14_ps (__W,__U,__A);
+}
+
+__m512 test_mm512_maskz_rsqrt14_ps (__mmask16 __U, __m512 __A)
+{
+ // CHECK-LABEL: @test_mm512_maskz_rsqrt14_ps
+ // CHECK: @llvm.x86.avx512.rsqrt14.ps.512
+ return _mm512_maskz_rsqrt14_ps (__U,__A);
+}
+
__m512 test_mm512_add_ps(__m512 a, __m512 b)
{
// CHECK-LABEL: @test_mm512_add_ps
@@ -4879,6 +4935,34 @@ __m128 test_mm_maskz_rsqrt14_ss(__mmask8
return _mm_maskz_rsqrt14_ss(__U, __A, __B);
}
+__m512d test_mm512_mask_rcp14_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_rcp14_pd
+ // CHECK: @llvm.x86.avx512.rcp14.pd.512
+ return _mm512_mask_rcp14_pd (__W,__U,__A);
+}
+
+__m512d test_mm512_maskz_rcp14_pd (__mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_maskz_rcp14_pd
+ // CHECK: @llvm.x86.avx512.rcp14.pd.512
+ return _mm512_maskz_rcp14_pd (__U,__A);
+}
+
+__m512 test_mm512_mask_rcp14_ps (__m512 __W, __mmask16 __U, __m512 __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_rcp14_ps
+ // CHECK: @llvm.x86.avx512.rcp14.ps.512
+ return _mm512_mask_rcp14_ps (__W,__U,__A);
+}
+
+__m512 test_mm512_maskz_rcp14_ps (__mmask16 __U, __m512 __A)
+{
+ // CHECK-LABEL: @test_mm512_maskz_rcp14_ps
+ // CHECK: @llvm.x86.avx512.rcp14.ps.512
+ return _mm512_maskz_rcp14_ps (__U,__A);
+}
+
__m128d test_mm_mask_rcp14_sd(__m128d __W, __mmask8 __U, __m128d __A, __m128d __B){
// CHECK-LABEL: @test_mm_mask_rcp14_sd
// CHECK: @llvm.x86.avx512.rcp14.sd
More information about the cfe-commits
mailing list