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/] [tree-ssa/] [ifc-20040816-2.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-c -O2 -ftree-vectorize -fdump-tree-ifcvt-stats" { target *-*-* } } */
3
 
4
void foo(const int * __restrict__ zr_in,
5
                const int * __restrict__ zi_in,
6
                const int * __restrict__ zk_in,
7
                int * __restrict__ zr_out,
8
                int * __restrict__ zi_out,
9
                int * __restrict__ zk_out,
10
                int cr, int ci)
11
{
12
  unsigned int pi;
13
  int tmp_r, tmp_i, tmp_k;
14
#if __SIZEOF_INT__ >= 4
15
  for (pi = 0; pi < (512)*(512); pi++) {
16
#else
17
  for (pi = 0; pi < (32)*(32); pi++) {
18
#endif
19
    int zr = zr_in[pi];
20
    int zi = zi_in[pi];
21
    int zk = zk_in[pi];
22
 
23
    if (zr*zr + zi*zi >= 4) {
24
      tmp_r = zr;
25
      tmp_i = zi;
26
      tmp_k = zk;
27
    } else {
28
      tmp_r = (zr*zr - zi*zi + cr);
29
      tmp_i = (2 * zr * zi + ci);
30
      tmp_k = zk + 1;
31
    }
32
    zr_out[pi] = tmp_r;
33
    zi_out[pi] = tmp_i;
34
    zk_out[pi] = tmp_k;
35
  }
36
}
37
 
38
 
39
/* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "ifcvt" } } */
40
/* { dg-final { cleanup-tree-dump "ifcvt" } } */

powered by: WebSVN 2.1.0

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