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-31.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 32
7
 
8
struct t{
9
  int k[N];
10
  int l;
11
};
12
 
13
struct s{
14
  char a;       /* aligned */
15
  char b[N-1];  /* unaligned (offset 1B) */
16
  char c[N];    /* aligned (offset NB) */
17
  struct t d;   /* aligned (offset 2NB) */
18
  struct t e;   /* unaligned (offset 2N+4N+4 B) */
19
};
20
 
21
int main1 ()
22
{
23
  int i;
24
  struct s tmp;
25
 
26
  /* unaligned */
27
  for (i = 0; i < N/2; i++)
28
    {
29
      tmp.b[i] = 5;
30
    }
31
 
32
  /* check results:  */
33
  for (i = 0; i <N/2; i++)
34
    {
35
      if (tmp.b[i] != 5)
36
        abort ();
37
    }
38
 
39
  /* aligned */
40
  for (i = 0; i < N/2; i++)
41
    {
42
      tmp.c[i] = 6;
43
    }
44
 
45
  /* check results:  */
46
  for (i = 0; i <N/2; i++)
47
    {
48
      if (tmp.c[i] != 6)
49
        abort ();
50
    }
51
 
52
  /* aligned */
53
  for (i = 0; i < N/2; i++)
54
    {
55
      tmp.d.k[i] = 7;
56
    }
57
 
58
  /* check results:  */
59
  for (i = 0; i <N/2; i++)
60
    {
61
      if (tmp.d.k[i] != 7)
62
        abort ();
63
    }
64
 
65
  /* unaligned */
66
  for (i = 0; i < N/2; i++)
67
    {
68
      tmp.e.k[i] = 8;
69
    }
70
 
71
  /* check results:  */
72
  for (i = 0; i <N/2; i++)
73
    {
74
      if (tmp.e.k[i] != 8)
75
        abort ();
76
    }
77
 
78
  return 0;
79
}
80
 
81
int main (void)
82
{
83
  check_vect ();
84
 
85
  return main1 ();
86
}
87
 
88
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
89
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
90
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
91
/* { 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.