2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
10 #define SIZE (AVX512F_LEN / 64)
11 #include "avx512f-mask-type.h"
13 #if AVX512F_LEN == 512
15 #define CMP(imm, rel) \
17 for (i = 0; i < 8; i++) \
19 dst_ref = ((rel) << i) | dst_ref; \
21 source1.x = _mm512_loadu_si512 (s1); \
22 source2.x = _mm512_loadu_si512 (s2); \
23 dst1 = _mm512_cmp_epu64_mask (source1.x, source2.x, imm);\
24 dst2 = _mm512_mask_cmp_epu64_mask (mask, source1.x, source2.x, imm);\
25 if (dst_ref != dst1) abort(); \
26 if ((mask & dst_ref) != dst2) abort();
29 #if AVX512F_LEN == 256
31 #define CMP(imm, rel) \
33 for (i = 0; i < 4; i++) \
35 dst_ref = ((rel) << i) | dst_ref; \
37 source1.x = _mm256_loadu_si256 ((__m256i*)s1); \
38 source2.x = _mm256_loadu_si256 ((__m256i*)s2); \
39 dst1 = _mm256_cmp_epu64_mask (source1.x, source2.x, imm);\
40 dst2 = _mm256_mask_cmp_epu64_mask (mask, source1.x, source2.x, imm);\
41 if (dst_ref != dst1) abort(); \
42 if ((mask & dst_ref) != dst2) abort();
45 #if AVX512F_LEN == 128
47 #define CMP(imm, rel) \
49 for (i = 0; i < 2; i++) \
51 dst_ref = ((rel) << i) | dst_ref; \
53 source1.x = _mm_loadu_si128 ((__m128i*)s1); \
54 source2.x = _mm_loadu_si128 ((__m128i*)s2); \
55 dst1 = _mm_cmp_epu64_mask (source1.x, source2.x, imm);\
56 dst2 = _mm_mask_cmp_epu64_mask (mask, source1.x, source2.x, imm);\
57 if (dst_ref != dst1) abort(); \
58 if ((mask & dst_ref) != dst2) abort();
64 UNION_TYPE (AVX512F_LEN
, i_q
) source1
, source2
;
65 MASK_TYPE dst1
, dst2
, dst_ref
;
66 MASK_TYPE mask
= MASK_VALUE
;
68 unsigned long long s1
[8] = {2134, 6678, 453, 54646,
69 231, 5674, 111, 23241};
70 unsigned long long s2
[8] = {41124, 6678, 8653, 856,
73 CMP(0x00, s1
[i
] == s2
[i
]);
74 CMP(0x01, s1
[i
] < s2
[i
]);
75 CMP(0x02, s1
[i
] <= s2
[i
]);
77 CMP(0x04, s1
[i
] != s2
[i
]);
78 CMP(0x05, s1
[i
] >= s2
[i
]);
79 CMP(0x06, s1
[i
] > s2
[i
]);