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-6.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_mult } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define K 4 
7
 
8
int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9
int out[K];
10
int check_result[K] = {0,16,256,4096};
11
 
12
__attribute__ ((noinline)) void
13
foo ()
14
{
15
  int sum;
16
  int i, j, k;
17
 
18
  for (k = 0; k < K; k++)
19
    {
20
      sum = 1;
21
      for (j = 0; j < K; j++)
22
        for (i = 0; i < K; i++)
23
          sum *= in[i+k][j];
24
      out[k] = sum;
25
    }
26
}
27
 
28
int main ()
29
{
30
  int i, j, k;
31
 
32
  check_vect ();
33
 
34
  for (i = 0; i < 2*K; i++)
35
    for (j = 0; j < K; j++)
36
      in[i][j] = (i+2)/3;
37
 
38
  foo();
39
 
40
  for (k = 0; k < K; k++)
41
    if (out[k] != check_result[k])
42
      abort ();
43
 
44
  return 0;
45
}
46
 
47
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
48
/* { dg-final { cleanup-tree-dump "vect" } } */
49
 

powered by: WebSVN 2.1.0

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