OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [slp-perm-4.c] - Blame information for rev 307

Go to most recent revision | 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 M00 100
8
#define M10 216
9
#define M20 23
10
#define M30 237
11
#define M40 437
12
 
13
#define M01 1322
14
#define M11 13
15
#define M21 27271
16
#define M31 2280
17
#define M41 284
18
 
19
#define M02 74
20
#define M12 191
21
#define M22 500
22
#define M32 111
23
#define M42 1114
24
 
25
#define M03 134
26
#define M13 117
27
#define M23 11
28
#define M33 771
29
#define M43 71
30
 
31
#define M04 334
32
#define M14 147
33
#define M24 115
34
#define M34 7716
35
#define M44 16
36
 
37
#define N 16
38
 
39
void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
40
{
41
  unsigned int i, a, b, c, d, e;
42
 
43
  for (i = 0; i < N / 5; i++)
44
    {
45
       a = *pInput++;
46
       b = *pInput++;
47
       c = *pInput++;
48
       d = *pInput++;
49
       e = *pInput++;
50
 
51
       *pOutput++ = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e;
52
       *pOutput++ = M10 * a + M11 * b + M12 * c + M13 * d + M14 * e;
53
       *pOutput++ = M20 * a + M21 * b + M22 * c + M23 * d + M24 * e;
54
       *pOutput++ = M30 * a + M31 * b + M32 * c + M33 * d + M34 * e;
55
       *pOutput++ = M40 * a + M41 * b + M42 * c + M43 * d + M44 * e;
56
    }
57
}
58
 
59
int main (int argc, const char* argv[])
60
{
61
  unsigned int input[N], output[N], i;
62
  unsigned int check_results[N] = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, 22848, 8174, 307964, 146829, 22009, 0};
63
 
64
  check_vect ();
65
 
66
  for (i = 0; i < N; i++)
67
    {
68
      input[i] = i%256;
69
      if (input[i] > 200)
70
        abort();
71
      output[i] = 0;
72
    }
73
 
74
  foo (input, output);
75
 
76
  for (i = 0; i < N - N; i++)
77
    if (output[i] != check_results[i])
78
      abort ();
79
 
80
  return 0;
81
}
82
 
83
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect"  } } */
84
/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm } } } */
85
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect"  } } */
86
/* { dg-final { cleanup-tree-dump "vect" } } */
87
 

powered by: WebSVN 2.1.0

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