OSDN Git Service

PR target/59839
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / avx2-vbroadcastsi128-2.c
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 void static
9 avx2_test (void)
10 {
11   union128i_q s1;
12   union256i_q res;
13   long long int res_ref[4];
14   int i, j;
15   int fail = 0;
16
17   for (i = 0; i < 10; i++)
18     {
19       for (j = 0; j < 2; j++)
20         s1.a[j] = j * i;
21
22       res.x = _mm_broadcastsi128_si256 (s1.x);
23
24       memcpy (res_ref, s1.a, 16);
25       memcpy (res_ref + 2, s1.a, 16);
26
27       fail += check_union256i_q (res, res_ref);
28     }
29
30   if (fail != 0)
31     abort ();
32
33 }