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

powered by: WebSVN 2.1.0

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