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-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 (s *arr)
15
{
16
  s *ptr = arr;
17
  s res[N];
18
  int i;
19
 
20
  for (i = 0; i < N; i++)
21
    {
22
      res[i].a = ptr->b - ptr->a;
23
      res[i].b = ptr->b + ptr->a;
24
      ptr++;
25
    }
26
 
27
  /* check results:  */
28
  for (i = 0; i < N; i++)
29
    {
30
      if (res[i].a != arr[i].b - arr[i].a
31
          || res[i].b != arr[i].a + arr[i].b)
32
        abort ();
33
    }
34
 
35
  return 0;
36
}
37
 
38
int main (void)
39
{
40
  int i;
41
  s arr[N];
42
 
43
  check_vect ();
44
 
45
  for (i = 0; i < N; i++)
46
    {
47
      arr[i].a = i;
48
      arr[i].b = i * 2;
49
      if (arr[i].a == 178)
50
         abort();
51
    }
52
 
53
  main1 (arr);
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.