2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
9 #define SRC_SIZE ((AVX512F_LEN) / 64)
10 #include "avx512f-mask-type.h"
11 #define DST_SIZE ((AVX512F_LEN_HALF) / 32)
14 CALC (double *s
, unsigned *r
)
18 for (i
= 0; i
< SRC_SIZE
; i
++)
20 r
[i
] = (unsigned) (s
[i
] + 0.5);
22 for (i
= SRC_SIZE
; i
< DST_SIZE
; i
++)
31 UNION_TYPE (AVX512F_LEN
, d
) s
;
32 UNION_TYPE (AVX512F_LEN_HALF
, i_ud
) res1
, res2
, res3
;
33 MASK_TYPE mask
= MASK_VALUE
;
34 unsigned res_ref
[DST_SIZE
] = { 0 };
37 for (i
= 0; i
< SRC_SIZE
; i
++)
39 s
.a
[i
] = 123.456 * (i
+ 2000);
42 for (i
= 0; i
< DST_SIZE
; i
++)
43 res2
.a
[i
] = DEFAULT_VALUE
;
45 res1
.x
= INTRINSIC (_cvtpd_epu32
) (s
.x
);
46 res2
.x
= INTRINSIC (_mask_cvtpd_epu32
) (res2
.x
, mask
, s
.x
);
47 res3
.x
= INTRINSIC (_maskz_cvtpd_epu32
) (mask
, s
.x
);
51 if (UNION_CHECK (AVX512F_LEN_HALF
, i_ud
) (res1
, res_ref
))
54 MASK_MERGE (i_ud
) (res_ref
, mask
, SRC_SIZE
);
55 if (UNION_CHECK (AVX512F_LEN_HALF
, i_ud
) (res2
, res_ref
))
58 MASK_ZERO (i_ud
) (res_ref
, mask
, SRC_SIZE
);
59 if (UNION_CHECK (AVX512F_LEN_HALF
, i_ud
) (res3
, res_ref
))