Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_widen_complicate-9.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d -mrvv-vector-bits=scalable -ffast-math" } */
3
4 #include <stdint-gcc.h>
5
6 #define TEST_TYPE(TYPE1, TYPE2) \
7 __attribute__ ((noipa)) void vwadd_##TYPE1_##TYPE2 ( \
8 TYPE1 *__restrict dst, TYPE1 *__restrict dst2, TYPE1 *__restrict dst3, \
9 TYPE1 *__restrict dst4, TYPE2 *__restrict a, TYPE2 *__restrict b, \
10 TYPE2 *__restrict a2, TYPE2 *__restrict b2, int *__restrict pred, int n) \
11 { \
12 for (int i = 0; i < n; i++) \
13 { \
14 dst[i] = pred[i] ? -((TYPE1) a[i] * (TYPE1) b[i]) - dst[i] : dst[i]; \
15 dst2[i] \
16 = pred[i] ? -((TYPE1) a2[i] * (TYPE1) b[i]) - dst2[i] : dst2[i]; \
17 dst3[i] \
18 = pred[i] ? -((TYPE1) a2[i] * (TYPE1) a[i]) - dst3[i] : dst3[i]; \
19 dst4[i] \
20 = pred[i] ? -((TYPE1) a[i] * (TYPE1) b2[i]) - dst4[i] : dst4[i]; \
21 } \
22 }
23
24 #define TEST_ALL() \
25 TEST_TYPE (float, _Float16) \
26 TEST_TYPE (double, float)
27
28 TEST_ALL ()
29
30 /* Other optimization removed some mask operand of vfwnmacc.vv, so expected 6
31 * instead of 8. */
32 /* { dg-final { scan-assembler-times {\tvfwnmacc\.vv\t} 6 } } */
33 /* { dg-final { scan-assembler-not {\tvmerge\.vvm\t} } } */