OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [ifc-20040816-2.c] - Blame information for rev 154

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 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
  for (pi = 0; pi < (512)*(512); pi++) {
15
    int zr = zr_in[pi];
16
    int zi = zi_in[pi];
17
    int zk = zk_in[pi];
18
 
19
    if (zr*zr + zi*zi >= 4) {
20
      tmp_r = zr;
21
      tmp_i = zi;
22
      tmp_k = zk;
23
    } else {
24
      tmp_r = (zr*zr - zi*zi + cr);
25
      tmp_i = (2 * zr * zi + ci);
26
      tmp_k = zk + 1;
27
    }
28
    zr_out[pi] = tmp_r;
29
    zi_out[pi] = tmp_i;
30
    zk_out[pi] = tmp_k;
31
  }
32
}
33
 
34
 
35
/* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "ifcvt" } } */
36
/* { 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.