2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
5 #include "avx512f-check.h"
7 #include "avx512f-helper.h"
9 #define SIZE (128 / 64)
10 #include "avx512f-mask-type.h"
13 calc_min (double *r
, double *s1
, double *s2
)
15 r
[0] = s1
[0] < s2
[0] ? s1
[0] : s2
[0];
23 union128d res1
, res2
, res3
, res4
, src1
, src2
;
28 for (i
= 0; i
< SIZE
; i
++)
30 src1
.a
[i
] = 1.5 + 34.67 * i
* sign
;
31 src2
.a
[i
] = -22.17 * i
* sign
+ 1.0;
32 res1
.a
[i
] = DEFAULT_VALUE
;
33 res3
.a
[i
] = DEFAULT_VALUE
;
37 res1
.x
= _mm_mask_min_sd (res1
.x
, mask
, src1
.x
, src2
.x
);
38 res2
.x
= _mm_maskz_min_sd (mask
, src1
.x
, src2
.x
);
39 res3
.x
= _mm_mask_min_round_sd (res3
.x
, mask
, src1
.x
, src2
.x
, _MM_FROUND_NO_EXC
);
40 res4
.x
= _mm_maskz_min_round_sd (mask
, src1
.x
, src2
.x
, _MM_FROUND_NO_EXC
);
42 calc_min (res_ref
, src1
.a
, src2
.a
);
44 MASK_MERGE (d
) (res_ref
, mask
, 1);
45 if (check_union128d (res1
, res_ref
))
48 MASK_ZERO (d
) (res_ref
, mask
, 1);
49 if (check_union128d (res2
, res_ref
))
52 calc_min (res_ref
, src1
.a
, src2
.a
);
54 MASK_MERGE (d
) (res_ref
, mask
, 1);
55 if (check_union128d (res3
, res_ref
))
58 MASK_ZERO (d
) (res_ref
, mask
, 1);
59 if (check_union128d (res4
, res_ref
))