Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/slp_7_costly.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize -msve-vector-bits=scalable -ffast-math -fno-vect-cost-model" } */
3
4 #include <stdint.h>
5
6 #define VEC_PERM(TYPE) \
7 void __attribute__ ((noinline, noclone)) \
8 vec_slp_##TYPE (TYPE *restrict a, TYPE *restrict b, int n) \
9 { \
10 TYPE x0 = b[0]; \
11 TYPE x1 = b[1]; \
12 TYPE x2 = b[2]; \
13 TYPE x3 = b[3]; \
14 for (int i = 0; i < n; ++i) \
15 { \
16 x0 += a[i * 4]; \
17 x1 += a[i * 4 + 1]; \
18 x2 += a[i * 4 + 2]; \
19 x3 += a[i * 4 + 3]; \
20 } \
21 b[0] = x0; \
22 b[1] = x1; \
23 b[2] = x2; \
24 b[3] = x3; \
25 }
26
27 #define TEST_ALL(T) \
28 T (int64_t) \
29 T (uint64_t) \
30 T (double)
31
32 TEST_ALL (VEC_PERM)
33
34 /* We can't use SLP for the 64-bit loops, since the number of reduction
35 results might be greater than the number of elements in the vector. */
36 /* { dg-final { scan-assembler-times {\tld4d\t} 3 } } */
37 /* { dg-final { scan-assembler-not {\tld1d\t} } } */
38 /* { dg-final { scan-assembler-times {\tuaddv\td[0-9]+, p[0-7], z[0-9]+\.d} 8 } } */
39 /* { dg-final { scan-assembler-times {\tfaddv\td[0-9]+, p[0-7], z[0-9]+\.d} 4 } } */
40
41 /* { dg-final { scan-assembler-times {\twhilelo\tp[0-7]\.d} 6 } } */
42
43 /* { dg-final { scan-assembler-not {\tuqdec} } } */