Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/widen/widen-9.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 TEST_TYPE(TYPE1, TYPE2, TYPE3) \
7 __attribute__ ((noipa)) void vwmacc_##TYPE1_##TYPE2 (TYPE1 *__restrict dst, \
8 TYPE2 *__restrict a, \
9 TYPE3 *__restrict b, \
10 int n) \
11 { \
12 for (int i = 0; i < n; i++) \
13 dst[i] += (TYPE1) a[i] * (TYPE1) b[i]; \
14 }
15
16 #define TEST_ALL() \
17 TEST_TYPE (int16_t, int8_t, uint8_t) \
18 TEST_TYPE (int32_t, int16_t, uint16_t) \
19 TEST_TYPE (int64_t, int32_t, uint32_t)
20
21 TEST_ALL ()
22
23 /* { dg-final { scan-assembler-times {\tvwmaccsu\.vv} 3 } } */