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

powered by: WebSVN 2.1.0

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