1 /* { dg-do compile */
2 /* { dg-options "-O2 -ftree-vectorize" } */
3 /* { dg-final { scan-assembler-not "fpmpy" } } */
4
5 /* fpma and fpms will show in either way because there are no
6 specific vector add/sub instructions. So we just check for fpmpy. */
7
8 #define N 16
9 extern void bar(float *, float *, float *, float *);
foo()10 void foo()
11 {
12 int i;
13 float a[N], b[N], c[N], d[N];
14 bar(a,b,c,d);
15 for (i = 0; i < N; i++) {
16 a[i] = b[i] + c[i] * d[i];
17 }
18 bar(a,b,c,d);
19 #if 0
20 for (i = 0; i < N; i++) {
21 a[i] = b[i] - c[i] * d[i];
22 }
23 bar(a,b,c,d);
24 #endif
25 for (i = 0; i < N; i++) {
26 a[i] = b[i] * c[i] + d[i];
27 }
28 bar(a,b,c,d);
29 for (i = 0; i < N; i++) {
30 a[i] = b[i] * c[i] - d[i];
31 }
32 bar(a,b,c,d);
33 }
34