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

Subversion Repositories openrisc

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

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

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