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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-35.c] - Blame information for rev 689

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 128 
7
 
8
typedef struct {
9
   int a;
10
   int b;
11
   int c;
12
   int d;
13
   int e;
14
} s;
15
 
16
int
17
main1 (s *arr)
18
{
19
  int i;
20
  s *ptr = arr;
21
  s res[N];
22
 
23
  /* SLP with unrolling by 4.  */
24
  for (i = 0; i < N; i++)
25
    {
26
      res[i].c = ptr->c + ptr->c;
27
      res[i].a = ptr->a + ptr->a;
28
      res[i].d = ptr->d + ptr->d;
29
      res[i].b = ptr->b + ptr->b;
30
      res[i].e = ptr->e + ptr->e;
31
      ptr++;
32
    }
33
 
34
  /* check results:  */
35
  for (i = 0; i < N; i++)
36
    {
37
      if (res[i].c != arr[i].c + arr[i].c
38
          || res[i].a != arr[i].a + arr[i].a
39
          || res[i].d != arr[i].d + arr[i].d
40
          || res[i].b != arr[i].b + arr[i].b
41
          || res[i].e != arr[i].e + arr[i].e)
42
         abort();
43
    }
44
 
45
}
46
 
47
int main (void)
48
{
49
  int i;
50
  s arr[N];
51
 
52
  check_vect ();
53
 
54
  for (i = 0; i < N; i++)
55
    {
56
      arr[i].a = i;
57
      arr[i].b = i * 2;
58
      arr[i].c = 17;
59
      arr[i].d = i+34;
60
      arr[i].e = i * 3 + 5;
61
      if (arr[i].a == 178)
62
         abort();
63
    }
64
 
65
  main1 (arr);
66
 
67
  return 0;
68
}
69
 
70
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
71
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
72
/* { dg-final { cleanup-tree-dump "vect" } } */
73
 

powered by: WebSVN 2.1.0

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