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
, int *r
)
18 for (i
= 0; i
< SRC_SIZE
; i
++)
20 r
[i
] = (s
[i
] >= 0) ? (int) (s
[i
] + 0.5)
28 UNION_TYPE (AVX512F_LEN
, d
) s
;
29 UNION_TYPE (AVX512F_LEN_HALF
, i_d
) res1
, res2
, res3
;
30 MASK_TYPE mask
= MASK_VALUE
;
31 int res_ref
[DST_SIZE
] = { 0 };
34 for (i
= 0; i
< SRC_SIZE
; i
++)
36 s
.a
[i
] = 123.456 * (i
+ 2000) * sign
;
40 for (i
= 0; i
< DST_SIZE
; i
++)
41 res2
.a
[i
] = DEFAULT_VALUE
;
43 res1
.x
= INTRINSIC (_cvtpd_epi32
) (s
.x
);
44 res2
.x
= INTRINSIC (_mask_cvtpd_epi32
) (res2
.x
, mask
, s
.x
);
45 res3
.x
= INTRINSIC (_maskz_cvtpd_epi32
) (mask
, s
.x
);
49 if (UNION_CHECK (AVX512F_LEN_HALF
, i_d
) (res1
, res_ref
))
52 MASK_MERGE (i_d
) (res_ref
, mask
, SRC_SIZE
);
53 if (UNION_CHECK (AVX512F_LEN_HALF
, i_d
) (res2
, res_ref
))
56 MASK_ZERO (i_d
) (res_ref
, mask
, SRC_SIZE
);
57 if (UNION_CHECK (AVX512F_LEN_HALF
, i_d
) (res3
, res_ref
))