Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/imm_bb_prop-1.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 (int8_t * restrict in, int8_t * restrict out, int n, int cond)
7 {
8 if (n > cond) {
9 vint8mf8_t v = __riscv_vle8_v_i8mf8 (in + 600, 5);
10 vint8mf8_t v2 = __riscv_vle8_v_i8mf8_tu (v, in + 600, 5);
11 __riscv_vse8_v_i8mf8 (out + 600, v2, 5);
12 } else {
13 vint8mf8_t v = __riscv_vle8_v_i8mf8 (in + 700, 5);
14 __riscv_vse8_v_i8mf8 (out + 700, v, 5);
15 }
16
17 for (int i = 0 ; i < n * n; i++)
18 out[i] = out[i] + out[i];
19
20 for (int i = 0 ; i < n * n * n; i++)
21 out[i] = out[i] * out[i];
22
23 for (int i = 0 ; i < n * n * n * n; i++)
24 out[i] = out[i] * out[i];
25
26 for (int i = 0 ; i < n * n * n * n; i++) {
27 vint8mf8_t v = __riscv_vle8_v_i8mf8 (in + 900 + i, 5);
28 __riscv_vse8_v_i8mf8 (out + 900 + i, v, 5);
29 }
30 }
31
32 /* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*5,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
33 /* { dg-final { scan-assembler {vsetivli\s+zero,\s*5,\s*e8,\s*mf8,\s*tu,\s*m[au]} { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */