Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111234.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mrvv-vector-bits=scalable -march=rv64gcv -mabi=lp64d -O3" } */
3
4 #include "riscv_vector.h"
5
6 void
7 f (vint32m1_t *in, vint64m2_t *out, vbool32_t *m, int b)
8 {
9 vint32m1_t va = *in;
10 vbool32_t mask = *m;
11 vint64m2_t vb
12 = __riscv_vwadd_vx_i64m2_m (mask, va, 1, __riscv_vsetvlmax_e64m2 ());
13 vint64m2_t vc = __riscv_vadd_vx_i64m2 (vb, 1, __riscv_vsetvlmax_e64m2 ());
14
15 if (b != 0)
16 vc = __riscv_vadd_vx_i64m2_mu (mask, vc, vc, 1, __riscv_vsetvlmax_e64m2 ());
17
18 *out = vc;
19 }