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-same-dr.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
s buffer1[N], buffer2[N];
14
 
15
__attribute__ ((noinline)) int
16
main1 (s * __restrict__  pIn, s* __restrict__ pOut)
17
{
18
  unsigned short i, x, y, d;
19
  s *p, *q;
20
 
21
  p = pIn;
22
  q = pOut;
23
 
24
  for (i = 0; i < N/2; i++)
25
    {
26
      x = pIn->a + 5;
27
      y = pIn->a + 2;
28
      pOut->a = x;
29
      pOut->b = pIn->b;
30
      pOut++;
31
      pOut->a = y;
32
      pOut->b = pIn->b;
33
      pOut++;
34
      pIn++;
35
    }
36
 
37
  /* check results:  */
38
  for (i = 0; i < N/2; i++)
39
    {
40
      if (q->a != p->a + 5
41
          || q->b != p->b)
42
         abort ();
43
      q++;
44
      if (q->a != p->a + 2
45
          || q->b != p->b)
46
        abort ();
47
      q++;
48
      p++;
49
    }
50
 
51
  return 0;
52
}
53
 
54
int main (void)
55
{
56
  short i;
57
 
58
  for (i = 0; i < N; i++)
59
    {
60
      buffer1[i].a = i;
61
      buffer1[i].b = i + 8;
62
      buffer2[i].a = i * 3;
63
      buffer2[i].b = i * 2;
64
      if (buffer1[i].a == 500)
65
         abort();
66
    }
67
 
68
  check_vect ();
69
 
70
  main1 (buffer1, buffer2);
71
 
72
  return 0;
73
}
74
 
75
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target vect_strided2 } } } */
76
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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