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-3.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 coeff[K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
11
int out_max[K], out_min[K];
12
int check_max[K] = {62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93};
13
int check_min[K] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
14
 
15
__attribute__ ((noinline)) void
16
foo (int x, int y)
17
{
18
  int max, min, i, j, k;
19
 
20
  for (k = 0; k < K; k++)
21
    {
22
      max = x;
23
      min = y;
24
      for (j = 0; j < K; j++)
25
        for (i = 0; i < K; i++)
26
          {
27
            max = max < in[i+k][j] ? in[i+k][j] : max;
28
            min = min > in[i+k][j] ? in[i+k][j] : min;
29
          }
30
      out_max[k] = max;
31
      out_min[k] = min;
32
    }
33
}
34
 
35
int main ()
36
{
37
  int i, j, k;
38
 
39
  check_vect ();
40
 
41
  for  (j = 0; j < K; j++)
42
    {
43
      for (i = 0; i < 2*K; i++)
44
        in[i][j] = i+j;
45
 
46
      for (i = 0; i < K; i++)
47
        coeff[i][j] = i+2;
48
    }
49
 
50
  foo(0, 0);
51
 
52
  for (k = 0; k < K; k++)
53
    if (out_max[k] != check_max[k] || out_min[k] != 0)
54
      abort ();
55
 
56
  foo(100, 45);
57
 
58
  for (k = 0; k < K; k++)
59
    if (out_min[k] != check_min[k] || out_max[k] != 100)
60
      abort ();
61
 
62
  return 0;
63
}
64
 
65
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_int_max } } } */
66
/* { dg-final { cleanup-tree-dump "vect" } } */
67
 

powered by: WebSVN 2.1.0

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