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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-97.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
 
8
int main1 ()
9
{
10
  struct {
11
    char *p;
12
    char *q;
13
  } s;
14
  int i;
15
  char x[N] __attribute__ ((__aligned__(16)));
16
  char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
17
 
18
  /* Check that datarefs analysis can determine that the access via pointer
19
     s.p is based off array x, which enables us to antialias this access from
20
     the access to array cb.  */
21
  s.p = x;
22
  for (i = 0; i < N; i++)
23
    {
24
      s.p[i] = cb[i];
25
    }
26
 
27
  /* check results:  */
28
  for (i = 0; i < N; i++)
29
    {
30
      if (s.p[i] != cb[i])
31
        abort ();
32
    }
33
 
34
  /* Check that datarefs analysis can determine that the access via pointer
35
     s.p is based off array x, and that the access via pointer s.q is based off
36
     array cb, which enables us to antialias these two accesses.  */
37
  s.q = cb;
38
  for (i = 0; i < N; i++)
39
    {
40
      s.p[i] = s.q[i];
41
    }
42
 
43
  /* check results:  */
44
  for (i = 0; i < N; i++)
45
    {
46
      if (s.p[i] != s.q[i])
47
        abort ();
48
    }
49
 
50
  return 0;
51
}
52
 
53
int main (void)
54
{
55
  check_vect ();
56
 
57
  return main1 ();
58
}
59
 
60
 
61
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
62
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
63
/* { 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.