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/] [no-scevccp-outer-13.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 "tree-vect.h"
5
 
6
#define N 16
7
 
8
unsigned short in[N];
9
 
10
__attribute__ ((noinline)) unsigned int
11
foo (short scale){
12
  int i;
13
  unsigned short j;
14
  unsigned int sum = 0;
15
  unsigned short sum_j;
16
 
17
  for (i = 0; i < N; i++) {
18
    sum_j = 0;
19
    for (j = 0; j < N; j++) {
20
      sum_j += j;
21
    }
22
    sum += ((unsigned int) in[i] * (unsigned int) sum_j) >> scale;
23
  }
24
  return sum;
25
}
26
 
27
__attribute__ ((noinline)) unsigned short
28
bar (void)
29
{
30
  unsigned short j;
31
  unsigned short sum_j;
32
    sum_j = 0;
33
    for (j = 0; j < N; j++) {
34
      sum_j += j;
35
    }
36
  return sum_j;
37
}
38
 
39
int main (void)
40
{
41
  int i;
42
  unsigned short j, sum_j;
43
  unsigned int sum = 0;
44
  unsigned int res;
45
 
46
  check_vect ();
47
 
48
  for (i=0; i<N; i++){
49
    in[i] = i;
50
  }
51
 
52
  res = foo (2);
53
 
54
  /* check results:  */
55
  for (i=0; i<N; i++)
56
    {
57
      sum_j = bar ();
58
      sum += ((unsigned int) in[i] * (unsigned int) sum_j) >> 2;
59
    }
60
  if (res != sum)
61
    abort ();
62
 
63
  return 0;
64
}
65
 
66
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED." 1 "vect" { target vect_widen_mult_hi_to_si } } } */
67
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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