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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-6-big-array.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target vect_float } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 128
7
 
8
float results1[N];
9
float results2[N];
10
float a[N] = {0};
11
float e[N] = {0};
12
float b[N];
13
float c[N];
14
 
15
volatile int y = 0;
16
 
17
__attribute__ ((noinline))
18
int main1 ()
19
{
20
  int i;
21
 
22
  for (i=0; i<N; i++)
23
    {
24
      b[i] = i*3;
25
      c[i] = i;
26
      results1[i] = 0;
27
      results2[i] = 0;
28
      /* Avoid vectorization.  */
29
      if (y)
30
        abort ();
31
    }
32
  for (i=0; i<N/2; i++)
33
    {
34
      results1[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
35
      results2[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
36
      /* Avoid vectorization.  */
37
      if (y)
38
        abort ();
39
    }
40
 
41
  for (i = 0; i < N/2; i++)
42
    {
43
      a[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
44
      e[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
45
    }
46
 
47
  /* check results:  */
48
  for (i=0; i<N; i++)
49
    {
50
      if (a[i] != results1[i] || e[i] != results2[i])
51
        abort ();
52
    }
53
 
54
 
55
  for (i = 1; i <=N-4; i++)
56
    {
57
      a[i+3] = b[i-1];
58
    }
59
 
60
  /* check results:  */
61
  for (i = 1; i <=N-4; i++)
62
    {
63
      if (a[i+3] != b[i-1])
64
        abort ();
65
    }
66
 
67
  return 0;
68
}
69
 
70
int main (void)
71
{
72
  check_vect ();
73
 
74
  return main1 ();
75
}
76
 
77
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
78
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { { vect_aligned_arrays } && {! vect_sizes_32B_16B} } } } } */
79
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { {! vect_aligned_arrays } && {vect_sizes_32B_16B} } } } } */
80
/* { 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.