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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-34-big-array.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 64
7
 
8
unsigned short in[N*8];
9
unsigned short in2[N*8];
10
volatile int y = 0;
11
 
12
int
13
main1 ()
14
{
15
  int i;
16
  unsigned short out[N*8];
17
  unsigned short out2[N*8];
18
 
19
  for (i = 0; i < N*8; i++)
20
    {
21
      in[i] = in2[i] = i;
22
      if (y) /* Avoid vectorization.  */
23
        abort ();
24
    }
25
 
26
  /* SLP with unrolling by 8.  */
27
  for (i = 0; i < N; i++)
28
    {
29
      out[i*3] = in[i*3] + 5;
30
      out[i*3 + 1] = in[i*3 + 1] + 6;
31
      out[i*3 + 2] = in[i*3 + 2] + 16;
32
 
33
      out2[i*5] = in2[i*5] + 2;
34
      out2[i*5 + 1] = in2[i*5 + 1] + 2;
35
      out2[i*5 + 2] = in2[i*5 + 2] + 1;
36
      out2[i*5 + 3] = in2[i*5 + 3] + 3;
37
      out2[i*5 + 4] = in2[i*5 + 4] + 13;
38
    }
39
 
40
  /* check results:  */
41
  for (i = 0; i < N; i++)
42
    {
43
      if (out[i*3] != in[i*3] + 5
44
          || out[i*3 + 1] != in[i*3 + 1] + 6
45
          || out[i*3 + 2] != in[i*3 + 2] + 16
46
          || out2[i*5] != in2[i*5] + 2
47
          || out2[i*5 + 1] != in2[i*5 + 1] + 2
48
          || out2[i*5 + 2] != in2[i*5 + 2] + 1
49
          || out2[i*5 + 3] != in2[i*5 + 3] + 3
50
          || out2[i*5 + 4] != in2[i*5 + 4] + 13)
51
        abort ();
52
    }
53
 
54
  return 0;
55
}
56
 
57
int main (void)
58
{
59
  check_vect ();
60
 
61
  main1 ();
62
 
63
  return 0;
64
}
65
 
66
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
67
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect"  } } */
68
/* { dg-final { cleanup-tree-dump "vect" } } */
69
 

powered by: WebSVN 2.1.0

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