1 /* { dg-do compile } */
2 /* { dg-options "--param=riscv-autovec-preference=scalable -march=rv32gcv -mabi=ilp32" } */
4 #include "riscv_vector.h"
6 /* The for loop body should not have vsetvl instruction. */
7 void f (void * restrict in
, void * restrict out
, int n
, int cond
)
12 vuint8mf4_t v
= *(vuint8mf4_t
*)(in
+ 100);
13 *(vuint8mf4_t
*)(out
+ 100) = v
;
17 vuint8mf4_t v
= *(vuint8mf4_t
*)(in
+ 200);
18 *(vuint8mf4_t
*)(out
+ 100) = v
;
22 vuint8mf4_t v
= *(vuint8mf4_t
*)(in
+ 300);
23 *(vuint8mf4_t
*)(out
+ 100) = v
;
27 vuint8mf4_t v
= *(vuint8mf4_t
*)(in
+ 400);
28 *(vuint8mf4_t
*)(out
+ 400) = v
;
32 for (int i
= 0; i
< n
; i
++)
34 vuint8mf4_t v
= *(vuint8mf4_t
*)(in
+ i
);
35 *(vuint8mf4_t
*)(out
+ i
) = v
;
39 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf4,\s*t[au],\s*m[au]} 4 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */
40 /* { dg-final { scan-assembler-times {ble\t[a-x0-9]+,zero,.L[0-9]+\s*\.L[0-9]+\:\s*vle8\.v\s+v[0-9]+,0\([a-x0-9]+\)} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" no-opts "-flto" } } } } */