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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-5.c] - Blame information for rev 867

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
int main1 ()
9
{
10
  int i, j;
11
  float a[N];
12
  float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
13
  float d[N] = {0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
14
 
15
  i = 0;
16
  j = 0;
17
  while (i < 5*N)
18
    {
19
      a[j] = c[j];
20
      i += 5;
21
      j++;
22
    }
23
 
24
  /* check results:  */
25
  for (i = 0; i <N; i++)
26
    {
27
      if (a[i] != c[i])
28
        abort ();
29
    }
30
 
31
 
32
  for (i = N; i > 0; i--)
33
    {
34
      a[N-i] = d[N-i];
35
    }
36
 
37
  /* check results:  */
38
  for (i = 0; i < N; i++)
39
    {
40
      if (a[i] != d[i])
41
        abort ();
42
    }
43
 
44
  return 0;
45
}
46
 
47
int main (void)
48
{
49
  check_vect ();
50
 
51
  return main1 ();
52
}
53
 
54
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
55
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
56
/* { 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.