2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / avx2-vpunpcklqdq-2.c
blob1c6db718a48acdbb3850b4987570d65b39a05e63
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_punpcklqdq256 (long long int *s1, long long int *s2, long long int *r)
13 r[0] = s1[0];
14 r[1] = s2[0];
15 r[2] = s1[2];
16 r[3] = s2[2];
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_unpacklo_epi64 (s1.x, s2.x);
37 compute_punpcklqdq256 (s1.a, s2.a, res_ref);
39 fail += check_union256i_q (res, res_ref);
42 if (fail != 0)
43 abort ();