2 /* { dg-options "-O2 -mavx512dq" } */
3 /* { dg-require-effective-target avx512dq } */
6 #include "avx512f-helper.h"
8 #define SIZE (AVX512F_LEN / 64)
9 #include "avx512f-mask-type.h"
12 CALC (unsigned long long *r
, float *s
)
15 for (i
= 0; i
< SIZE
; i
++)
16 r
[i
] = (unsigned long long) (s
[i
] + ((s
[i
] >= 0) ? 0.5 : -0.5));
23 UNION_TYPE (AVX512F_LEN
, i_q
) res1
, res2
, res3
;
24 UNION_TYPE (AVX512F_LEN_HALF
,) src
;
25 MASK_TYPE mask
= MASK_VALUE
;
26 unsigned long long res_ref
[SIZE
];
28 for (i
= 0; i
< SIZE
; i
++)
30 res2
.a
[i
] = DEFAULT_VALUE
;
31 src
.a
[i
] = 1.5 + 34.67 * i
;
34 res1
.x
= INTRINSIC (_cvtps_epu64
) (src
.x
);
35 res2
.x
= INTRINSIC (_mask_cvtps_epu64
) (res2
.x
, mask
, src
.x
);
36 res3
.x
= INTRINSIC (_maskz_cvtps_epu64
) (mask
, src
.x
);
38 CALC (res_ref
, src
.a
);
40 if (UNION_CHECK (AVX512F_LEN
, i_q
) (res1
, res_ref
))
43 MASK_MERGE (i_q
) (res_ref
, mask
, SIZE
);
44 if (UNION_CHECK (AVX512F_LEN
, i_q
) (res2
, res_ref
))
47 MASK_ZERO (i_q
) (res_ref
, mask
, SIZE
);
48 if (UNION_CHECK (AVX512F_LEN
, i_q
) (res3
, res_ref
))