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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [bb-slp-26.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 "tree-vect.h"
5
 
6
#define A 3
7
#define B 4
8
#define N 256
9
 
10
char src[N], dst[N];
11
 
12
void foo (char * __restrict__ dst, char * __restrict__ src, int h,
13
          int stride, int dummy)
14
{
15
  int i;
16
  h /= 16;
17
  for (i = 0; i < h; i++)
18
    {
19
      dst[0] += A*src[0] + src[stride];
20
      dst[1] += A*src[1] + src[1+stride];
21
      dst[2] += A*src[2] + src[2+stride];
22
      dst[3] += A*src[3] + src[3+stride];
23
      dst[4] += A*src[4] + src[4+stride];
24
      dst[5] += A*src[5] + src[5+stride];
25
      dst[6] += A*src[6] + src[6+stride];
26
      dst[7] += A*src[7] + src[7+stride];
27
      dst += 8;
28
      src += 8;
29
      if (dummy == 32)
30
        abort ();
31
   }
32
}
33
 
34
 
35
int main (void)
36
{
37
  int i;
38
 
39
  check_vect ();
40
 
41
  for (i = 0; i < N; i++)
42
    {
43
       dst[i] = 0;
44
       src[i] = i/8;
45
    }
46
 
47
  foo (dst, src, N, 8, 0);
48
 
49
  for (i = 0; i < N/2; i++)
50
    {
51
      if (dst[i] != A * src[i] + src[i+8])
52
        abort ();
53
    }
54
 
55
  return 0;
56
}
57
 
58
/* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect64 } } } */
59
/* { dg-final { cleanup-tree-dump "slp" } } */
60
 

powered by: WebSVN 2.1.0

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