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-4.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_a[M], x_out_b[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 b[N+1] = {17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1};
15
int check_result_a[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};
16
int check_result_b[M] = {17,17,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
17
 
18
__attribute__ ((noinline)) void
19
foo (int z)
20
{
21
  int j, i, x;
22
  int curr_a, flag, next_a, curr_b, next_b;
23
 
24
  for (j = 0; j < M; j++)
25
    {
26
      x = x_in[j];
27
      curr_a = a[0];
28
      curr_b = b[0];
29
 
30
      for (i = 0; i < N; i++)
31
        {
32
          curr_a = x > c[i] ? curr_a : z;
33
          curr_b = x > c[i] ? next_b : 5;
34
        }
35
 
36
      x_out_a[j] = curr_a;
37
      x_out_b[j] = curr_b;
38
    }
39
}
40
 
41
int main (void)
42
{
43
  int i,j;
44
 
45
  check_vect ();
46
 
47
  for (j = 0; j < M; j++)
48
    x_in[j] = j;
49
 
50
  foo (125);
51
 
52
  for (j = 0; j < M; j++)
53
    if (x_out_a[j] != 125
54
        || x_out_b[j] != 5)
55
      abort ();
56
 
57
  return 0;
58
}
59
 
60
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail vect_no_align } } } */
61
/* { dg-final { cleanup-tree-dump "vect" } } */
62
 
63
 

powered by: WebSVN 2.1.0

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