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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-strided-u8-i8-gap4.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 16 
7
 
8
typedef struct {
9
   unsigned char a;
10
   unsigned char b;
11
   unsigned char c;
12
   unsigned char d;
13
   unsigned char e;
14
   unsigned char f;
15
   unsigned char g;
16
   unsigned char h;
17
} s;
18
 
19
__attribute__ ((noinline)) int
20
main1 (s *arr)
21
{
22
  int i;
23
  s *ptr = arr;
24
  s res[N];
25
  unsigned char x;
26
 
27
  for (i = 0; i < N; i++)
28
    {
29
      res[i].c = ptr->b + ptr->c;
30
      x = ptr->c + ptr->f;
31
      res[i].a = x + ptr->b;
32
      res[i].d = ptr->b + ptr->c;
33
      res[i].b = ptr->c;
34
      res[i].f = ptr->f + ptr->e;
35
      res[i].e = ptr->b + ptr->e;
36
      res[i].h = ptr->c;
37
      res[i].g = ptr->b + ptr->c;
38
      ptr++;
39
    }
40
 
41
  /* check results:  */
42
  for (i = 0; i < N; i++)
43
    {
44
      if (res[i].c != arr[i].b + arr[i].c
45
          || res[i].a != arr[i].c + arr[i].f + arr[i].b
46
          || res[i].d != arr[i].b + arr[i].c
47
          || res[i].b != arr[i].c
48
          || res[i].f != arr[i].f + arr[i].e
49
          || res[i].e != arr[i].b + arr[i].e
50
          || res[i].h != arr[i].c
51
          || res[i].g != arr[i].b + arr[i].c)
52
          abort ();
53
   }
54
 
55
  ptr = arr;
56
  /* Not vectorizable: gap in store. */
57
  for (i = 0; i < N; i++)
58
    {
59
      res[i].a = ptr->b;
60
      res[i].b = ptr->c;
61
      ptr++;
62
    }
63
 
64
  /* Check results.  */
65
  for (i = 0; i < N; i++)
66
    {
67
      if (res[i].a != arr[i].b
68
          || res[i].b != arr[i].c)
69
          abort ();
70
    }
71
 
72
}
73
 
74
 
75
int main (void)
76
{
77
  int i;
78
  s arr[N];
79
 
80
  check_vect ();
81
 
82
  for (i = 0; i < N; i++)
83
    {
84
      arr[i].a = i;
85
      arr[i].b = i * 2;
86
      arr[i].c = 17;
87
      arr[i].d = i+34;
88
      arr[i].e = i * 3 + 5;
89
      arr[i].f = i * 5;
90
      arr[i].g = i - 3;
91
      arr[i].h = 56;
92
      if (arr[i].a == 178)
93
         abort();
94
    }
95
 
96
  main1 (arr);
97
 
98
  return 0;
99
}
100
 
101
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
102
/* { dg-final { cleanup-tree-dump "vect" } } */
103
 

powered by: WebSVN 2.1.0

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