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-70.c] - Blame information for rev 816

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
struct s{
9
  int m;
10
  int n[N][N][N];
11
};
12
 
13
struct test1{
14
  struct s a; /* array a.n is unaligned */
15
  int b;
16
  int c;
17
  struct s e[N]; /* array e.n is aligned */
18
};
19
 
20
int main1 ()
21
{
22
  int i,j;
23
  struct test1 tmp1;
24
 
25
  for (i = 0; i < N; i++)
26
    for (j = 3; j < N-3; j++)
27
      {
28
        tmp1.e[i].n[1][2][j] = 8;
29
      }
30
 
31
  /* check results:  */
32
  for (i = 0; i < N; i++)
33
    for (j = 3; j < N-3; j++)
34
    {
35
      if (tmp1.e[i].n[1][2][j] != 8)
36
          abort ();
37
    }
38
 
39
  /* not consecutive */
40
  for (i = 0; i < N; i++)
41
    for (j = 3; j < N-3; j++)
42
      {
43
        tmp1.e[j].n[1][2][j] = 8;
44
      }
45
 
46
  /* check results:  */
47
  for (i = 0; i < N; i++)
48
    for (j = 3; j < N-3; j++)
49
    {
50
      if (tmp1.e[j].n[1][2][j] != 8)
51
          abort ();
52
    }
53
 
54
  return 0;
55
}
56
 
57
int main (void)
58
{
59
  check_vect ();
60
 
61
  return main1 ();
62
}
63
 
64
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
65
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
66
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
67
/* { 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.