Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/vector-8.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdump-tree-forwprop1-details" } */
3 /* { dg-additional-options "-msse2" { target i?86-*-* x86_64-*-* } } */
4
5 typedef int vec __attribute__((vector_size (4 * sizeof (int))));
6
7 void f (vec *p_v_in_1, vec *p_v_in_2, vec *p_v_out_1, vec *p_v_out_2)
8 {
9 vec sel0 = { 0, 2, 0, 2 };
10 vec sel1 = { 1, 3, 1, 3 };
11 vec sel = { 0, 1, 6, 7 };
12 vec v_1, v_2, v_x, v_y, v_out_1, v_out_2;
13 vec v_in_1 = *p_v_in_1;
14 vec v_in_2 = *p_v_in_2;
15
16 /* First vec perm sequence. */
17 v_1 = __builtin_shuffle (v_in_1, v_in_1, sel0);
18 v_2 = __builtin_shuffle (v_in_1, v_in_1, sel1);
19 v_x = v_1 + v_2;
20 v_y = v_1 - v_2;
21 v_out_1 = __builtin_shuffle (v_x, v_y, sel);
22
23 /* Second vec perm sequence. */
24 v_1 = __builtin_shuffle (v_in_2, v_in_2, sel0);
25 v_2 = __builtin_shuffle (v_in_2, v_in_2, sel1);
26 v_x = v_1 + v_2;
27 v_y = v_1 - v_2;
28 v_out_2 = __builtin_shuffle (v_x, v_y, sel);
29
30 *p_v_out_1 = v_out_1;
31 *p_v_out_2 = v_out_2;
32 }
33
34 /* { dg-final { scan-tree-dump "Vec perm simplify sequences have been blended" "forwprop1" { target { aarch64*-*-* i?86-*-* x86_64-*-* } } } } */
35 /* { dg-final { scan-tree-dump "VEC_PERM_EXPR.*{ 2, 3, 6, 7 }" "forwprop1" { target { aarch64*-*-* i?86-*-* x86_64-*-* } } } } */