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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-97-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 128
7
 
8
char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9
char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10
 
11
volatile int y = 0;
12
 
13
__attribute__ ((noinline))
14
int main1 ()
15
{
16
  struct {
17
    char *p;
18
    char *q;
19
  } s;
20
  int i;
21
  for (i = 0; i < N; i++)
22
    {
23
      cb[i] = i*3;
24
      if (y)
25
        abort ();
26
    }
27
 
28
  /* Check that datarefs analysis can determine that the access via pointer
29
     s.p is based off array x, which enables us to antialias this access from
30
     the access to array cb.  */
31
  s.p = x;
32
  for (i = 0; i < N; i++)
33
    {
34
      s.p[i] = cb[i];
35
    }
36
 
37
  /* check results:  */
38
  for (i = 0; i < N; i++)
39
    {
40
      if (s.p[i] != cb[i])
41
        abort ();
42
    }
43
 
44
  /* Check that datarefs analysis can determine that the access via pointer
45
     s.p is based off array x, and that the access via pointer s.q is based off
46
     array cb, which enables us to antialias these two accesses.  */
47
  s.q = cb;
48
  for (i = 0; i < N; i++)
49
    {
50
      s.p[i] = s.q[i];
51
    }
52
 
53
  /* check results:  */
54
  for (i = 0; i < N; i++)
55
    {
56
      if (s.p[i] != s.q[i])
57
        abort ();
58
    }
59
 
60
  return 0;
61
}
62
 
63
int main (void)
64
{
65
  check_vect ();
66
 
67
  return main1 ();
68
}
69
 
70
 
71
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
72
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
73
/* { 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.