Stop only if there aren't any usable algorithms
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx2-vpsllvd128-2.c
blob5ab83ae20ca6898cdd11c6ff5cf99d14428cf29c
1 /* { dg-do run } */
2 /* { dg-require-effective-target avx2 } */
3 /* { dg-options "-O2 -mavx2" } */
5 #include <string.h>
6 #include "avx2-check.h"
8 static void
9 compute_psllvd128 (int *s1, int *s2, int *r)
11 int i, count;
13 for (i = 0; i < 4; ++i)
15 count = s2[i];
16 r[i] = s1[i] << count;
20 void static
21 avx2_test (void)
23 union128i_d s1, s2, res;
24 int res_ref[4];
25 int i, j, sign = 1;
26 int fail = 0;
28 for (i = 0; i < 10; i++)
30 for (j = 0; j < 4; j++)
32 s1.a[j] = j * i * sign;
33 s2.a[j] = (j + i) >> 2;
34 sign = -sign;
37 res.x = _mm_sllv_epi32 (s1.x, s2.x);
39 compute_psllvd128 (s1.a, s2.a, res_ref);
41 fail += check_union128i_d (res, res_ref);
44 if (fail != 0)
45 abort ();