RISC-V: Force scalable vector on all vsetvl tests
[official-gcc.git] / gcc / testsuite / gcc.target / riscv / rvv / vsetvl / vlmax_back_prop-35.c
blob99dbbbab71bb4b40c80316fb6ea085d3d884b666
1 /* { dg-do compile } */
2 /* { dg-options "--param=riscv-autovec-preference=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize" } */
4 #include "riscv_vector.h"
6 void f (int32_t * restrict in, int32_t * restrict out, int32_t * restrict in2, int32_t * restrict out2, int n, int cond)
8 if (cond == 0)
10 for (int i = 0; i < n; i++)
12 out2[i] = out[i] + in[i];
15 else if (cond == 1)
17 for (int i = 0; i < n; i++)
19 out2[i] = out[i] + in[i];
21 for (int i = 0; i < n; i++)
23 out[i] = out2[i] / in[i];
25 for (int i = 0; i < n; i++)
27 out2[i] = out[i] * in[i];
30 for (int i = 0; i < n; i++)
32 vint8mf8_t v1;
33 *(vint8mf8_t*)(out + i + 10) = v1;
37 /* { 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 "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
38 /* { dg-final { scan-assembler-times {vsetvli} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */