Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx2-vbroadcastsd_pd-2.c

raw
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 union128d s1;
12 union256d res;
13 double res_ref[4];
14 int i, j;
15 int fail = 0;
16
17 for (i = 0; i < 10; i++)
18 {
19 s1.a[0] = i * 3.14;
20
21 res.x = _mm256_broadcastsd_pd (s1.x);
22
23 for (j = 0; j < 4; j++)
24 memcpy (res_ref + j, s1.a, 8);
25
26 fail += check_union256d (res, res_ref);
27 }
28
29 if (fail != 0)
30 abort ();
31
32 }