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-dv-2.c] - Blame information for rev 867

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 <stdarg.h>
4
#include <signal.h>
5
#include "tree-vect.h"
6
 
7
#define N 64
8
#define MAX 42
9
 
10
extern void abort(void);
11
 
12
int main ()
13
{
14
  int A[N];
15
  int B[N];
16
  int C[N];
17
  int D[N];
18
 
19
  int i, j;
20
 
21
  check_vect ();
22
 
23
  for (i = 0; i < N; i++)
24
    {
25
      A[i] = i;
26
      B[i] = i;
27
      C[i] = i;
28
      D[i] = i;
29
    }
30
 
31
  /* Vectorizable */
32
  for (i = 0; i < N-20; i++)
33
    {
34
      A[i] = A[i+20];
35
    }
36
 
37
  /* check results:  */
38
  for (i = 0; i < N-20; i++)
39
    {
40
      if (A[i] != D[i+20])
41
        abort ();
42
    }
43
 
44
  /* Vectorizable */
45
  for (i = 0; i < 16; i++)
46
    {
47
      B[i] = B[i] + 5;
48
    }
49
 
50
  /* check results:  */
51
  for (i = 0; i < 16; i++)
52
    {
53
      if (B[i] != C[i] + 5)
54
        abort ();
55
    }
56
 
57
  /* Not vectorizable */
58
  for (i = 0; i < 4; i++)
59
    {
60
      C[i] = C[i+3];
61
    }
62
 
63
  /* check results:  */
64
  for (i = 0; i < 4; i++)
65
    {
66
      if (C[i] != D[i+3])
67
        abort ();
68
    }
69
 
70
  return 0;
71
}
72
 
73
 
74
 
75
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
76
/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 2 "vect" } } */
77
/* { 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.