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.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-30.c] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-require-effective-target vect_float } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
 
8
float b[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
9
float a[N];
10
float c[N];
11
 
12
int main1 (int n)
13
{
14
  int i=0;
15
 
16
  /* Vectorized: unknown loop bound.  */
17
  while (n--) {
18
    a[i] = b[i];
19
    i++;
20
  }
21
 
22
  /* check results:  */
23
  for (i = 0; i < n; i++)
24
    {
25
      if (a[i] != b[i])
26
        abort ();
27
    }
28
 
29
  return 0;
30
}
31
 
32
int main2 (unsigned int n)
33
{
34
  int i=0;
35
  int nn = n;
36
 
37
  /* Vectorized: unknown loop bound.  */
38
  while (n--) {
39
    c[i] = b[i];
40
    i++;
41
  }
42
 
43
  /* check results:  */
44
  for (i = 0; i < nn; i++)
45
    {
46
      if (c[i] != b[i])
47
        abort ();
48
    }
49
 
50
  return 0;
51
}
52
 
53
int main (void)
54
{
55
  check_vect ();
56
 
57
  main1 (N);
58
  main2 (N);
59
  return 0;
60
}
61
 
62
/* Need misalignment support, or cgraph to delay emitting the arrays until
63
   after vectorization can force-align them.  */
64
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_align } } } */
65
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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