2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 64)
10 #include "avx512f-mask-type.h"
13 CALC (char *r
, long long *s
, int mem
)
16 int len
= mem
? 8 : 16;
17 for (i
= 0; i
< len
; i
++)
21 else if (s
[i
] > CHAR_MAX
)
25 r
[i
] = (i
< SIZE
) ? r
[i
] : 0;
33 UNION_TYPE (128, i_b
) res1
, res2
, res3
;
35 UNION_TYPE (AVX512F_LEN
, i_q
) src
;
36 MASK_TYPE mask
= MASK_VALUE
;
41 for (i
= 0; i
< SIZE
; i
++)
43 src
.a
[i
] = 1 + 34 * i
* sign
;
45 res2
.a
[i
] = DEFAULT_VALUE
;
46 res4
[i
] = DEFAULT_VALUE
;
49 for (i
= SIZE
; i
< 16; i
++)
51 res_ref2
[i
] = DEFAULT_VALUE
* 2;
52 res4
[i
] = DEFAULT_VALUE
* 2;
55 res1
.x
= INTRINSIC (_cvtsepi64_epi8
) (src
.x
);
56 res2
.x
= INTRINSIC (_mask_cvtsepi64_epi8
) (res2
.x
, mask
, src
.x
);
57 res3
.x
= INTRINSIC (_maskz_cvtsepi64_epi8
) (mask
, src
.x
);
59 CALC (res_ref
, src
.a
, 0);
61 if (UNION_CHECK (128, i_b
) (res1
, res_ref
))
64 MASK_MERGE (i_b
) (res_ref
, mask
, SIZE
);
65 if (UNION_CHECK (128, i_b
) (res2
, res_ref
))
68 MASK_ZERO (i_b
) (res_ref
, mask
, SIZE
);
69 if (UNION_CHECK (128, i_b
) (res3
, res_ref
))
72 INTRINSIC (_mask_cvtsepi64_storeu_epi8
) (res4
, mask
, src
.x
);
74 CALC (res_ref2
, src
.a
, 1);
75 MASK_MERGE (i_b
) (res_ref2
, mask
, SIZE
);
77 if (checkVc (res4
, res_ref2
, 16))