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-gap7.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 u, t, s, x, y, z, w;
26
 
27
  for (i = 0; i < N; i++)
28
    {
29
      u = ptr->b - ptr->a;
30
      t = ptr->d - ptr->c;
31
      res[i].c = u + t;
32
      x = ptr->b + ptr->d;
33
      res[i].a = ptr->a + x;
34
      res[i].d = u + t;
35
      s = ptr->h - ptr->a;
36
      res[i].b = s + t;
37
      res[i].f = ptr->f + ptr->h;
38
      res[i].e = ptr->b + ptr->e;
39
      res[i].h = ptr->d;
40
      res[i].g = u + t;
41
      ptr++;
42
    }
43
 
44
  /* check results:  */
45
  for (i = 0; i < N; i++)
46
    {
47
      if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
48
          || res[i].a != arr[i].a + arr[i].b + arr[i].d
49
          || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
50
          || res[i].b != arr[i].h - arr[i].a + arr[i].d - arr[i].c
51
          || res[i].f != arr[i].f + arr[i].h
52
          || res[i].e != arr[i].b + arr[i].e
53
          || res[i].h != arr[i].d
54
          || res[i].g != arr[i].b - arr[i].a + arr[i].d - arr[i].c)
55
         abort();
56
   }
57
}
58
 
59
 
60
int main (void)
61
{
62
  int i;
63
  s arr[N];
64
 
65
  check_vect ();
66
 
67
  for (i = 0; i < N; i++)
68
    {
69
      arr[i].a = i;
70
      arr[i].b = i * 2;
71
      arr[i].c = 17;
72
      arr[i].d = i+34;
73
      arr[i].e = i * 3 + 5;
74
      arr[i].f = i * 5;
75
      arr[i].g = i - 3;
76
      arr[i].h = 67;
77
      if (arr[i].a == 178)
78
         abort();
79
    }
80
 
81
  main1 (arr);
82
 
83
  return 0;
84
}
85
 
86
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_strided8 } } } */
87
/* { dg-final { cleanup-tree-dump "vect" } } */
88
 

powered by: WebSVN 2.1.0

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