2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 32)
10 #include "avx512f-mask-type.h"
14 CALC (unsigned char *r
, unsigned int *s
)
17 for (i
= 0; i
< 16; i
++)
19 r
[i
] = (s
[i
] > UCHAR_MAX
) ? UCHAR_MAX
: s
[i
];
20 r
[i
] = (i
< SIZE
) ? r
[i
] : 0;
28 UNION_TYPE (128, i_ub
) res1
, res2
, res3
;
29 unsigned char res4
[16];
30 UNION_TYPE (AVX512F_LEN
, i_ud
) src
;
31 MASK_TYPE mask
= MASK_VALUE
;
32 unsigned char res_ref
[16];
34 for (i
= 0; i
< SIZE
; i
++)
36 src
.a
[i
] = 1 + 34 * i
;
37 res2
.a
[i
] = DEFAULT_VALUE
;
38 res4
[i
] = DEFAULT_VALUE
;
41 res1
.x
= INTRINSIC (_cvtusepi32_epi8
) (src
.x
);
42 res2
.x
= INTRINSIC (_mask_cvtusepi32_epi8
) (res2
.x
, mask
, src
.x
);
43 res3
.x
= INTRINSIC (_maskz_cvtusepi32_epi8
) (mask
, src
.x
);
44 INTRINSIC (_mask_cvtusepi32_storeu_epi8
) (res4
, mask
, src
.x
);
46 CALC (res_ref
, src
.a
);
48 if (UNION_CHECK (128, i_ub
) (res1
, res_ref
))
51 MASK_MERGE (i_ub
) (res_ref
, mask
, SIZE
);
52 if (UNION_CHECK (128, i_ub
) (res2
, res_ref
))
55 if (checkVuc (res4
, res_ref
, 16))
58 MASK_ZERO (i_ub
) (res_ref
, mask
, SIZE
);
59 if (UNION_CHECK (128, i_ub
) (res3
, res_ref
))