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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [no-vfa-vect-dv-2.c] - Blame information for rev 689

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 <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
  int E[N] = {0,1,2,0};
19
 
20
  int i, j;
21
 
22
  check_vect ();
23
 
24
  for (i = 0; i < N; i++)
25
    {
26
      A[i] = i;
27
      B[i] = i;
28
      C[i] = i;
29
      D[i] = i;
30
    }
31
 
32
  /* Vectorizable */
33
  for (i = 0; i < N-20; i++)
34
    {
35
      A[i] = A[i+20];
36
    }
37
 
38
  /* check results:  */
39
  for (i = 0; i < N-20; i++)
40
    {
41
      if (A[i] != D[i+20])
42
        abort ();
43
    }
44
 
45
  /* Vectorizable */
46
  for (i = 0; i < 16; i++)
47
    {
48
      B[i] = B[i] + 5;
49
    }
50
 
51
  /* check results:  */
52
  for (i = 0; i < 16; i++)
53
    {
54
      if (B[i] != C[i] + 5)
55
        abort ();
56
    }
57
 
58
  /* Not vectorizable */
59
  for (i = 0; i < 4; i++)
60
    {
61
      C[i+3] = C[i];
62
    }
63
 
64
  /* check results:  */
65
  for (i = 0; i < 4; i++)
66
    {
67
      if (C[i] != E[i])
68
        abort ();
69
    }
70
 
71
  return 0;
72
}
73
 
74
 
75
/* The initialization induction loop (with aligned access) is also vectorized.  */
76
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
77
/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 2 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
78
/* { dg-final { scan-tree-dump-times "accesses have the same alignment." 1 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
79
/* { 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.