2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx2-vpunpckhqdq-2.c
blob4668571c482a6a4cc7aada9cce2edb9972e5f5e3
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 #define N 0x5
10 static void
11 compute_punpckhqdq256 (long long int *s1, long long int *s2, long long int *r)
13 r[0] = s1[1];
14 r[1] = s2[1];
15 r[2] = s1[3];
16 r[3] = s2[3];
19 void static
20 avx2_test (void)
22 union256i_q s1, s2, res;
23 long long int res_ref[4];
24 int i, j;
25 int fail = 0;
27 for (i = 0; i < 10; i++)
29 for (j = 0; j < 4; j++)
31 s1.a[j] = j * i;
32 s2.a[j] = j + 20;
35 res.x = _mm256_unpackhi_epi64 (s1.x, s2.x);
37 compute_punpckhqdq256 (s1.a, s2.a, res_ref);
39 fail += check_union256i_q (res, res_ref);
42 if (fail != 0)
43 abort ();