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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-109.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_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 32
7
 
8
short sa[N];
9
short sc[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
10
                16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
11
short sb[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
12
                16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
13
int ia[N];
14
int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
15
               0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
16
int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,
17
               0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
18
 
19
__attribute__ ((noinline))
20
int main1 (int n)
21
{
22
  int i;
23
 
24
  /* Multiple types with different sizes, used in idependent
25
     copmutations. Vectorizable.  */
26
  for (i = 0; i < n; i++)
27
    {
28
      sa[i+2] = sb[i] + sc[i];
29
      ia[i+1] = ib[i] + ic[i];
30
    }
31
 
32
  /* check results:  */
33
  for (i = 0; i < n; i++)
34
    {
35
      if (sa[i+2] != sb[i] + sc[i] || ia[i+1] != ib[i] + ic[i])
36
        abort ();
37
    }
38
 
39
  return 0;
40
}
41
 
42
int main2 (int n)
43
{
44
  int i;
45
 
46
  /* Multiple types with different sizes, used in idependent
47
     copmutations. Vectorizable.  */
48
  for (i = 0; i < n; i++)
49
    {
50
      ia[i+1] = ib[i] + ic[i];
51
      sa[i] = sb[i] + sc[i];
52
    }
53
 
54
  /* check results:  */
55
  for (i = 0; i < n; i++)
56
    {
57
      if (sa[i] != sb[i] + sc[i] || ia[i+1] != ib[i] + ic[i])
58
        abort ();
59
    }
60
 
61
  return 0;
62
}
63
 
64
 
65
int main (void)
66
{
67
  check_vect ();
68
 
69
  main1 (N-2);
70
  main2 (N-1);
71
 
72
  return 0;
73
}
74
 
75
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_hw_misalign } } } */
76
/* { dg-final { scan-tree-dump-times "not vectorized: unsupported unaligned store" 2 "vect" { xfail vect_hw_misalign } } } */
77
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 10 "vect" { target vect_hw_misalign } } } */
78
/* { dg-final { cleanup-tree-dump "vect" } } */
79
 

powered by: WebSVN 2.1.0

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