2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
10 #define SIZE (AVX512F_LEN / 32)
11 #include "avx512f-mask-type.h"
15 #if AVX512F_LEN == 512
17 #define CMP(imm, rel) \
19 for (i = 0; i < 8; i++) \
21 dst_ref = ((rel) << i) | dst_ref; \
23 source1.x = _mm512_loadu_si512 (s1); \
24 source2.x = _mm512_loadu_si512 (s2); \
25 dst1 = _mm512_cmp_epi64_mask (source1.x, source2.x, imm);\
26 dst2 = _mm512_mask_cmp_epi64_mask (mask, source1.x, source2.x, imm);\
27 if (dst_ref != dst1) abort(); \
28 if ((mask & dst_ref) != dst2) abort();
31 #if AVX512F_LEN == 256
33 #define CMP(imm, rel) \
35 for (i = 0; i < 4; i++) \
37 dst_ref = ((rel) << i) | dst_ref; \
39 source1.x = _mm256_loadu_si256 ((__m256i*)s1); \
40 source2.x = _mm256_loadu_si256 ((__m256i*)s2); \
41 dst1 = _mm256_cmp_epi64_mask (source1.x, source2.x, imm);\
42 dst2 = _mm256_mask_cmp_epi64_mask (mask, source1.x, source2.x, imm);\
43 if (dst_ref != dst1) abort(); \
44 if ((mask & dst_ref) != dst2) abort();
47 #if AVX512F_LEN == 128
49 #define CMP(imm, rel) \
51 for (i = 0; i < 2; i++) \
53 dst_ref = ((rel) << i) | dst_ref; \
55 source1.x = _mm_loadu_si128 ((__m128i*)s1); \
56 source2.x = _mm_loadu_si128 ((__m128i*)s2); \
57 dst1 = _mm_cmp_epi64_mask (source1.x, source2.x, imm);\
58 dst2 = _mm_mask_cmp_epi64_mask (mask, source1.x, source2.x, imm);\
59 if (dst_ref != dst1) abort(); \
60 if ((mask & dst_ref) != dst2) abort();
66 UNION_TYPE (AVX512F_LEN
, i_d
) source1
, source2
;
67 MASK_TYPE dst1
, dst2
, dst_ref
;
68 MASK_TYPE mask
= MASK_VALUE
;
69 long long s1
[8] = {2134, 6678, 453, 54646,
70 231, 5674, 111, 23241};
71 long long s2
[8] = {41124, 6678, 8653, 856,
75 CMP(0x00, s1
[i
] == s2
[i
]);
76 CMP(0x01, s1
[i
] < s2
[i
]);
77 CMP(0x02, s1
[i
] <= s2
[i
]);
79 CMP(0x04, s1
[i
] != s2
[i
]);
80 CMP(0x05, s1
[i
] >= s2
[i
]);
81 CMP(0x06, s1
[i
] > s2
[i
]);