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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-24-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_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 64
7
 
8
typedef struct {
9
   unsigned char a;
10
   unsigned char b;
11
   unsigned char c;
12
   unsigned char d;
13
} s;
14
 
15
unsigned char ub[N*2];
16
unsigned char uc[N];
17
 
18
volatile int y = 0;
19
unsigned char check_diff = 2;
20
 
21
void
22
main1 (unsigned char x, unsigned char max_result, unsigned char min_result, s *arr)
23
{
24
  int i;
25
  unsigned char udiff = 2;
26
  unsigned char umax = x;
27
  unsigned char umin = x;
28
  unsigned char ua1[N*2];
29
  s *pIn = arr;
30
  s out[N];
31
 
32
  for (i = 0; i < N; i++) {
33
    udiff += (unsigned char) (ub[i] - uc[i]);
34
 
35
    ua1[2*i+1] = ub[2*i+1];
36
    ua1[2*i] = ub[2*i];
37
 
38
    out[i].d = pIn->d - 1;
39
    out[i].b = pIn->b - 4;
40
    out[i].c = pIn->c - 8;
41
    out[i].a = pIn->a - 3;
42
 
43
    pIn++;
44
  }
45
 
46
  for (i = 0; i < N; i++) {
47
    if (ua1[2*i] != ub[2*i]
48
        || ua1[2*i+1] != ub[2*i+1]
49
        || out[i].a != arr[i].a - 3
50
        || out[i].b != arr[i].b - 4
51
        || out[i].c != arr[i].c - 8
52
        || out[i].d != arr[i].d - 1)
53
      abort ();
54
  }
55
 
56
  /* check results:  */
57
  if (udiff != check_diff)
58
    abort ();
59
}
60
 
61
int main (void)
62
{
63
  int i;
64
  s arr[N];
65
 
66
  check_diff = 2;
67
  ub[0] = uc[0] = 1;
68
  for (i = 1; i < N; i++) {
69
    ub[i] = (i%5 == 0)?i*3:i;
70
    uc[i] = i;
71
    check_diff += (unsigned char) (ub[i] - uc[i]);
72
    if (y) /* Avoid vectorization.  */
73
      abort ();
74
  }
75
  for (; i < 2*N; i++) {
76
    ub[i] = 0;
77
    if (y) /* Avoid vectorization.  */
78
      abort ();
79
  }
80
 
81
  for (i = 0; i < N; i++)
82
    {
83
      arr[i].a = i + 9;
84
      arr[i].b = i * 2 + 10;
85
      arr[i].c = 17;
86
      arr[i].d = i+34;
87
      if (arr[i].a == 178)
88
         abort ();
89
    }
90
  check_vect ();
91
 
92
  main1 (100, 100, 1, arr);
93
  main1 (0, 15, 0, arr);
94
  return 0;
95
}
96
 
97
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { vect_no_align && ilp32 } } } } */
98
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { vect_no_align && ilp32 } } } } */
99
/* { 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.