Merge branches/gcc-4_9-branch rev 225109.
[official-gcc.git] / gcc-4_9-branch / gcc / testsuite / gcc.dg / vect / pr56787.c
blob0b09c862b16bbca7610607561398c3bdcab230e9
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_float } */
4 inline void
5 bar (const float s[5], float z[3][5])
7 float a = s[0], b = s[1], c = s[2], d = s[3], e = s[4];
8 float f = a;
9 float u = f * b, v = f * c, w = f * d;
10 float p = 0.4f * (e - 0.5f * (b * u + c * v + d * w));
11 z[0][3] = b * w;
12 z[1][3] = c * w;
13 z[2][3] = d * w + p;
16 void
17 foo (unsigned long n, const float *__restrict u0,
18 const float *__restrict u1, const float *__restrict u2,
19 const float *__restrict u3, const float *__restrict u4,
20 const float *__restrict s0, const float *__restrict s1,
21 const float *__restrict s2, float *__restrict t3,
22 float *__restrict t4)
24 unsigned long i;
25 for (i = 0; i < n; i++)
27 float u[5], f[3][5];
28 u[0] = u0[i]; u[1] = u1[i]; u[2] = u2[i]; u[3] = u3[i]; u[4] = u4[i];
29 bar (u, f);
30 t3[i] = s0[i] * f[0][3] + s1[i] * f[1][3] + s2[i] * f[2][3];
34 /* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
35 /* { dg-final { cleanup-tree-dump "vect" } } */