Debian Codegraph @

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