Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_32-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d -fno-schedule-insns -fdump-tree-vect-details" } */
3
4 #include <stdint-gcc.h>
5
6 #define INDEX8 uint8_t
7 #define INDEX16 uint16_t
8 #define INDEX32 uint32_t
9 #define INDEX64 uint64_t
10
11 #define TEST_LOOP(DATA_TYPE, BITS) \
12 void __attribute__ ((noinline, noclone)) \
13 f_##DATA_TYPE (DATA_TYPE *restrict dest, DATA_TYPE *restrict src, \
14 INDEX##BITS *restrict indices, INDEX##BITS *restrict cond) \
15 { \
16 for (int i = 0; i < 128; ++i) \
17 if (cond[i]) \
18 dest[i] += src[indices[i]]; \
19 }
20
21 #define TEST_ALL(T) \
22 T (int8_t, 8) \
23 T (uint8_t, 8) \
24 T (int16_t, 16) \
25 T (uint16_t, 16) \
26 T (_Float16, 16) \
27 T (int32_t, 32) \
28 T (uint32_t, 32) \
29 T (float, 32) \
30 T (int64_t, 64) \
31 T (uint64_t, 64) \
32 T (double, 64)
33
34 TEST_ALL (TEST_LOOP)
35
36 /* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 11 "vect" } } */
37 /* { dg-final { scan-tree-dump " \.MASK_LEN_GATHER_LOAD" "vect" } } */
38 /* { dg-final { scan-tree-dump-not " \.GATHER_LOAD" "vect" } } */
39 /* { dg-final { scan-tree-dump-not " \.MASK_GATHER_LOAD" "vect" } } */
40 /* { dg-final { scan-assembler-not {vluxei64\.v} } } */
41 /* { dg-final { scan-assembler-not {vsuxei64\.v} } } */