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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-5.c] - Blame information for rev 338

Details | Compare with Previous | View Log

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