OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-outer-4d.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_float } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 40
7
#define M 128
8
float in[N+M];
9
float out[N];
10
 
11
/* Outer-loop vectorization.  */
12
 
13
__attribute__ ((noinline)) void
14
foo (){
15
  int i,j;
16
  float diff;
17
 
18
  for (i = 0; i < N; i++) {
19
    diff = 0;
20
    for (j = 0; j < M; j+=4) {
21
      diff += in[j+i];
22
    }
23
    out[i]=diff;
24
  }
25
}
26
 
27
int main (void)
28
{
29
  check_vect ();
30
  int i, j;
31
  float diff;
32
 
33
  for (i = 0; i < N; i++)
34
    in[i] = i;
35
 
36
  foo ();
37
 
38
  for (i = 0; i < N; i++) {
39
    diff = 0;
40
    for (j = 0; j < M; j+=4) {
41
      diff += in[j+i];
42
    }
43
    if (out[i] != diff)
44
      abort ();
45
  }
46
 
47
  return 0;
48
}
49
 
50
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect"  } } */
51
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.