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