OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-cond-6.c] - Blame information for rev 384

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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