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

powered by: WebSVN 2.1.0

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