File: pr56787.c

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (34 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* { dg-do compile } */
/* { dg-require-effective-target vect_float } */

inline void
bar (const float s[5], float z[3][5])
{
  float a = s[0], b = s[1], c = s[2], d = s[3], e = s[4];
  float f = a;
  float u = f * b, v = f * c, w = f * d;
  float p = 0.4f * (e - 0.5f * (b * u + c * v + d * w));
  z[0][3] = b * w;
  z[1][3] = c * w;
  z[2][3] = d * w + p;
}

void
foo (unsigned long n, const float *__restrict u0,
     const float *__restrict u1, const float *__restrict u2,
     const float *__restrict u3, const float *__restrict u4,
     const float *__restrict s0, const float *__restrict s1,
     const float *__restrict s2, float *__restrict t3,
     float *__restrict t4)
{
  unsigned long i;
  for (i = 0; i < n; i++)
    {
      float u[5], f[3][5];
      u[0] = u0[i]; u[1] = u1[i]; u[2] = u2[i]; u[3] = u3[i]; u[4] = u4[i];
      bar (u, f);
      t3[i] = s0[i] * f[0][3] + s1[i] * f[1][3] + s2[i] * f[2][3];
    }
}

/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */