Debian Codegraph @

gcc/testsuite/gcc.target/i386/vect-addsubv4sf.c

raw
1 /* { dg-do run } */
2 /* { dg-require-effective-target sse3 } */
3 /* { dg-options "-O3 -msse3 -fdump-tree-slp2" } */
4
5 #ifndef CHECK_H
6 #define CHECK_H "sse3-check.h"
7 #endif
8
9 #ifndef TEST
10 #define TEST sse3_test
11 #endif
12
13 #include CHECK_H
14
15 float x[4], y[4], z[4];
16 void __attribute__((noipa)) foo ()
17 {
18 x[0] = y[0] - z[0];
19 x[1] = y[1] + z[1];
20 x[2] = y[2] - z[2];
21 x[3] = y[3] + z[3];
22 }
23 void __attribute__((noipa)) bar ()
24 {
25 x[0] = y[0] + z[0];
26 x[1] = y[1] - z[1];
27 x[2] = y[2] + z[2];
28 x[3] = y[3] - z[3];
29 }
30 static void
31 TEST (void)
32 {
33 for (int i = 0; i < 4; ++i)
34 {
35 y[i] = i + 1;
36 z[i] = 2 * i + 1;
37 }
38 foo ();
39 if (x[0] != 0 || x[1] != 5 || x[2] != -2 || x[3] != 11)
40 __builtin_abort ();
41 bar ();
42 if (x[0] != 2 || x[1] != -1 || x[2] != 8 || x[3] != -3)
43 __builtin_abort ();
44 }
45
46 /* { dg-final { scan-tree-dump-times "ADDSUB" 1 "slp2" } } */