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-5.c] - Blame information for rev 298

Go to most recent revision | 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
int check_result[K] = {2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
13
 
14
__attribute__ ((noinline)) void
15
foo (int c)
16
{
17
  int res, i, j, k, next;
18
 
19
  for (k = 0; k < K; k++)
20
    {
21
      res = 0;
22
      for (j = 0; j < K; j++)
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[k] = res;
30
    }
31
}
32
 
33
int main ()
34
{
35
  int i, j, k;
36
 
37
  check_vect ();
38
 
39
  for  (j = 0; j < K; j++)
40
    {
41
      for (i = 0; i < 2*K; i++)
42
        cond_array[i][j] = i+j;
43
 
44
      for (i = 0; i < K; i++)
45
        a[i][j] = i+2;
46
    }
47
 
48
  foo(5);
49
 
50
  for (k = 0; k < K; k++)
51
    if (out[k] != check_result[k])
52
      abort ();
53
 
54
  return 0;
55
}
56
 
57
/* Double reduction with cond_expr is not supported, since eventhough the order
58
   of computation is the same, but vector results should be reduced to scalar
59
   result, which can'be done for cond_expr.  */
60
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail *-*-* } } } */
61
/* { dg-final { cleanup-tree-dump "vect" } } */
62
 

powered by: WebSVN 2.1.0

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