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"
13 CALC (unsigned char *r
, unsigned int *s
)
16 for (i
= 0; i
< 16; i
++)
18 r
[i
] = (s
[i
] > UCHAR_MAX
) ? UCHAR_MAX
: s
[i
];
19 r
[i
] = (i
< SIZE
) ? r
[i
] : 0;
27 UNION_TYPE (128, i_b
) res1
, res2
, res3
;
28 unsigned char res4
[16];
29 UNION_TYPE (AVX512F_LEN
, i_d
) src
;
30 MASK_TYPE mask
= MASK_VALUE
;
31 unsigned char res_ref
[16];
33 for (i
= 0; i
< SIZE
; i
++)
35 src
.a
[i
] = 1 + 34 * i
;
36 res2
.a
[i
] = DEFAULT_VALUE
;
37 res4
[i
] = DEFAULT_VALUE
;
40 res1
.x
= INTRINSIC (_cvtusepi32_epi8
) (src
.x
);
41 res2
.x
= INTRINSIC (_mask_cvtusepi32_epi8
) (res2
.x
, mask
, src
.x
);
42 res3
.x
= INTRINSIC (_maskz_cvtusepi32_epi8
) (mask
, src
.x
);
43 INTRINSIC (_mask_cvtusepi32_storeu_epi8
) (res4
, mask
, src
.x
);
45 CALC (res_ref
, src
.a
);
47 if (UNION_CHECK (128, i_b
) (res1
, res_ref
))
50 MASK_MERGE (i_b
) (res_ref
, mask
, SIZE
);
51 if (UNION_CHECK (128, i_b
) (res2
, res_ref
))
54 if (checkVc (res4
, res_ref
, 16))
57 MASK_ZERO (i_b
) (res_ref
, mask
, SIZE
);
58 if (UNION_CHECK (128, i_b
) (res3
, res_ref
))