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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-28.c] - Blame information for rev 478

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

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include <stdio.h>
5
#include "tree-vect.h"
6
 
7
#define N 32 
8
 
9
unsigned short in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
10
unsigned short in2[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
11
unsigned short in3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
12
unsigned short check[N] = {0,1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,20,21,22,23,25,26,27,28,30,31,32,33,35,36,37,38};
13
unsigned short check3[N] = {0,1,2,3,4,5,6,7,8,9,10,11,5,6,7,8,9,10,11,12,13,14,15,16,10,11,12,13,14,15,16,17};
14
 
15
int
16
main1 ()
17
{
18
  int i;
19
 
20
  for (i = 0; i < N/4; i++)
21
    {
22
      in[i*4] = in[i*4] + 5;
23
      in[i*4 + 1] = in[i*4 + 1] + 5;
24
      in[i*4 + 2] = in[i*4 + 2] + 5;
25
      in[i*4 + 3] = in[i*4 + 3] + 5;
26
 
27
    }
28
 
29
  /* check results:  */
30
  for (i = 0; i < N; i++)
31
    {
32
      if (in[i] != i+5)
33
        abort ();
34
    }
35
 
36
  /* Not vectorizable because of data dependencies.  */
37
  for (i = 1; i < N/4; i++)
38
    {
39
      in2[i*4] = in2[(i-1)*4] + 5;
40
      in2[i*4 + 1] = in2[(i-1)*4 + 1] + 5;
41
      in2[i*4 + 2] = in2[(i-1)*4 + 2] + 5;
42
      in2[i*4 + 3] = in2[(i-1)*4 + 3] + 5;
43
 
44
    }
45
 
46
  /* check results:  */
47
  for (i = 4; i < N; i++)
48
    {
49
      if (in2[i] != check[i])
50
        abort ();
51
    }
52
 
53
  /* Not vectorizable because of data dependencies: distance 3 is greater than
54
     the actual VF with SLP (2), but the analysis fail to detect that for now.  */
55
  for (i = 3; i < N/4; i++)
56
    {
57
      in3[i*4] = in3[(i-3)*4] + 5;
58
      in3[i*4 + 1] = in3[(i-3)*4 + 1] + 5;
59
      in3[i*4 + 2] = in3[(i-3)*4 + 2] + 5;
60
      in3[i*4 + 3] = in3[(i-3)*4 + 3] + 5;
61
 
62
    }
63
 
64
  /* check results:  */
65
  for (i = 12; i < N; i++)
66
    {
67
      if (in3[i] != check3[i])
68
        abort ();
69
    }
70
 
71
 
72
  return 0;
73
}
74
 
75
int main (void)
76
{
77
  check_vect ();
78
 
79
  main1 ();
80
 
81
  return 0;
82
}
83
 
84
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  } } */
85
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect"  } } */
86
/* { dg-final { cleanup-tree-dump "vect" } } */
87
 

powered by: WebSVN 2.1.0

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