1 /* { dg-require-effective-target vect_int } */
24 void foo (int *__restrict__ pInput
, int *__restrict__ pOutput
,
25 int *__restrict__ pInput2
, int *__restrict__ pOutput2
)
29 for (i
= 0; i
< N
/ 3; i
++)
38 *pOutput
++ = M00
* a
+ M01
* b
+ M02
* c
;
39 *pOutput
++ = M10
* a
+ M11
* b
+ M12
* c
;
40 *pOutput
++ = M20
* a
+ M21
* b
+ M22
* c
;
42 /* Regular SLP - no permutation required. */
43 *pOutput2
++ = K00
* d
;
44 *pOutput2
++ = K10
* e
;
48 int main (int argc
, const char* argv
[])
50 int input
[N
], output
[N
], i
;
51 int check_results
[N
] = {1470, 395, 28271, 5958, 1655, 111653, 10446, 2915, 195035, 14934, 4175, 278417, 19422, 5435, 361799, 0};
52 int input2
[N
], output2
[N
];
53 int check_results2
[N
] = {0, 112, 810, 336, 1620, 560, 2430, 784, 3240, 1008, 0, 0, 0, 0, 0, 0};
57 for (i
= 0; i
< N
; i
++)
63 __asm__
volatile ("");
66 foo (input
, output
, input2
, output2
);
68 for (i
= 0; i
< N
; i
++)
69 if (output
[i
] != check_results
[i
] || output2
[i
] != check_results2
[i
])
75 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
76 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target vect_perm } } } */
77 /* { dg-final { cleanup-tree-dump "vect" } } */