Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/gather-scatter/gather_load_run-11.c

raw
1 /* { dg-do run { target { riscv_v } } } */
2
3
4 #include "gather_load_64-11.c"
5 #include <assert.h>
6
7 int
8 main (void)
9 {
10 #define RUN_LOOP(DATA_TYPE, BITS) \
11 DATA_TYPE dest_##DATA_TYPE[128]; \
12 DATA_TYPE dest2_##DATA_TYPE[128]; \
13 DATA_TYPE *src_##DATA_TYPE[128]; \
14 DATA_TYPE src2_##DATA_TYPE[128]; \
15 for (int i = 0; i < 128; i++) \
16 { \
17 dest_##DATA_TYPE[i] = (DATA_TYPE) ((i * 81 + 735) & (BITS - 1)); \
18 dest2_##DATA_TYPE[i] = (DATA_TYPE) ((i * 81 + 735) & (BITS - 1)); \
19 src2_##DATA_TYPE[i] = (DATA_TYPE) ((i * 13 + 9107) & (BITS - 1)); \
20 src_##DATA_TYPE[i] = src2_##DATA_TYPE + i; \
21 } \
22 f_##DATA_TYPE (dest_##DATA_TYPE, src_##DATA_TYPE); \
23 for (int i = 0; i < 128; i++) \
24 assert (dest_##DATA_TYPE[i] \
25 == (dest2_##DATA_TYPE[i] + src_##DATA_TYPE[i][0]));
26
27 RUN_LOOP (int8_t, 8)
28 RUN_LOOP (uint8_t, 8)
29 RUN_LOOP (int16_t, 16)
30 RUN_LOOP (uint16_t, 16)
31 RUN_LOOP (_Float16, 16)
32 RUN_LOOP (int32_t, 32)
33 RUN_LOOP (uint32_t, 32)
34 RUN_LOOP (float, 32)
35 RUN_LOOP (int64_t, 64)
36 RUN_LOOP (uint64_t, 64)
37 RUN_LOOP (double, 64)
38 return 0;
39 }