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

powered by: WebSVN 2.1.0

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