Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/slp-10.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-march=rv32gcv -mabi=ilp32d -mrvv-vector-bits=scalable -fno-vect-cost-model -fdump-tree-optimized-details" } */
3
4 #include <stdint-gcc.h>
5
6 #define VEC_PERM(TYPE) \
7 TYPE __attribute__ ((noinline, noclone)) \
8 vec_slp_##TYPE (TYPE *restrict a, int n) \
9 { \
10 for (int i = 0; i < n; ++i) \
11 { \
12 a[i * 2] += 10; \
13 a[i * 2 + 1] += 17; \
14 } \
15 }
16
17 #define TEST_ALL(T) \
18 T (int8_t) \
19 T (uint8_t) \
20 T (int16_t) \
21 T (uint16_t) \
22 T (int32_t) \
23 T (uint32_t) \
24 T (int64_t) \
25 T (uint64_t)
26
27 TEST_ALL (VEC_PERM)
28
29 /* { dg-final { scan-tree-dump-times "{ 10, 17, ... }" 8 "optimized" } } */
30 /* This testcase is from aarch64 and floating-point operations are removed.
31 TODO: We will add floating-point operations back and make them as common test in the future. */
32