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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-76-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
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 124
7
#define OFF 4
8
 
9
/* Check handling of accesses for which the "initial condition" -
10
   the expression that represents the first location accessed - is
11
   more involved than just an ssa_name.  */
12
 
13
int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17};
14
int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17};
15
 
16
volatile int y = 0;
17
 
18
__attribute__ ((noinline))
19
int main1 (int *pib)
20
{
21
  int i;
22
  int ia[N+OFF];
23
  for (i = OFF; i < N+OFF; i++)
24
    {
25
      ib[i] = ib[i%8]*(i/8);
26
      ic[i] = ic[i%8]*(i/8);
27
      if (y)
28
        abort ();
29
    }
30
 
31
  for (i = OFF; i < N; i++)
32
    {
33
      ia[i] = pib[i - OFF];
34
    }
35
 
36
 
37
  /* check results:  */
38
  for (i = OFF; i < N; i++)
39
    {
40
     if (ia[i] != pib[i - OFF])
41
        abort ();
42
    }
43
 
44
  for (i = 0; i < N; i++)
45
    {
46
      ia[i] = pib[i - OFF];
47
    }
48
 
49
 
50
  /* check results:  */
51
  for (i = 0; i < N; i++)
52
    {
53
     if (ia[i] != pib[i - OFF])
54
        abort ();
55
    }
56
 
57
  for (i = OFF; i < N; i++)
58
    {
59
      ia[i] = ic[i - OFF];
60
    }
61
 
62
 
63
  /* check results:  */
64
  for (i = OFF; i < N; i++)
65
    {
66
     if (ia[i] != ic[i - OFF])
67
        abort ();
68
    }
69
 
70
  return 0;
71
}
72
 
73
int main (void)
74
{
75
  check_vect ();
76
 
77
  main1 (&ib[OFF]);
78
  return 0;
79
}
80
 
81
 
82
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
83
/* { 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.