]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-40.c
RISC-V: Add testcases for VSETVL PASS 5
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / riscv / rvv / vsetvl / vlmax_back_prop-40.c
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv32gcv -mabi=ilp32 -fno-tree-vectorize" } */
3
4 #include "riscv_vector.h"
5
6 void foo5_4 (int32_t * restrict in, int32_t * restrict out, size_t n, size_t m, int cond)
7 {
8 vint8mf2_t v;
9 for (size_t i = 0; i < n; i++)
10 {
11 for (size_t j = 0; j < m; j += 1) {
12 if (j % 2 == 0) {
13 v = *(vint8mf2_t*)(in + i + j);
14 } else {
15 *(vint8mf2_t*)(out + i + j) = v;
16 }
17 }
18 }
19 }
20
21 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf2,\s*t[au],\s*m[au]\s+\.L[0-9]+} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-funroll-loops" no-opts "-g" } } } } */
22 /* { dg-final { scan-assembler-times {vsetvli} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-funroll-loops" no-opts "-g" } } } } */