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-multitypes-3.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_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 32
7
 
8
int ib[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
9
        {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
10
short sb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
11
        {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
12
char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) =
13
        {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
14
 
15
__attribute__ ((noinline))
16
int main1 (int n, int * __restrict__ pib,
17
           short * __restrict__ psb,
18
           char * __restrict__ pcb)
19
{
20
  int i;
21
  int ia[N];
22
  short sa[N];
23
  char ca[N];
24
 
25
  /* Multiple types with different sizes, used in independent
26
     computations. Vectorizable. The loads are misaligned.  */
27
  for (i = 0; i < n; i++)
28
    {
29
      ia[i] = pib[i];
30
      sa[i] = psb[i];
31
      ca[i] = pcb[i];
32
    }
33
 
34
  /* check results:  */
35
  for (i = 0; i < n; i++)
36
    {
37
      if (ia[i] != pib[i]
38
          || sa[i] != psb[i]
39
          || ca[i] != pcb[i])
40
        abort ();
41
    }
42
 
43
  return 0;
44
}
45
 
46
int main (void)
47
{
48
  check_vect ();
49
 
50
  main1 (N, ib, sb, cb);
51
  main1 (N-3, ib, sb, &cb[2]);
52
  return 0;
53
}
54
 
55
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
56
/*  { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 3 "vect" { target vect_no_align } } } */
57
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 3 "vect" {xfail { vect_no_align } } } } */
58
/* { dg-final { cleanup-tree-dump "vect" } } */
59
 

powered by: WebSVN 2.1.0

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