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"
13 #if AVX512F_LEN == 512
14 #define CMP(imm, rel) \
16 for (i = 0; i < 16; i++) \
18 dst_ref = ((rel) << i) | dst_ref; \
20 source1.x = _mm512_loadu_si512 (s1); \
21 source2.x = _mm512_loadu_si512 (s2); \
22 dst1 = _mm512_cmp_epu32_mask (source1.x, source2.x, imm);\
23 dst2 = _mm512_mask_cmp_epu32_mask (mask, source1.x, source2.x, imm);\
24 if (dst_ref != dst1) abort(); \
25 if ((mask & dst_ref) != dst2) abort();
31 unsigned int s1
[16] = {2134, 6678, 453, 54646,
32 231, 5674, 111, 23241,
33 12314, 145, 671, 77575,
34 23455, 166, 5321, 5673};
35 unsigned int s2
[16] = {41124, 6678, 8653, 856,
37 2745, 4567, 3676, 123,
38 714, 3589, 5683, 5673};
39 UNION_TYPE (AVX512F_LEN
, i_d
) source1
, source2
;
40 MASK_TYPE dst1
, dst2
, dst_ref
;
41 MASK_TYPE mask
= MASK_VALUE
;
44 CMP(0x00, s1
[i
] == s2
[i
]);
45 CMP(0x01, s1
[i
] < s2
[i
]);
46 CMP(0x02, s1
[i
] <= s2
[i
]);
48 CMP(0x04, s1
[i
] != s2
[i
]);
49 CMP(0x05, s1
[i
] >= s2
[i
]);
50 CMP(0x06, s1
[i
] > s2
[i
]);