OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-103.c] - Blame information for rev 154

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdlib.h>
4
#include <stdarg.h>
5
#include "tree-vect.h"
6
 
7
#define N 9
8
 
9
struct extraction
10
{
11
  int a[N];
12
  int b[N];
13
};
14
 
15
static int a[N] = {1,2,3,4,5,6,7,8,9};
16
static int b[N] = {17,24,7,0,2,3,4,31,82};
17
static int c[N] = {9,17,24,7,0,2,3,4,31};
18
 
19
int main1 (int x, int y) {
20
  int i;
21
  struct extraction *p;
22
  p = (struct extraction *) malloc (sizeof (struct extraction));
23
 
24
  for (i = 0; i < N; i++)
25
    {
26
       p->a[i] = a[i];
27
       p->b[i] = b[i];
28
       if (x == 135)
29
         abort (); /* to avoid vectorization  */
30
    }
31
 
32
  /* Vectorizable: distance > VF.  */
33
  for (i = 0; i < N; i++)
34
    {
35
       *((int *)p + x + i) = *((int *)p + x + i + 8);
36
    }
37
 
38
  /* check results: */
39
  for (i = 0; i < N; i++)
40
    {
41
       if (p->a[i] != c[i])
42
         abort();
43
    }
44
  return 0;
45
}
46
 
47
int main (void)
48
{
49
  check_vect ();
50
 
51
  return main1 (0, N);
52
}
53
 
54
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
55
/* { dg-final { scan-tree-dump-times "dependence distance modulo vf == 0" 1 "vect" } } */
56
/* { dg-final { cleanup-tree-dump "vect" } } */
57
 

powered by: WebSVN 2.1.0

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