Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/mask_gather_load_64-6.c

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