Stop only if there aren't any usable algorithms
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512er-vrsqrt28ss-2.c
blobf7bfff5a50da25860195aaf8be60385774cda7de
1 /* { dg-do run } */
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"
8 #include <math.h>
10 void static
11 avx512er_test (void)
13 union128 src1, src2, res;
14 float res_ref[4];
15 int i;
17 for (i = 0; i < 4; i++)
19 src1.a[i] = 179.345 - 6.5645 * i;
20 src2.a[i] = 179221345 + 6.5645 * i;
21 res_ref[i] = src1.a[i];
24 res_ref[0] = 1.0 / sqrt (src2.a[0]);
26 res.x = _mm_rsqrt28_round_ss (src1.x, src2.x, _MM_FROUND_NO_EXC);
28 if (checkVf (res.a, res_ref, 4))
29 abort ();