Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/avl_single-103.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-schedule-insns -fno-schedule-insns2 -fno-tree-vectorize" } */
3
4 #include "riscv_vector.h"
5
6 void f(void *base, void *out, void *mask_in, size_t m) {
7 vbool64_t mask = *(vbool64_t*)mask_in;
8 size_t vl = 105;
9 vint32mf2_t v0 = __riscv_vle32_v_i32mf2(base + 1000, vl);
10 __riscv_vse32_v_i32mf2 (out + 1000, v0, vl);
11 for (size_t i = 0; i < m; i++) {
12 if (i % 2 == 0) {
13 vint8mf8_t v0 = __riscv_vle8_v_i8mf8(base + i, vl);
14 vint8mf8_t v1 = __riscv_vle8_v_i8mf8_tu(v0, base + i + 100, vl);
15 v1 = __riscv_vadd_vv_i8mf8 (v0,v1,vl);
16 __riscv_vse8_v_i8mf8 (out + i, v1, vl);
17 } else {
18 vint16mf4_t v0 = __riscv_vle16_v_i16mf4(base + i, vl);
19 vint16mf4_t v1 = __riscv_vle16_v_i16mf4_mu(mask, v0, base + i + 100, vl);
20 __riscv_vse16_v_i16mf4 (out + i, v1, vl);
21 }
22 }
23 }
24
25 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 1 { target { no-opts "-O0" no-opts "-Os" no-opts "-O1" no-opts "-g" no-opts "-funroll-loops" } } } } */
26 /* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*[a-x0-9]+,\s*e8,\s*mf8,\s*tu,\s*mu} 1 { target { no-opts "-O0" no-opts "-Os" no-opts "-O1" no-opts "-g" no-opts "-funroll-loops" } } } } */
27 /* { dg-final { scan-assembler-times {vsetvli} 2 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-g" no-opts "-funroll-loops" } } } } */