OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-cond-2.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 N 16
8
 
9
int c[N] = {3,2,1,10,1,42,3,4,50,9,32,8,11,10,1,2};
10
int a[N+1] = {0,16,32,48,64,128,256,512,0,16,32,48,64,128,256,512,1024};
11
 
12
__attribute__ ((noinline)) void
13
foo (int *x)
14
{
15
  int i;
16
  int curr_a, flag, next_a;
17
 
18
  curr_a = a[0];
19
 
20
  for (i = 0; i < N; i++)
21
    {
22
      flag = *x > c[i];
23
      next_a = a[i+1];
24
      curr_a = flag ? curr_a : next_a;
25
    }
26
 
27
  *x = curr_a;
28
}
29
 
30
int main (void)
31
{
32
  int x = 7;
33
 
34
  check_vect ();
35
 
36
  foo (&x);
37
 
38
  if (x != 256)
39
    abort ();
40
 
41
  return 0;
42
}
43
 
44
/* The order of computation should not be changed for cond_expr, therefore,
45
   it cannot be vectorized in reduction.  */
46
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
47
/* { dg-final { cleanup-tree-dump "vect" } } */
48
 
49
 

powered by: WebSVN 2.1.0

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