Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vsetvlmax-13.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-schedule-insns -fno-schedule-insns2" } */
3
4 #include "riscv_vector.h"
5
6 void foo(int32_t *in1, int32_t *in2, int32_t *in3, int32_t *out, size_t n, int cond) {
7
8 size_t vl;
9 if (cond) {
10 vl = __riscv_vsetvlmax_e32m1();
11 vint8mf8_t v = *(vint8mf8_t*)(in1 + 1000);
12 *(vint8mf8_t*)(out + 1000) = v;
13 }
14 else
15 vl = 55;
16 for (size_t i = 0; i < n; i += 1) {
17 vint32m1_t a = __riscv_vle32_v_i32m1(in1, vl);
18 vint32m1_t b = __riscv_vle32_v_i32m1_tu(a, in2, vl);
19 vint32m1_t c = __riscv_vle32_v_i32m1_tu(b, in3, vl);
20 __riscv_vse32_v_i32m1(out, c, vl);
21 }
22 }
23
24 /* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*[a-x0-9]+,\s*e32,\s*m1,\s*tu,\s*m[au]} 1 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
25 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf4,\s*t[au],\s*m[au]} 1 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
26 /* { 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 "-g" no-opts "-funroll-loops" } } } } */
27 /* { dg-final { scan-assembler-times {vsetvli} 3 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */