2 /* { dg-require-effective-target avx512er } */
3 /* { dg-options "-O2 -mavx512er" } */
5 #include "avx512er-check.h"
6 #include "avx512f-mask-type.h"
7 #include "avx512f-helper.h"
11 compute_vrsqrt28ps (float *s
, float *r
)
14 for (i
= 0; i
< 16; i
++)
15 r
[i
] = 1.0 / sqrt (s
[i
]);
21 union512 src
, res1
, res2
, res3
;
22 __mmask16 mask
= MASK_VALUE
;
26 for (i
= 0; i
< 16; i
++)
28 src
.a
[i
] = 179.345 - 6.5645 * i
;
29 res2
.a
[i
] = DEFAULT_VALUE
;
32 res1
.x
= _mm512_rsqrt28_ps (src
.x
);
33 res2
.x
= _mm512_mask_rsqrt28_ps (res2
.x
, mask
, src
.x
);
34 res3
.x
= _mm512_maskz_rsqrt28_ps (mask
, src
.x
);
36 compute_vrsqrt28ps (src
.a
, res_ref
);
38 if (check_rough_union512 (res1
, res_ref
, 0.0001))
41 MASK_MERGE ()(res_ref
, mask
, 16);
42 if (check_rough_union512 (res2
, res_ref
, 0.0001))
45 MASK_ZERO ()(res_ref
, mask
, 16);
46 if (check_rough_union512 (res3
, res_ref
, 0.0001))