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