1 /* { dg-do run } */
2 /* { dg-require-effective-target avx2 } */
3 /* { dg-options "-O2 -mavx2" } */
4 
5 #include <string.h>
6 #include "avx2-check.h"
7 
8 #define N 0x5
9 
10 static void
compute_punpckhqdq256(long long int * s1,long long int * s2,long long int * r)11 compute_punpckhqdq256 (long long int *s1, long long int *s2, long long int *r)
12 {
13   r[0] = s1[1];
14   r[1] = s2[1];
15   r[2] = s1[3];
16   r[3] = s2[3];
17 }
18 
19 void static
avx2_test(void)20 avx2_test (void)
21 {
22   union256i_q s1, s2, res;
23   long long int res_ref[4];
24   int i, j;
25   int fail = 0;
26 
27   for (i = 0; i < 10; i++)
28     {
29       for (j = 0; j < 4; j++)
30 	{
31 	  s1.a[j] = j * i;
32 	  s2.a[j] = j + 20;
33 	}
34 
35       res.x = _mm256_unpackhi_epi64 (s1.x, s2.x);
36 
37       compute_punpckhqdq256 (s1.a, s2.a, res_ref);
38 
39       fail += check_union256i_q (res, res_ref);
40     }
41 
42   if (fail != 0)
43     abort ();
44 }
45