r227773 - [X86] Add other flavors of AVX512 cmpps/cmppd intrinsics.
Craig Topper
craig.topper at gmail.com
Sun Feb 1 14:27:40 PST 2015
Author: ctopper
Date: Sun Feb 1 16:27:40 2015
New Revision: 227773
URL: http://llvm.org/viewvc/llvm-project?rev=227773&view=rev
Log:
[X86] Add other flavors of AVX512 cmpps/cmppd intrinsics.
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=227773&r1=227772&r2=227773&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/avx512fintrin.h (original)
+++ cfe/trunk/lib/Headers/avx512fintrin.h Sun Feb 1 16:27:40 2015
@@ -672,19 +672,37 @@ _mm512_mask_blend_epi32(__mmask16 __U, _
/* Compare */
-#define _mm512_cmp_ps_mask(a, b, p) __extension__ ({ \
- __m512 __a = (a); \
- __m512 __b = (b); \
- (__mmask16)__builtin_ia32_cmpps512_mask((__v16sf)__a, (__v16sf)__b, (p), \
- (__mmask16)-1, \
- _MM_FROUND_CUR_DIRECTION); })
-
-#define _mm512_cmp_pd_mask(a, b, p) __extension__ ({ \
- __m512 __a = (a); \
- __m512 __b = (b); \
- (__mmask8)__builtin_ia32_cmppd512_mask((__v8df)__a, (__v8df)__b, (p), \
- (__mmask8)-1, \
- _MM_FROUND_CUR_DIRECTION); })
+#define _mm512_cmp_round_ps_mask(A, B, P, R) __extension__ ({ \
+ (__mmask16)__builtin_ia32_cmpps512_mask((__v16sf)(__m512)(A), \
+ (__v16sf)(__m512)(B), \
+ (P), (__mmask16)-1, (R)); })
+
+#define _mm512_mask_cmp_round_ps_mask(U, A, B, P, R) __extension__ ({ \
+ (__mmask16)__builtin_ia32_cmpps512_mask((__v16sf)(__m512)(A), \
+ (__v16sf)(__m512)(B), \
+ (P), (__mmask16)(U), (R)); })
+
+#define _mm512_cmp_ps_mask(A, B, P) \
+ _mm512_cmp_round_ps_mask((A), (B), (P), _MM_FROUND_CUR_DIRECTION)
+
+#define _mm512_mask_cmp_ps_mask(U, A, B, P) \
+ _mm512_mask_cmp_round_ps_mask((U), (A), (B), (P), _MM_FROUND_CUR_DIRECTION)
+
+#define _mm512_cmp_round_pd_mask(A, B, P, R) __extension__ ({ \
+ (__mmask8)__builtin_ia32_cmppd512_mask((__v8df)(__m512d)(A), \
+ (__v8df)(__m512d)(B), \
+ (P), (__mmask8)-1, (R)); })
+
+#define _mm512_mask_cmp_round_pd_mask(U, A, B, P, R) __extension__ ({ \
+ (__mmask8)__builtin_ia32_cmppd512_mask((__v8df)(__m512d)(A), \
+ (__v8df)(__m512d)(B), \
+ (P), (__mmask8)(U), (R)); })
+
+#define _mm512_cmp_pd_mask(A, B, P) \
+ _mm512_cmp_round_pd_mask((A), (B), (P), _MM_FROUND_CUR_DIRECTION)
+
+#define _mm512_mask_cmp_pd_mask(U, A, B, P) \
+ _mm512_mask_cmp_round_pd_mask((U), (A), (B), (P), _MM_FROUND_CUR_DIRECTION)
/* Conversion */
Modified: cfe/trunk/test/CodeGen/avx512f-builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512f-builtins.c?rev=227773&r1=227772&r2=227773&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/avx512f-builtins.c (original)
+++ cfe/trunk/test/CodeGen/avx512f-builtins.c Sun Feb 1 16:27:40 2015
@@ -284,16 +284,52 @@ __m512 test_mm512_unpacklo_ps(__m512 a,
return _mm512_unpacklo_ps(a, b);
}
-__mmask16 test_mm512_cmp_ps_mask(__m512 __a, __m512 __b) {
- // CHECK-LABEL: @test_mm512_cmp_ps_mask
+__mmask16 test_mm512_cmp_round_ps_mask(__m512 a, __m512 b) {
+ // CHECK-LABEL: @test_mm512_cmp_round_ps_mask
// CHECK: @llvm.x86.avx512.mask.cmp.ps.512
- return _mm512_cmp_ps_mask(__a, __b, 0);
+ return _mm512_cmp_round_ps_mask(a, b, 0, _MM_FROUND_TO_NEAREST_INT);
}
-__mmask8 test_mm512_cmp_pd_mask(__m512 __a, __m512 __b) {
- // CHECK-LABEL: @test_mm512_cmp_pd_mask
+__mmask16 test_mm512_mask_cmp_round_ps_mask(__mmask16 m, __m512 a, __m512 b) {
+ // CHECK-LABEL: @test_mm512_mask_cmp_round_ps_mask
+ // CHECK: @llvm.x86.avx512.mask.cmp.ps.512
+ return _mm512_mask_cmp_round_ps_mask(m, a, b, 0, _MM_FROUND_TO_NEAREST_INT);
+}
+
+__mmask16 test_mm512_cmp_ps_mask(__m512 a, __m512 b) {
+ // check-label: @test_mm512_cmp_ps_mask
+ // check: @llvm.x86.avx512.mask.cmp.ps.512
+ return _mm512_cmp_ps_mask(a, b, 0);
+}
+
+__mmask16 test_mm512_mask_cmp_ps_mask(__mmask16 m, __m512 a, __m512 b) {
+ // CHECK-LABEL: @test_mm512_mask_cmp_ps_mask
+ // CHECK: @llvm.x86.avx512.mask.cmp.ps.512
+ return _mm512_mask_cmp_ps_mask(m, a, b, 0);
+}
+
+__mmask8 test_mm512_cmp_round_pd_mask(__m512d a, __m512d b) {
+ // CHECK-LABEL: @test_mm512_cmp_round_pd_mask
+ // CHECK: @llvm.x86.avx512.mask.cmp.pd.512
+ return _mm512_cmp_round_pd_mask(a, b, 0, _MM_FROUND_TO_NEAREST_INT);
+}
+
+__mmask8 test_mm512_mask_cmp_round_pd_mask(__mmask8 m, __m512d a, __m512d b) {
+ // CHECK-LABEL: @test_mm512_mask_cmp_round_pd_mask
+ // CHECK: @llvm.x86.avx512.mask.cmp.pd.512
+ return _mm512_mask_cmp_round_pd_mask(m, a, b, 0, _MM_FROUND_TO_NEAREST_INT);
+}
+
+__mmask8 test_mm512_cmp_pd_mask(__m512d a, __m512d b) {
+ // check-label: @test_mm512_cmp_pd_mask
+ // check: @llvm.x86.avx512.mask.cmp.pd.512
+ return _mm512_cmp_pd_mask(a, b, 0);
+}
+
+__mmask8 test_mm512_mask_cmp_pd_mask(__mmask8 m, __m512d a, __m512d b) {
+ // CHECK-LABEL: @test_mm512_mask_cmp_pd_mask
// CHECK: @llvm.x86.avx512.mask.cmp.pd.512
- return _mm512_cmp_pd_mask(__a, __b, 0);
+ return _mm512_mask_cmp_pd_mask(m, a, b, 0);
}
__m256d test_mm512_extractf64x4_pd(__m512d a)
More information about the cfe-commits
mailing list