2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx512f-vscalefsd-2.c
blob28738f7783786bf317be8ca355656be0a7af7825
1 /* { dg-do run } */
2 /* { dg-options "-mavx512f -O2" } */
3 /* { dg-require-effective-target avx512f } */
5 #include <math.h>
6 #include "avx512f-check.h"
8 #define SIZE (128 / 64)
10 static void
11 compute_scalefsd (double *s1, double *s2, double *r)
13 r[0] = s1[0] * pow (2, floor (s2[0]));
14 r[1] = s1[1];
17 void static
18 avx512f_test (void)
20 union128d res1, s1, s2;
21 double res_ref[SIZE];
22 int i;
24 for (i = 0; i < SIZE; i++)
26 s1.a[i] = 11.5 * (i + 1);
27 s2.a[i] = 10.5 * (i + 1);
30 res1.x = _mm_scalef_sd (s1.x, s2.x);
32 compute_scalefsd (s1.a, s2.a, res_ref);
34 if (check_union128d (res1, res_ref))
35 abort ();