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-u16-i2.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
__attribute__ ((noinline)) int
14
main1 ()
15
{
16
  s arr[N];
17
  s *ptr = arr;
18
  s res[N];
19
  int i;
20
 
21
  for (i = 0; i < N; i++)
22
    {
23
      arr[i].a = i;
24
      arr[i].b = i * 2;
25
      if (arr[i].a == 178)
26
         abort();
27
    }
28
 
29
  for (i = 0; i < N; i++)
30
    {
31
      res[i].a = ptr->b - ptr->a;
32
      res[i].b = ptr->b + ptr->a;
33
      ptr++;
34
    }
35
 
36
  /* check results:  */
37
  for (i = 0; i < N; i++)
38
    {
39
      if (res[i].a != arr[i].b - arr[i].a
40
          || res[i].b != arr[i].a + arr[i].b)
41
        abort ();
42
    }
43
 
44
  return 0;
45
}
46
 
47
int main (void)
48
{
49
  int i;
50
 
51
  check_vect ();
52
 
53
  main1 ();
54
 
55
  return 0;
56
}
57
 
58
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target vect_strided2 } } } */
59
/* { dg-final { cleanup-tree-dump "vect" } } */
60
 

powered by: WebSVN 2.1.0

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