Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/slp-12.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 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 * 8] += 99; \
13 a[i * 8 + 1] += 11; \
14 a[i * 8 + 2] += 17; \
15 a[i * 8 + 3] += 80; \
16 a[i * 8 + 4] += 63; \
17 a[i * 8 + 5] += 37; \
18 a[i * 8 + 6] += 24; \
19 a[i * 8 + 7] += 81; \
20 } \
21 }
22
23 #define TEST_ALL(T) \
24 T (int8_t) \
25 T (uint8_t) \
26 T (int16_t) \
27 T (uint16_t) \
28 T (int32_t) \
29 T (uint32_t) \
30 T (int64_t) \
31 T (uint64_t)
32
33 TEST_ALL (VEC_PERM)
34 /* This testcase is from aarch64 and floating-point operations are removed.
35 TODO: We will add floating-point operations back and make them as common test in the future. */