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

powered by: WebSVN 2.1.0

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