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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [no-section-anchors-vect-68.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 64
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; /* array e.n is aligned */
18
};
19
 
20
struct test1 tmp1;
21
 
22
__attribute__ ((noinline))
23
int main1 ()
24
{
25
  int i,j;
26
 
27
  /* 1. unaligned */
28
  for (i = 0; i < N; i++)
29
    {
30
      tmp1.a.n[1][2][i] = 5;
31
    }
32
 
33
  /* check results:  */
34
  for (i = 0; i <N; i++)
35
    {
36
      if (tmp1.a.n[1][2][i] != 5)
37
        abort ();
38
    }
39
 
40
  /* 2. aligned */
41
  for (i = 3; i < N-1; i++)
42
    {
43
      tmp1.a.n[1][2][i] = 6;
44
    }
45
 
46
  /* check results:  */
47
  for (i = 3; i < N-1; i++)
48
    {
49
      if (tmp1.a.n[1][2][i] != 6)
50
        abort ();
51
    }
52
 
53
  /* 3. aligned */
54
  for (i = 0; i < N; i++)
55
    {
56
      tmp1.e.n[1][2][i] = 7;
57
    }
58
 
59
  /* check results:  */
60
  for (i = 0; i < N; i++)
61
    {
62
      if (tmp1.e.n[1][2][i] != 7)
63
        abort ();
64
    }
65
 
66
  /* 4. unaligned */
67
  for (i = 3; i < N-3; i++)
68
    {
69
      tmp1.e.n[1][2][i] = 8;
70
    }
71
 
72
  /* check results:  */
73
  for (i = 3; i <N-3; i++)
74
    {
75
      if (tmp1.e.n[1][2][i] != 8)
76
        abort ();
77
    }
78
 
79
  return 0;
80
}
81
 
82
int main (void)
83
{
84
  check_vect ();
85
 
86
  return main1 ();
87
}
88
 
89
/* { dg-final { scan-tree-dump-times "vectorized 4 loops" 1 "vect" } } */
90
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
91
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 4 "vect" { target { {! vect_aligned_arrays} && {vect_sizes_32B_16B} } } } } */
92
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { target { {vect_aligned_arrays} && {! vect_sizes_32B_16B} } } } } */
93
/* { 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.