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 / 32)
10 #include "avx512f-mask-type.h"
13 calc_sub (float *r
, float *s1
, float *s2
)
17 for (i
= 1; i
< SIZE
; i
++)
25 union128 res1
, res2
, res3
, res4
, src1
, src2
;
30 for (i
= 0; i
< SIZE
; i
++)
32 src1
.a
[i
] = 1.5 + 34.67 * i
* sign
;
33 src2
.a
[i
] = -22.17 * i
* sign
+ 1.0;
34 res1
.a
[i
] = DEFAULT_VALUE
;
35 res3
.a
[i
] = DEFAULT_VALUE
;
39 res1
.x
= _mm_mask_sub_ss (res1
.x
, mask
, src1
.x
, src2
.x
);
40 res2
.x
= _mm_maskz_sub_ss (mask
, src1
.x
, src2
.x
);
41 res3
.x
= _mm_mask_sub_round_ss (res3
.x
, mask
, src1
.x
, src2
.x
, _MM_FROUND_NO_EXC
);
42 res4
.x
= _mm_maskz_sub_round_ss (mask
, src1
.x
, src2
.x
, _MM_FROUND_NO_EXC
);
44 calc_sub (res_ref
, src1
.a
, src2
.a
);
46 MASK_MERGE () (res_ref
, mask
, 1);
47 if (check_union128 (res1
, res_ref
))
50 MASK_ZERO () (res_ref
, mask
, 1);
51 if (check_union128 (res2
, res_ref
))
54 calc_sub (res_ref
, src1
.a
, src2
.a
);
56 MASK_MERGE () (res_ref
, mask
, 1);
57 if (check_union128 (res3
, res_ref
))
60 MASK_ZERO () (res_ref
, mask
, 1);
61 if (check_union128 (res4
, res_ref
))