Debian Codegraph @

gcc/testsuite/gcc.dg/pr98350-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast --param tree-reassoc-width=2 -fdump-tree-widening_mul" } */
3 /* { dg-additional-options "-mfpmath=sse -mfma" { target { i?86-*-* x86_64-*-* } } } */
4
5 /* Test that the compiler properly optimizes multiply and add
6 to generate more FMA instructions. */
7 #define N 1024
8 double a[N];
9 double b[N];
10 double c[N];
11 double d[N];
12 double e[N];
13 double f[N];
14 double g[N];
15 double h[N];
16 double j[N];
17 double k[N];
18 double l[N];
19 double m[N];
20 double o[N];
21 double p[N];
22
23
24 void
25 foo (void)
26 {
27 for (int i = 0; i < N; i++)
28 {
29 a[i] += b[i] * c[i] + d[i] * e[i] + f[i] * g[i] + h[i] * j[i] + k[i] * l[i] + m[i]* o[i] + p[i];
30 }
31 }
32 /* { dg-final { scan-tree-dump-times { = \.FMA \(} 6 "widening_mul" { target { i?86-*-* x86_64-*-* } } } } */