Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx2-vbroadcastss_ps-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 union128 s1, res;
12 float res_ref[4];
13 int i, j;
14 int fail = 0;
15
16 for (i = 0; i < 10; i++)
17 {
18 s1.a[0] = i * 3.14;
19
20 res.x = _mm_broadcastss_ps (s1.x);
21
22 for (j = 0; j < 4; j++)
23 memcpy (res_ref + j, s1.a, 4);
24
25 fail += check_union128 (res, res_ref);
26 }
27
28 if (fail != 0)
29 abort ();
30
31 }