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-cond-1.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_condition } */
2
 
3
#include <stdlib.h> 
4
#include <stdio.h> 
5
#include "tree-vect.h"
6
 
7
#define M 32
8
#define N 16
9
 
10
int x_in[M];
11
int x_out[M];
12
int c[N] = {3,2,1,10,1,42,3,4,50,9,32,8,11,10,1,2};
13
int a[N+1] = {0,16,32,48,64,128,256,512,0,16,32,48,64,128,256,512,1024};
14
int check_result[M] = {1024,1024,1024,256,256,256,256,256,256,256,256,128,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48};
15
 
16
__attribute__ ((noinline)) void
17
foo ()
18
{
19
  int j, i, x;
20
  int curr_a, next_a;
21
 
22
  for (j = 0; j < M; j++)
23
    {
24
      x = x_in[j];
25
      curr_a = a[0];
26
 
27
      for (i = 0; i < N; i++)
28
        {
29
          next_a = a[i+1];
30
          curr_a = x > c[i] ? curr_a : next_a;
31
        }
32
 
33
      x_out[j] = curr_a;
34
    }
35
}
36
 
37
int main (void)
38
{
39
  int i,j;
40
 
41
  check_vect ();
42
 
43
  for (j = 0; j < M; j++)
44
    x_in[j] = j;
45
 
46
  foo ();
47
 
48
  for (j = 0; j < M; j++)
49
    if (x_out[j] != check_result[j])
50
      abort ();
51
 
52
  return 0;
53
}
54
 
55
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
56
/* { dg-final { cleanup-tree-dump "vect" } } */
57
 
58
 

powered by: WebSVN 2.1.0

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