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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-outer-4m-big-array.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target vect_int } */
2
#include <stdarg.h>
3
#include "tree-vect.h"
4
 
5
#define N 320
6
#define M 1024
7
unsigned short in[N+M];
8
unsigned int out[N];
9
 
10
/* Outer-loop vectorization.  */
11
/* Not vectorized due to multiple-types in the inner-loop.  */
12
 
13
__attribute__ ((noinline)) unsigned int
14
foo (){
15
  int i,j;
16
  unsigned int diff;
17
  unsigned int s=0;
18
 
19
  for (i = 0; i < N; i++) {
20
    diff = 0;
21
    for (j = 0; j < M; j+=8) {
22
      diff += in[j+i];
23
    }
24
    s+=((unsigned short)diff>>3);
25
  }
26
  return s;
27
}
28
 
29
int main (void)
30
{
31
  int i, j;
32
  unsigned int diff;
33
  unsigned int s=0,sum=0;
34
 
35
  check_vect ();
36
 
37
  for (i = 0; i < N+M; i++) {
38
    in[i] = i;
39
  }
40
 
41
  sum=foo ();
42
 
43
  for (i = 0; i < N; i++) {
44
    diff = 0;
45
    for (j = 0; j < M; j+=8) {
46
      diff += in[j+i];
47
    }
48
    s += ((unsigned short)diff>>3);
49
  }
50
 
51
  if (s != sum)
52
    abort ();
53
 
54
  return 0;
55
}
56
 
57
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect"  { xfail *-*-* } } } */
58
/* { 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.