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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-double-reduc-7.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include <stdio.h>
5
#include "tree-vect.h"
6
 
7
#define K 32
8
 
9
int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
10
int out[K];
11
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};
12
 
13
__attribute__ ((noinline)) void
14
foo ()
15
{
16
  int res_or, res_and, res_xor, i, j, k;
17
 
18
  for (k = 0; k < K; k++)
19
    {
20
      res_or = 0;
21
      for (j = 0; j < K; j++)
22
        for (i = 0; i < K; i++)
23
          res_or = res_or | in[i+k][j];
24
 
25
      res_and = 1;
26
      for (j = 0; j < K; j++)
27
        for (i = 0; i < K; i++)
28
          res_and = res_and & in[i+k][j];
29
 
30
      res_xor = 0;
31
      for (j = 0; j < K; j++)
32
        for (i = 0; i < K; i++)
33
          res_xor = res_xor ^ in[i+k][j];
34
 
35
      out[k] = res_or + res_and + res_xor;
36
    }
37
}
38
 
39
int main ()
40
{
41
  int i, j, k;
42
 
43
  check_vect ();
44
 
45
  for  (j = 0; j < K; j++)
46
    {
47
      for (i = 0; i < 2*K; i++)
48
        in[i][j] = i+j;
49
 
50
      for (i = 0; i < K; i++)
51
        out[i] = i+j;
52
    }
53
 
54
  foo();
55
 
56
  for (k = 0; k < K; k++)
57
    if (out[k] != check_result[k])
58
      abort ();
59
 
60
  return 0;
61
}
62
 
63
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 3 "vect" } } */
64
/* { dg-final { cleanup-tree-dump "vect" } } */
65
 

powered by: WebSVN 2.1.0

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