Add compile command to each testcase
[gcc-vect-testsuite.git] / slp-perm-4.c
blob239461a0f852ca33e77d479cb3b61e7f92c33592
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define M00 100
7 #define M10 216
8 #define M20 23
9 #define M30 237
10 #define M40 437
12 #define M01 1322
13 #define M11 13
14 #define M21 27271
15 #define M31 2280
16 #define M41 284
18 #define M02 74
19 #define M12 191
20 #define M22 500
21 #define M32 111
22 #define M42 1114
24 #define M03 134
25 #define M13 117
26 #define M23 11
27 #define M33 771
28 #define M43 71
30 #define M04 334
31 #define M14 147
32 #define M24 115
33 #define M34 7716
34 #define M44 16
36 #define N 16
38 void foo (unsigned int *__restrict__ pInput, unsigned int *__restrict__ pOutput)
40 unsigned int i, a, b, c, d, e;
42 for (i = 0; i < N / 5; i++)
44 a = *pInput++;
45 b = *pInput++;
46 c = *pInput++;
47 d = *pInput++;
48 e = *pInput++;
50 *pOutput++ = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e;
51 *pOutput++ = M10 * a + M11 * b + M12 * c + M13 * d + M14 * e;
52 *pOutput++ = M20 * a + M21 * b + M22 * c + M23 * d + M24 * e;
53 *pOutput++ = M30 * a + M31 * b + M32 * c + M33 * d + M34 * e;
54 *pOutput++ = M40 * a + M41 * b + M42 * c + M43 * d + M44 * e;
58 int main (int argc, const char* argv[])
60 unsigned int input[N], output[N], i;
61 unsigned int check_results[N] = {3208, 1334, 28764, 35679, 2789, 13028, 4754, 168364, 91254, 12399, 22848, 8174, 307964, 146829, 22009, 0};
63 check_vect ();
65 for (i = 0; i < N; i++)
67 input[i] = i%256;
68 if (input[i] > 200)
69 abort();
70 output[i] = 0;
71 __asm__ volatile ("");
74 foo (input, output);
76 for (i = 0; i < N; i++)
77 if (output[i] != check_results[i])
78 abort ();
80 return 0;
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" } } */