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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-double-reduc-7.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 K 32
7
 
8
int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9
int out[K];
10
int check_result[K] = {63,63,191,191,127,127,191,191,127,127,191,191,127,127,191,191,127,127,191,191,127,127,191,191,127,127,191,191,127,127,191,191};
11
 
12
__attribute__ ((noinline)) void
13
foo ()
14
{
15
  int res_or, res_and, res_xor, i, j, k;
16
 
17
  for (k = 0; k < K; k++)
18
    {
19
      res_or = 0;
20
      for (j = 0; j < K; j++)
21
        for (i = 0; i < K; i++)
22
          res_or = res_or | in[i+k][j];
23
 
24
      res_and = 1;
25
      for (j = 0; j < K; j++)
26
        for (i = 0; i < K; i++)
27
          res_and = res_and & in[i+k][j];
28
 
29
      res_xor = 0;
30
      for (j = 0; j < K; j++)
31
        for (i = 0; i < K; i++)
32
          res_xor = res_xor ^ in[i+k][j];
33
 
34
      out[k] = res_or + res_and + res_xor;
35
    }
36
}
37
 
38
int main ()
39
{
40
  int i, j, k;
41
 
42
  check_vect ();
43
 
44
  for  (j = 0; j < K; j++)
45
    {
46
      for (i = 0; i < 2*K; i++)
47
        in[i][j] = i+j;
48
 
49
      for (i = 0; i < K; i++)
50
        out[i] = i+j;
51
    }
52
 
53
  foo();
54
 
55
  for (k = 0; k < K; k++)
56
    if (out[k] != check_result[k])
57
      abort ();
58
 
59
  return 0;
60
}
61
 
62
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 3 "vect" } } */
63
/* { dg-final { cleanup-tree-dump "vect" } } */
64
 

powered by: WebSVN 2.1.0

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