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