r269022 - [Clang][AVX512] completing missing intrinsics [roundscale, ceil, floor]
Michael Zuckerman via cfe-commits
cfe-commits at lists.llvm.org
Tue May 10 00:30:59 PDT 2016
Author: mzuckerm
Date: Tue May 10 02:30:58 2016
New Revision: 269022
URL: http://llvm.org/viewvc/llvm-project?rev=269022&view=rev
Log:
[Clang][AVX512] completing missing intrinsics [roundscale, ceil, floor]
Differential Revision: http://reviews.llvm.org/D20070
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=269022&r1=269021&r2=269022&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Tue May 10 02:30:58 2016
@@ -1307,6 +1307,16 @@ _mm512_floor_ps(__m512 __A)
_MM_FROUND_CUR_DIRECTION);
}
+static __inline__ __m512 __DEFAULT_FN_ATTRS
+_mm512_mask_floor_ps (__m512 __W, __mmask16 __U, __m512 __A)
+{
+ return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A,
+ _MM_FROUND_FLOOR,
+ (__v16sf) __W, __U,
+ _MM_FROUND_CUR_DIRECTION);
+}
+
+
static __inline __m512d __DEFAULT_FN_ATTRS
_mm512_floor_pd(__m512d __A)
{
@@ -1316,6 +1326,25 @@ _mm512_floor_pd(__m512d __A)
_MM_FROUND_CUR_DIRECTION);
}
+static __inline__ __m512d __DEFAULT_FN_ATTRS
+_mm512_mask_floor_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A,
+ _MM_FROUND_FLOOR,
+ (__v8df) __W, __U,
+ _MM_FROUND_CUR_DIRECTION);
+}
+
+
+static __inline__ __m512 __DEFAULT_FN_ATTRS
+_mm512_mask_ceil_ps (__m512 __W, __mmask16 __U, __m512 __A)
+{
+ return (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __A,
+ _MM_FROUND_CEIL,
+ (__v16sf) __W, __U,
+ _MM_FROUND_CUR_DIRECTION);
+}
+
static __inline __m512 __DEFAULT_FN_ATTRS
_mm512_ceil_ps(__m512 __A)
{
@@ -1334,6 +1363,15 @@ _mm512_ceil_pd(__m512d __A)
_MM_FROUND_CUR_DIRECTION);
}
+static __inline__ __m512d __DEFAULT_FN_ATTRS
+_mm512_mask_ceil_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ return (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __A,
+ _MM_FROUND_CEIL,
+ (__v8df) __W, __U,
+ _MM_FROUND_CUR_DIRECTION);
+}
+
static __inline __m512i __DEFAULT_FN_ATTRS
_mm512_abs_epi64(__m512i __A)
{
@@ -1839,10 +1877,34 @@ _mm512_maskz_div_ps(__mmask16 __U, __m51
(__m512)__builtin_ia32_rndscaleps_mask((__v16sf)(A), (B), (__v16sf)(A), \
-1, _MM_FROUND_CUR_DIRECTION); })
+#define _mm512_mask_roundscale_ps( __A, __B, __C, __imm) __extension__ ({\
+ (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __C, __imm,\
+ (__v16sf) __A,(__mmask16) __B,\
+ _MM_FROUND_CUR_DIRECTION);\
+})
+
+#define _mm512_maskz_roundscale_ps( __A, __B, __imm) __extension__ ({\
+ (__m512) __builtin_ia32_rndscaleps_mask ((__v16sf) __B, __imm,\
+ (__v16sf) _mm512_setzero_ps (),\
+ (__mmask16) __A, _MM_FROUND_CUR_DIRECTION);\
+})
+
#define _mm512_roundscale_pd(A, B) __extension__ ({ \
(__m512d)__builtin_ia32_rndscalepd_mask((__v8df)(A), (B), (__v8df)(A), \
-1, _MM_FROUND_CUR_DIRECTION); })
+#define _mm512_mask_roundscale_pd(__A, __B, __C, __imm) __extension__ ({\
+ (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __C, __imm,\
+ (__v8df) __A, (__mmask8) __B,\
+ _MM_FROUND_CUR_DIRECTION);\
+})
+
+#define _mm512_maskz_roundscale_pd(__A, __B, __imm) __extension__ ({\
+ (__m512d) __builtin_ia32_rndscalepd_mask ((__v8df) __B, __imm,\
+ (__v8df) _mm512_setzero_pd (),\
+ (__mmask8) __A, _MM_FROUND_CUR_DIRECTION);\
+})
+
#define _mm512_fmadd_round_pd(A, B, C, R) __extension__ ({ \
(__m512d) __builtin_ia32_vfmaddpd512_mask ((__v8df) (A), \
(__v8df) (B), (__v8df) (C), \
Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=269022&r1=269021&r2=269022&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Tue May 10 02:30:58 2016
@@ -6023,4 +6023,58 @@ __m512 test_mm512_maskz_min_ps (__mmask1
return _mm512_maskz_min_ps (__U,__A,__B);
}
+__m512 test_mm512_mask_floor_ps (__m512 __W, __mmask16 __U, __m512 __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_floor_ps
+ // CHECK: @llvm.x86.avx512.mask.rndscale.ps.512
+ return _mm512_mask_floor_ps (__W,__U,__A);
+}
+
+__m512d test_mm512_mask_floor_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_floor_pd
+ // CHECK: @llvm.x86.avx512.mask.rndscale.pd.512
+ return _mm512_mask_floor_pd (__W,__U,__A);
+}
+
+__m512 test_mm512_mask_ceil_ps (__m512 __W, __mmask16 __U, __m512 __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_ceil_ps
+ // CHECK: @llvm.x86.avx512.mask.rndscale.ps.512
+ return _mm512_mask_ceil_ps (__W,__U,__A);
+}
+
+__m512d test_mm512_mask_ceil_pd (__m512d __W, __mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_ceil_pd
+ // CHECK: @llvm.x86.avx512.mask.rndscale.pd.512
+ return _mm512_mask_ceil_pd (__W,__U,__A);
+}
+__m512 test_mm512_mask_roundscale_ps(__m512d __W, __mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_roundscale_ps
+ // CHECK: @llvm.x86.avx512.mask.rndscale.ps.512
+ return _mm512_mask_roundscale_ps(__W,__U,__A, 1);
+}
+
+__m512 test_mm512_maskz_roundscale_ps(__mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_maskz_roundscale_ps
+ // CHECK: @llvm.x86.avx512.mask.rndscale.ps.512
+ return _mm512_maskz_roundscale_ps(__U,__A, 1);
+}
+
+__m512d test_mm512_mask_roundscale_pd(__m512d __W, __mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_mask_roundscale_pd
+ // CHECK: @llvm.x86.avx512.mask.rndscale.pd.512
+ return _mm512_mask_roundscale_pd(__W,__U,__A, 1);
+}
+
+__m512d test_mm512_maskz_roundscale_pd(__mmask8 __U, __m512d __A)
+{
+ // CHECK-LABEL: @test_mm512_maskz_roundscale_pd
+ // CHECK: @llvm.x86.avx512.mask.rndscale.pd.512
+ return _mm512_maskz_roundscale_pd(__U,__A, 1);
+}
More information about the cfe-commits
mailing list