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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-iv-3.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
 
8
__attribute__ ((noinline)) int main1 ()
9
{
10
  int arr1[N];
11
  int arr2[N];
12
  int k = 0;
13
  int m = 3, i = 0;
14
 
15
  /* vectorization of induction.
16
     Peeling to align the store is also applied.  */
17
 
18
   do {
19
        k = k + 2;
20
        arr1[i] = k;
21
        m = k + 3;
22
        arr2[i] = m;
23
        i++;
24
   } while (i < N);
25
 
26
  /* check results:  */
27
  for (i = 0; i < N; i++)
28
    {
29
      if (arr1[i] != 2+2*i || arr2[i] != 5 + 2*i)
30
        abort ();
31
    }
32
 
33
  return 0;
34
}
35
 
36
int main (void)
37
{
38
  check_vect ();
39
 
40
  return main1 ();
41
}
42
 
43
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
44
/* { 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.