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-u8-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 <stdio.h>
5
#include "tree-vect.h"
6
 
7
#define N 32 
8
 
9
typedef struct {
10
   unsigned char a;
11
   unsigned char b;
12
   unsigned char c;
13
   unsigned char d;
14
   unsigned char e;
15
   unsigned char f;
16
   unsigned char g;
17
   unsigned char h;
18
} s;
19
 
20
__attribute__ ((noinline)) int
21
main1 (s *arr)
22
{
23
  int i;
24
  s *ptr = arr;
25
  s res[N];
26
  unsigned char u, t, s, x, y, z, w;
27
 
28
  for (i = 0; i < N; i++)
29
    {
30
      u = ptr->b - ptr->a;
31
      t = ptr->d - ptr->c;
32
      res[i].c = u + t;
33
      s =  ptr->a + ptr->g;
34
      x = ptr->b + ptr->d;
35
      res[i].a = s + x;
36
      res[i].d = u + t;
37
      s = ptr->h - ptr->a;
38
      x = ptr->d - ptr->c;
39
      res[i].b = s + x;
40
      res[i].f = ptr->f + ptr->h;
41
      res[i].e = ptr->b + ptr->e;
42
      res[i].h = ptr->d - ptr->g;
43
      res[i].g = u + t;
44
      ptr++;
45
    }
46
 
47
  /* check results:  */
48
  for (i = 0; i < N; i++)
49
    {
50
      if (res[i].c != arr[i].b - arr[i].a + arr[i].d - arr[i].c
51
          || res[i].a != arr[i].a + arr[i].g + arr[i].b + arr[i].d
52
          || res[i].d != arr[i].b - arr[i].a + arr[i].d - arr[i].c
53
          || res[i].b != arr[i].h - arr[i].a + arr[i].d - arr[i].c
54
          || res[i].f != arr[i].f + arr[i].h
55
          || res[i].e != arr[i].b + arr[i].e
56
          || res[i].h != arr[i].d - arr[i].g
57
          || res[i].g != arr[i].b - arr[i].a + arr[i].d - arr[i].c
58
       )
59
          abort();
60
   }
61
}
62
 
63
int main (void)
64
{
65
  int i;
66
  s arr[N];
67
 
68
  check_vect ();
69
 
70
  for (i = 0; i < N; i++)
71
    {
72
      arr[i].a = i;
73
      arr[i].b = i * 2;
74
      arr[i].c = 17;
75
      arr[i].d = i+34;
76
      arr[i].e = i;
77
      arr[i].f = i + 5;
78
      arr[i].g = i + 3;
79
      arr[i].h = 67;
80
      if (arr[i].a == 178)
81
         abort();
82
    }
83
 
84
  main1 (arr);
85
 
86
  return 0;
87
}
88
 
89
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd } } } } */
90
/* { dg-final { cleanup-tree-dump "vect" } } */
91
 

powered by: WebSVN 2.1.0

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