RISC-V: Force scalable vector on all vsetvl tests
[official-gcc.git] / gcc / testsuite / gcc.target / riscv / rvv / vsetvl / imm_loop_invariant-1.c
blobe198892dc5ca523230960adc40144d75577a0137
1 /* { dg-do compile } */
2 /* { dg-options "--param=riscv-autovec-preference=scalable -march=rv32gcv -mabi=ilp32 -fno-schedule-insns -fno-schedule-insns2" } */
4 #include "riscv_vector.h"
6 void f1 (void * restrict in, void * restrict out, int l, int n, int m)
8 for (int i = 0; i < l; i++){
9 for (int j = 0; j < m; j++){
10 for (int k = 0; k < n; k++)
12 vint8mf8_t v = __riscv_vle8_v_i8mf8 (in + i + j, 17);
13 __riscv_vse8_v_i8mf8 (out + i + j, v, 17);
19 void f2 (void * restrict in, void * restrict out, int l, int n, int m)
21 for (int i = 0; i < l; i++){
22 for (int j = 0; j < m; j++){
23 for (int k = 0; k < n; k++)
25 vuint8mf8_t v = __riscv_vle8_v_u8mf8 (in + i + j, 17);
26 __riscv_vse8_v_u8mf8 (out + i + j, v, 17);
32 void f3 (void * restrict in, void * restrict out, int l, int n, int m)
34 for (int i = 0; i < l; i++){
35 for (int j = 0; j < m; j++){
36 for (int k = 0; k < n; k++)
38 vint8mf4_t v = __riscv_vle8_v_i8mf4 (in + i + j, 17);
39 __riscv_vse8_v_i8mf4 (out + i + j, v, 17);
45 void f4 (void * restrict in, void * restrict out, int l, int n, int m)
47 for (int i = 0; i < l; i++){
48 for (int j = 0; j < m; j++){
49 for (int k = 0; k < n; k++)
51 vuint8mf4_t v = __riscv_vle8_v_u8mf4 (in + i + j, 17);
52 __riscv_vse8_v_u8mf4 (out + i + j, v, 17);
58 void f5 (void * restrict in, void * restrict out, int l, int n, int m)
60 for (int i = 0; i < l; i++){
61 for (int j = 0; j < m; j++){
62 for (int k = 0; k < n; k++)
64 vint8mf2_t v = __riscv_vle8_v_i8mf2 (in + i + j, 17);
65 __riscv_vse8_v_i8mf2 (out + i + j, v, 17);
71 void f6 (void * restrict in, void * restrict out, int l, int n, int m)
73 for (int i = 0; i < l; i++){
74 for (int j = 0; j < m; j++){
75 for (int k = 0; k < n; k++)
77 vuint8mf2_t v = __riscv_vle8_v_u8mf2 (in + i + j, 17);
78 __riscv_vse8_v_u8mf2 (out + i + j, v, 17);
84 void f7 (void * restrict in, void * restrict out, int l, int n, int m)
86 for (int i = 0; i < l; i++){
87 for (int j = 0; j < m; j++){
88 for (int k = 0; k < n; k++)
90 vint8m1_t v = __riscv_vle8_v_i8m1 (in + i + j, 17);
91 __riscv_vse8_v_i8m1 (out + i + j, v, 17);
97 void f8 (void * restrict in, void * restrict out, int l, int n, int m)
99 for (int i = 0; i < l; i++){
100 for (int j = 0; j < m; j++){
101 for (int k = 0; k < n; k++)
103 vuint8m1_t v = __riscv_vle8_v_u8m1 (in + i + j, 17);
104 __riscv_vse8_v_u8m1 (out + i + j, v, 17);
110 void f9 (void * restrict in, void * restrict out, int l, int n, int m)
112 for (int i = 0; i < l; i++){
113 for (int j = 0; j < m; j++){
114 for (int k = 0; k < n; k++)
116 vint8m2_t v = __riscv_vle8_v_i8m2 (in + i + j, 17);
117 __riscv_vse8_v_i8m2 (out + i + j, v, 17);
123 void f10 (void * restrict in, void * restrict out, int l, int n, int m)
125 for (int i = 0; i < l; i++){
126 for (int j = 0; j < m; j++){
127 for (int k = 0; k < n; k++)
129 vuint8m2_t v = __riscv_vle8_v_u8m2 (in + i + j, 17);
130 __riscv_vse8_v_u8m2 (out + i + j, v, 17);
136 void f11 (void * restrict in, void * restrict out, int l, int n, int m)
138 for (int i = 0; i < l; i++){
139 for (int j = 0; j < m; j++){
140 for (int k = 0; k < n; k++)
142 vint8m4_t v = __riscv_vle8_v_i8m4 (in + i + j, 17);
143 __riscv_vse8_v_i8m4 (out + i + j, v, 17);
149 void f12 (void * restrict in, void * restrict out, int l, int n, int m)
151 for (int i = 0; i < l; i++){
152 for (int j = 0; j < m; j++){
153 for (int k = 0; k < n; k++)
155 vuint8m4_t v = __riscv_vle8_v_u8m4 (in + i + j, 17);
156 __riscv_vse8_v_u8m4 (out + i + j, v, 17);
162 void f13 (void * restrict in, void * restrict out, int l, int n, int m)
164 for (int i = 0; i < l; i++){
165 for (int j = 0; j < m; j++){
166 for (int k = 0; k < n; k++)
168 vint8m8_t v = __riscv_vle8_v_i8m8 (in + i + j, 17);
169 __riscv_vse8_v_i8m8 (out + i + j, v, 17);
175 void f14 (void * restrict in, void * restrict out, int l, int n, int m)
177 for (int i = 0; i < l; i++){
178 for (int j = 0; j < m; j++){
179 for (int k = 0; k < n; k++)
181 vuint8m8_t v = __riscv_vle8_v_u8m8 (in + i + j, 17);
182 __riscv_vse8_v_u8m8 (out + i + j, v, 17);
188 /* { dg-final { scan-assembler-times {\.L[0-9]+\:\s+vle8\.v\s+v[0-9]+,\s*0\s*\([a-x0-9]+\)} 14 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
189 /* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*17,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
190 /* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*17,\s*e8,\s*mf4,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
191 /* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*17,\s*e8,\s*mf2,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
192 /* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*17,\s*e8,\s*m1,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
193 /* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*17,\s*e8,\s*m2,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
194 /* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*17,\s*e8,\s*m4,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */
195 /* { dg-final { scan-assembler-times {vsetivli\s+zero,\s*17,\s*e8,\s*m8,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-g" no-opts "-funroll-loops" } } } } */