r269037 - [Clang][AVX512] completing missing intrinsics [vextractf].
Michael Zuckerman via cfe-commits
cfe-commits at lists.llvm.org
Tue May 10 03:14:51 PDT 2016
Author: mzuckerm
Date: Tue May 10 05:14:50 2016
New Revision: 269037
URL: http://llvm.org/viewvc/llvm-project?rev=269037&view=rev
Log:
[Clang][AVX512] completing missing intrinsics [vextractf].
Differential Revision: http://reviews.llvm.org/D20061
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=269037&r1=269036&r2=269037&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Tue May 10 05:14:50 2016
@@ -2758,19 +2758,46 @@ _mm512_permutex2var_ps(__m512 __A, __m51
/* Vector Extract */
#define _mm512_extractf64x4_pd(A, I) __extension__ ({ \
- (__m256d) \
- __builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), \
+ (__m256d) __builtin_ia32_extractf64x4_mask((__v8df)(__m512d)(A), \
(I), \
(__v4df)_mm256_setzero_si256(), \
(__mmask8) -1); })
+#define _mm512_mask_extractf64x4_pd( __W, __U, __A, __imm) __extension__ ({\
+ (__m256d) __builtin_ia32_extractf64x4_mask ((__v8df) __A, \
+ __imm,\
+ (__v4df) __W,\
+ (__mmask8) __U);\
+})
+
+#define _mm512_maskz_extractf64x4_pd( __U, __A, __imm) __extension__ ({\
+ (__m256d) __builtin_ia32_extractf64x4_mask ((__v8df) __A,\
+ __imm,\
+ (__v4df)\
+ _mm256_setzero_pd (),\
+ (__mmask8) __U);\
+})
+
#define _mm512_extractf32x4_ps(A, I) __extension__ ({ \
- (__m128) \
- __builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), \
+ (__m128) __builtin_ia32_extractf32x4_mask((__v16sf)(__m512)(A), \
(I), \
(__v4sf)_mm_setzero_ps(), \
(__mmask8) -1); })
+#define _mm512_mask_extractf32x4_ps( __W, __U, __A, __imm) __extension__ ({\
+ (__m128) __builtin_ia32_extractf32x4_mask ((__v16sf) __A,\
+ __imm,\
+ (__v4sf) __W,\
+ (__mmask8) __U);\
+})
+
+#define _mm512_maskz_extractf32x4_ps( __U, __A, __imm) __extension__ ({\
+ (__m128) __builtin_ia32_extractf32x4_mask ((__v16sf) __A,\
+ __imm,\
+ (__v4sf)\
+ _mm_setzero_ps (),\
+ (__mmask8) __U);\
+})
/* Vector Blend */
static __inline __m512d __DEFAULT_FN_ATTRS
@@ -3014,7 +3041,7 @@ _mm512_maskz_cvtpd_ps (__mmask8 __U, __m
(__mmask8) __U,
_MM_FROUND_CUR_DIRECTION);
}
-
+
#define _mm512_cvtps_ph(A, I) __extension__ ({ \
(__m256i)__builtin_ia32_vcvtps2ph512_mask((__v16sf)(A), (I), \
(__v16hi)_mm256_setzero_si256(), \
@@ -3100,7 +3127,7 @@ _mm512_maskz_cvttpd_epi32 (__mmask8 __U,
(__m512i)__builtin_ia32_cvttps2dq512_mask((__v16sf)(A), \
(__v16si)_mm512_setzero_si512(), \
(__mmask16)-1, (R)); })
-
+
static __inline __m512i __DEFAULT_FN_ATTRS
_mm512_cvttps_epi32(__m512 __a)
{
Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=269037&r1=269036&r2=269037&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Tue May 10 05:14:50 2016
@@ -842,6 +842,18 @@ __m256d test_mm512_extractf64x4_pd(__m51
return _mm512_extractf64x4_pd(a, 1);
}
+__m256d test_mm512_mask_extractf64x4_pd(__m256d __W,__mmask8 __U,__m512d __A){
+ //CHECK-LABLE:@test_mm512_mask_extractf64x4_pd
+ //CHECL:@llvm.x86.avx512.mask.vextractf64x4.512
+ return _mm512_mask_extractf64x4_pd( __W, __U, __A, 1);
+}
+
+__m256d test_mm512_maskz_extractf64x4_pd(__mmask8 __U,__m512d __A){
+ //CHECK-LABLE:@test_mm512_maskz_extractf64x4_pd
+ //CHECL:@llvm.x86.avx512.mask.vextractf64x4.512
+ return _mm512_maskz_extractf64x4_pd( __U, __A, 1);
+}
+
__m128 test_mm512_extractf32x4_ps(__m512 a)
{
// CHECK-LABEL: @test_mm512_extractf32x4_ps
@@ -849,6 +861,18 @@ __m128 test_mm512_extractf32x4_ps(__m512
return _mm512_extractf32x4_ps(a, 1);
}
+__m128 test_mm512_mask_extractf32x4_ps(__m128 __W, __mmask8 __U,__m512d __A){
+ //CHECK-LABLE:@test_mm512_mask_extractf32x4_ps
+ //CHECL: @llvm.x86.avx512.mask.vextractf32x4.512
+ return _mm512_mask_extractf32x4_ps( __W, __U, __A, 1);
+}
+
+__m128 test_mm512_maskz_extractf32x4_ps( __mmask8 __U,__m512d __A){
+ //CHECK-LABLE:@test_mm512_maskz_extractf32x4_ps
+ //CHECL: @llvm.x86.avx512.mask.vextractf32x4.512
+ return _mm512_maskz_extractf32x4_ps( __U, __A, 1);
+}
+
__mmask16 test_mm512_cmpeq_epu32_mask(__m512i __a, __m512i __b) {
// CHECK-LABEL: @test_mm512_cmpeq_epu32_mask
// CHECK: @llvm.x86.avx512.mask.ucmp.d.512(<16 x i32> {{.*}}, <16 x i32> {{.*}}, i32 0, i16 -1)
More information about the cfe-commits
mailing list