summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
blob: d5c0a1a13319d75965906bec18e695dd5b604a1e (plain)
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
35
36
37
38
39
40
/* { dg-require-effective-target vect_float } */

#include <stdlib.h>
#include "../../tree-vect.h"

__attribute__ ((noinline)) void
interp_pitch(float *exc, float *interp, int pitch, int len)
{
   int i,k;
   int maxj;

   maxj=3;
   for (i=0;i<len;i++)
   {
      float tmp = 0;
      for (k=0;k<12;k++)
      {
         tmp += exc[i-pitch+k+maxj-6];
      }
      interp[i] = tmp;
   }
}

int main()
{
   float *exc = calloc(136,sizeof(float));
   float *interp = calloc(80,sizeof(float));
   int pitch = -35;

   check_vect ();

   interp_pitch(exc, interp, pitch, 80);
   free(exc);
   free(interp);
   return 0;
}

/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */