Stop only if there aren't any usable algorithms
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx2-vpsllq-2.c
blobc0ac89bfe0681b6fb5439273f62a4933c55c76c0
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_psllq256 (long long int *s1, long long int *s2, long long int *r)
11 int i;
12 long long int count = s2[0];
14 memset (r, 0, 32);
16 if (count < 64)
17 for (i = 0; i < 4; ++i)
18 r[i] = s1[i] << count;
21 void static
22 avx2_test (void)
24 union256i_q s1, res;
25 union128i_q s2;
26 long long int res_ref[4];
27 int i, j;
28 int fail = 0;
30 for (i = 0; i < 10; i++)
32 for (j = 0; j < 4; j++)
33 s1.a[j] = j * i;
35 s2.a[0] = i;
37 res.x = _mm256_sll_epi64 (s1.x, s2.x);
39 compute_psllq256 (s1.a, s2.a, res_ref);
41 fail += check_union256i_q (res, res_ref);
44 if (fail != 0)
45 abort ();