Debian Codegraph @

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

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