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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-23.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 128 
7
 
8
typedef struct {
9
   int a;
10
   int b;
11
   int c;
12
   int d;
13
   int e;
14
   int f;
15
   int g;
16
   int h;
17
} s;
18
 
19
int
20
main1 (s *arr)
21
{
22
  int i;
23
  s *ptr = arr;
24
  s res[N];
25
 
26
  for (i = 0; i < N; i++)
27
    {
28
      res[i].c = ptr->c + ptr->c;
29
      res[i].a = ptr->a + ptr->a;
30
      res[i].d = ptr->d + ptr->d;
31
      res[i].b = ptr->b + ptr->b;
32
      res[i].f = ptr->f + ptr->f;
33
      res[i].e = ptr->e + ptr->e;
34
      res[i].h = ptr->h + ptr->h;
35
      res[i].g = ptr->g + ptr->g;
36
      ptr++;
37
    }
38
 
39
  /* check results:  */
40
  for (i = 0; i < N; i++)
41
    {
42
      if (res[i].c != arr[i].c + arr[i].c
43
          || res[i].a != arr[i].a + arr[i].a
44
          || res[i].d != arr[i].d + arr[i].d
45
          || res[i].b != arr[i].b + arr[i].b
46
          || res[i].f != arr[i].f + arr[i].f
47
          || res[i].e != arr[i].e + arr[i].e
48
          || res[i].h != arr[i].h + arr[i].h
49
          || res[i].g != arr[i].g + arr[i].g)
50
         abort();
51
    }
52
 
53
  ptr = arr;
54
  for (i = 0; i < N; i++)
55
    {
56
      res[i].c = ptr->c + ptr->c;
57
      res[i].a = ptr->a + ptr->a;
58
      res[i].d = ptr->d + ptr->d;
59
      res[i].b = ptr->b + ptr->b;
60
      res[i].f = ptr->f + ptr->f;
61
      res[i].e = ptr->e + ptr->e;
62
      res[i].h = ptr->e + ptr->e;
63
      res[i].g = ptr->g + ptr->g;
64
      ptr++;
65
    }
66
 
67
  /* check results:  */
68
  for (i = 0; i < N; i++)
69
    {
70
      if (res[i].c != arr[i].c + arr[i].c
71
          || res[i].a != arr[i].a + arr[i].a
72
          || res[i].d != arr[i].d + arr[i].d
73
          || res[i].b != arr[i].b + arr[i].b
74
          || res[i].f != arr[i].f + arr[i].f
75
          || res[i].e != arr[i].e + arr[i].e
76
          || res[i].h != arr[i].e + arr[i].e
77
          || res[i].g != arr[i].g + arr[i].g)
78
         abort();
79
    }
80
 
81
}
82
 
83
int main (void)
84
{
85
  int i;
86
  s arr[N];
87
 
88
  check_vect ();
89
 
90
  for (i = 0; i < N; i++)
91
    {
92
      arr[i].a = i;
93
      arr[i].b = i * 2;
94
      arr[i].c = 17;
95
      arr[i].d = i+34;
96
      arr[i].e = i * 3 + 5;
97
      arr[i].f = i * 5;
98
      arr[i].g = i - 3;
99
      arr[i].h = 56;
100
      if (arr[i].a == 178)
101
         abort();
102
    }
103
 
104
  main1 (arr);
105
 
106
  return 0;
107
}
108
 
109
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_strided_wide } && {! { vect_no_align} } } } } */
110
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! { vect_strided_wide || vect_no_align} } } } } */
111
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_no_align } } } */
112
/* { dg-final { cleanup-tree-dump "vect" } } */
113
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.