Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize -fno-schedule-insns -fno-schedule-insns2" } */
3
4 #include "riscv_vector.h"
5
6 void f (void * restrict in, void * restrict out, int n, int cond)
7 {
8 size_t vl = 777;
9 if (n > cond) {
10 vint8mf8_t v = __riscv_vle8_v_i8mf8 (in + 600, vl);
11 vint8mf8_t v2 = __riscv_vle8_v_i8mf8_tu (v, in + 600, vl);
12 __riscv_vse8_v_i8mf8 (out + 600, v2, vl);
13 } else {
14 vint8mf8_t v = __riscv_vle8_v_i8mf8 (in + 700, vl);
15 __riscv_vse8_v_i8mf8 (out + 700, v, vl);
16 }
17
18 for (int i = 0 ; i < n * n * n * n; i++) {
19 vint8mf8_t v = *(vint8mf8_t*) (in + 900 + i);
20 *(vint8mf8_t*) (out + 900 + i) = v;
21 }
22
23 for (int i = 0 ; i < n; i++) {
24 vint32m1_t v = __riscv_vle32_v_i32m1 (in + 1000 + i, vl);
25 __riscv_vse32_v_i32m1 (out + 1000 + i, v, vl);
26 }
27
28 vl = 888;
29 for (int i = 0 ; i < n; i++) {
30 vint32m1_t v = __riscv_vle32_v_i32m1 (in + 1000 + i, vl);
31 __riscv_vse32_v_i32m1 (out + 1000 + i, v, vl);
32 }
33
34 vl = 444;
35 for (int i = 0 ; i < n * n; i++) {
36 vint32m1_t v = __riscv_vle32_v_i32m1 (in + 2000 + i, vl);
37 __riscv_vse32_v_i32m1 (out + 2000 + i, v, vl);
38 }
39 }
40
41 /* { dg-final { scan-assembler-times {vsetvli} 6 { target { no-opts "-O0" no-opts "-funroll-loops" no-opts "-g" } } } } */