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

powered by: WebSVN 2.1.0

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