Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop-7.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d -mrvv-vector-bits=scalable -ffast-math -fno-vect-cost-model" } */
3
4 #include <stdint-gcc.h>
5
6 #define TEST_TYPE(TYPE) \
7 __attribute__ ((noipa)) void ternop_##TYPE (TYPE *__restrict dst, \
8 TYPE *__restrict a, \
9 TYPE *__restrict b, int n) \
10 { \
11 for (int i = 0; i < n; i++) \
12 dst[i] = a[i] * b[i] - dst[i]; \
13 }
14
15 #define TEST_ALL() \
16 TEST_TYPE (_Float16) \
17 TEST_TYPE (float) \
18 TEST_TYPE (double)
19
20 TEST_ALL ()
21
22 /* { dg-final { scan-assembler-times {\tvfmsub\.vv} 3 } } */
23 /* { dg-final { scan-assembler-not {\tvmv} } } */