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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [no-scevccp-outer-10b.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
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 40
7
 
8
int a[N];
9
int b[N];
10
 
11
__attribute__ ((noinline)) int
12
foo (int n){
13
  int i,j;
14
  int sum,x,y;
15
 
16
  if (n<=0)
17
    return 0;
18
 
19
  for (i = 0; i < N/2; i++) {
20
    sum = 0;
21
    x = b[2*i];
22
    y = b[2*i+1];
23
    for (j = 0; j < n; j++) {
24
      sum += j;
25
    }
26
    a[2*i] = sum + x;
27
    a[2*i+1] = sum + y;
28
  }
29
}
30
 
31
int main (void)
32
{
33
  int i,j;
34
  int sum;
35
 
36
  check_vect ();
37
 
38
  for (i=0; i<N; i++)
39
    b[i] = i;
40
 
41
  foo (N-1);
42
 
43
    /* check results:  */
44
  for (i=0; i<N/2; i++)
45
    {
46
      sum = 0;
47
      for (j = 0; j < N-1; j++)
48
        sum += j;
49
      if (a[2*i] != sum + b[2*i] || a[2*i+1] != sum + b[2*i+1])
50
        abort();
51
    }
52
 
53
  return 0;
54
}
55
 
56
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_strided2 } } } */
57
/* { 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.