1 /* { dg-require-effective-target vect_int } */
38 void foo (unsigned int *__restrict__ pInput,
39 unsigned int *__restrict__ pOutput,
40 unsigned int *__restrict__ pInput2,
41 unsigned int *__restrict__ pOutput2)
43 unsigned int i, a, b, c, d, e;
45 for (i = 0; i < N / 5; i++)
53 *pOutput++ = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e;
54 *pOutput++ = M10 * a + M11 * b + M12 * c + M13 * d + M14 * e;
55 *pOutput++ = M20 * a + M21 * b + M22 * c + M23 * d + M24 * e;
56 *pOutput++ = M30 * a + M31 * b + M32 * c + M33 * d + M34 * e;
57 *pOutput++ = M40 * a + M41 * b + M42 * c + M43 * d + M44 * e;
66 *pOutput2++ = M00 * a + M01 * b + M02 * c + M03 * d + M04 * e;
67 *pOutput2++ = M10 * a + M11 * b + M12 * c + M13 * d + M14 * e;
68 *pOutput2++ = M20 * a + M21 * b + M22 * c + M23 * d + M24 * e;
69 *pOutput2++ = M30 * a + M31 * b + M32 * c + M33 * d + M34 * e;
70 *pOutput2++ = M40 * a + M41 * b + M42 * c + M43 * d + M44 * e;
75 int main (int argc, const char* argv[])
77 unsigned int input[N], output[N], i, input2[N], output2[N];
78 unsigned int check_results[N] = {3208, 1334, 28764, 35679, 2789, 13028,
79 4754, 168364, 91254, 12399, 22848, 8174, 307964, 146829, 22009, 0};
80 unsigned int check_results2[N] = {7136, 2702, 84604, 57909, 6633, 16956,
81 6122, 224204, 113484, 16243, 26776, 9542, 363804, 169059, 25853, 0};
85 for (i = 0; i < N; i++)
91 __asm__ volatile ("");
94 foo (input, output, input2, output2);
96 for (i = 0; i < N; i++)
97 if (output[i] != check_results[i]
98 || output2[i] != check_results2[i])
104 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
105 /* { dg-final { scan-tree-dump "permutation requires at least three vectors" "vect" { target vect_perm } } } */
106 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" } } */
107 /* { dg-final { cleanup-tree-dump "vect" } } */