1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+v < %s \
3 ; RUN: --verify-machineinstrs | FileCheck %s
5 define <vscale x 1 x i1> @test_1xi1(<vscale x 1 x i1> %in, <vscale x 1 x i1> %in2) nounwind {
6 ; CHECK-LABEL: test_1xi1:
7 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: vmand.mm v0, v0, v8
13 %0 = tail call <vscale x 1 x i1> asm "vmand.mm $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 1 x i1> %in, <vscale x 1 x i1> %in2)
14 ret <vscale x 1 x i1> %0
17 define <vscale x 2 x i1> @test_2xi1(<vscale x 2 x i1> %in, <vscale x 2 x i1> %in2) nounwind {
18 ; CHECK-LABEL: test_2xi1:
19 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: vmand.mm v0, v0, v8
25 %0 = tail call <vscale x 2 x i1> asm "vmand.mm $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 2 x i1> %in, <vscale x 2 x i1> %in2)
26 ret <vscale x 2 x i1> %0
29 define <vscale x 4 x i1> @test_4xi1(<vscale x 4 x i1> %in, <vscale x 4 x i1> %in2) nounwind {
30 ; CHECK-LABEL: test_4xi1:
31 ; CHECK: # %bb.0: # %entry
33 ; CHECK-NEXT: vmand.mm v0, v0, v8
37 %0 = tail call <vscale x 4 x i1> asm "vmand.mm $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 4 x i1> %in, <vscale x 4 x i1> %in2)
38 ret <vscale x 4 x i1> %0
41 define <vscale x 8 x i1> @test_8xi1(<vscale x 8 x i1> %in, <vscale x 8 x i1> %in2) nounwind {
42 ; CHECK-LABEL: test_8xi1:
43 ; CHECK: # %bb.0: # %entry
45 ; CHECK-NEXT: vmand.mm v0, v0, v8
49 %0 = tail call <vscale x 8 x i1> asm "vmand.mm $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 8 x i1> %in, <vscale x 8 x i1> %in2)
50 ret <vscale x 8 x i1> %0
53 define <vscale x 16 x i1> @test_16xi1(<vscale x 16 x i1> %in, <vscale x 16 x i1> %in2) nounwind {
54 ; CHECK-LABEL: test_16xi1:
55 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: vmand.mm v0, v0, v8
61 %0 = tail call <vscale x 16 x i1> asm "vmand.mm $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 16 x i1> %in, <vscale x 16 x i1> %in2)
62 ret <vscale x 16 x i1> %0
65 define <vscale x 32 x i1> @test_32xi1(<vscale x 32 x i1> %in, <vscale x 32 x i1> %in2) nounwind {
66 ; CHECK-LABEL: test_32xi1:
67 ; CHECK: # %bb.0: # %entry
69 ; CHECK-NEXT: vmand.mm v0, v0, v8
73 %0 = tail call <vscale x 32 x i1> asm "vmand.mm $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 32 x i1> %in, <vscale x 32 x i1> %in2)
74 ret <vscale x 32 x i1> %0
77 define <vscale x 64 x i1> @test_64xi1(<vscale x 64 x i1> %in, <vscale x 64 x i1> %in2) nounwind {
78 ; CHECK-LABEL: test_64xi1:
79 ; CHECK: # %bb.0: # %entry
81 ; CHECK-NEXT: vmand.mm v0, v0, v8
85 %0 = tail call <vscale x 64 x i1> asm "vmand.mm $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 64 x i1> %in, <vscale x 64 x i1> %in2)
86 ret <vscale x 64 x i1> %0
89 define <vscale x 1 x i64> @test_1xi64(<vscale x 1 x i64> %in, <vscale x 1 x i64> %in2) nounwind {
90 ; CHECK-LABEL: test_1xi64:
91 ; CHECK: # %bb.0: # %entry
93 ; CHECK-NEXT: vadd.vv v8, v8, v9
97 %0 = tail call <vscale x 1 x i64> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 1 x i64> %in, <vscale x 1 x i64> %in2)
98 ret <vscale x 1 x i64> %0
101 define <vscale x 2 x i64> @test_2xi64(<vscale x 2 x i64> %in, <vscale x 2 x i64> %in2) nounwind {
102 ; CHECK-LABEL: test_2xi64:
103 ; CHECK: # %bb.0: # %entry
105 ; CHECK-NEXT: vadd.vv v8, v8, v10
106 ; CHECK-NEXT: #NO_APP
109 %0 = tail call <vscale x 2 x i64> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 2 x i64> %in, <vscale x 2 x i64> %in2)
110 ret <vscale x 2 x i64> %0
113 define <vscale x 4 x i64> @test_4xi64(<vscale x 4 x i64> %in, <vscale x 4 x i64> %in2) nounwind {
114 ; CHECK-LABEL: test_4xi64:
115 ; CHECK: # %bb.0: # %entry
117 ; CHECK-NEXT: vadd.vv v8, v8, v12
118 ; CHECK-NEXT: #NO_APP
121 %0 = tail call <vscale x 4 x i64> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 4 x i64> %in, <vscale x 4 x i64> %in2)
122 ret <vscale x 4 x i64> %0
125 define <vscale x 8 x i64> @test_8xi64(<vscale x 8 x i64> %in, <vscale x 8 x i64> %in2) nounwind {
126 ; CHECK-LABEL: test_8xi64:
127 ; CHECK: # %bb.0: # %entry
129 ; CHECK-NEXT: vadd.vv v8, v8, v16
130 ; CHECK-NEXT: #NO_APP
133 %0 = tail call <vscale x 8 x i64> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 8 x i64> %in, <vscale x 8 x i64> %in2)
134 ret <vscale x 8 x i64> %0
137 define <vscale x 1 x i32> @test_1xi32(<vscale x 1 x i32> %in, <vscale x 1 x i32> %in2) nounwind {
138 ; CHECK-LABEL: test_1xi32:
139 ; CHECK: # %bb.0: # %entry
141 ; CHECK-NEXT: vadd.vv v8, v8, v9
142 ; CHECK-NEXT: #NO_APP
145 %0 = tail call <vscale x 1 x i32> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 1 x i32> %in, <vscale x 1 x i32> %in2)
146 ret <vscale x 1 x i32> %0
149 define <vscale x 2 x i32> @test_2xi32(<vscale x 2 x i32> %in, <vscale x 2 x i32> %in2) nounwind {
150 ; CHECK-LABEL: test_2xi32:
151 ; CHECK: # %bb.0: # %entry
153 ; CHECK-NEXT: vadd.vv v8, v8, v9
154 ; CHECK-NEXT: #NO_APP
157 %0 = tail call <vscale x 2 x i32> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 2 x i32> %in, <vscale x 2 x i32> %in2)
158 ret <vscale x 2 x i32> %0
161 define <vscale x 4 x i32> @test_4xi32(<vscale x 4 x i32> %in, <vscale x 4 x i32> %in2) nounwind {
162 ; CHECK-LABEL: test_4xi32:
163 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: vadd.vv v8, v8, v10
166 ; CHECK-NEXT: #NO_APP
169 %0 = tail call <vscale x 4 x i32> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 4 x i32> %in, <vscale x 4 x i32> %in2)
170 ret <vscale x 4 x i32> %0
173 define <vscale x 8 x i32> @test_8xi32(<vscale x 8 x i32> %in, <vscale x 8 x i32> %in2) nounwind {
174 ; CHECK-LABEL: test_8xi32:
175 ; CHECK: # %bb.0: # %entry
177 ; CHECK-NEXT: vadd.vv v8, v8, v12
178 ; CHECK-NEXT: #NO_APP
181 %0 = tail call <vscale x 8 x i32> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 8 x i32> %in, <vscale x 8 x i32> %in2)
182 ret <vscale x 8 x i32> %0
185 define <vscale x 16 x i32> @test_16xi32(<vscale x 16 x i32> %in, <vscale x 16 x i32> %in2) nounwind {
186 ; CHECK-LABEL: test_16xi32:
187 ; CHECK: # %bb.0: # %entry
189 ; CHECK-NEXT: vadd.vv v8, v8, v16
190 ; CHECK-NEXT: #NO_APP
193 %0 = tail call <vscale x 16 x i32> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 16 x i32> %in, <vscale x 16 x i32> %in2)
194 ret <vscale x 16 x i32> %0
197 define <vscale x 1 x i16> @test_1xi16(<vscale x 1 x i16> %in, <vscale x 1 x i16> %in2) nounwind {
198 ; CHECK-LABEL: test_1xi16:
199 ; CHECK: # %bb.0: # %entry
201 ; CHECK-NEXT: vadd.vv v8, v8, v9
202 ; CHECK-NEXT: #NO_APP
205 %0 = tail call <vscale x 1 x i16> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 1 x i16> %in, <vscale x 1 x i16> %in2)
206 ret <vscale x 1 x i16> %0
209 define <vscale x 2 x i16> @test_2xi16(<vscale x 2 x i16> %in, <vscale x 2 x i16> %in2) nounwind {
210 ; CHECK-LABEL: test_2xi16:
211 ; CHECK: # %bb.0: # %entry
213 ; CHECK-NEXT: vadd.vv v8, v8, v9
214 ; CHECK-NEXT: #NO_APP
217 %0 = tail call <vscale x 2 x i16> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 2 x i16> %in, <vscale x 2 x i16> %in2)
218 ret <vscale x 2 x i16> %0
221 define <vscale x 4 x i16> @test_4xi16(<vscale x 4 x i16> %in, <vscale x 4 x i16> %in2) nounwind {
222 ; CHECK-LABEL: test_4xi16:
223 ; CHECK: # %bb.0: # %entry
225 ; CHECK-NEXT: vadd.vv v8, v8, v9
226 ; CHECK-NEXT: #NO_APP
229 %0 = tail call <vscale x 4 x i16> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 4 x i16> %in, <vscale x 4 x i16> %in2)
230 ret <vscale x 4 x i16> %0
233 define <vscale x 8 x i16> @test_8xi16(<vscale x 8 x i16> %in, <vscale x 8 x i16> %in2) nounwind {
234 ; CHECK-LABEL: test_8xi16:
235 ; CHECK: # %bb.0: # %entry
237 ; CHECK-NEXT: vadd.vv v8, v8, v10
238 ; CHECK-NEXT: #NO_APP
241 %0 = tail call <vscale x 8 x i16> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 8 x i16> %in, <vscale x 8 x i16> %in2)
242 ret <vscale x 8 x i16> %0
245 define <vscale x 16 x i16> @test_16xi16(<vscale x 16 x i16> %in, <vscale x 16 x i16> %in2) nounwind {
246 ; CHECK-LABEL: test_16xi16:
247 ; CHECK: # %bb.0: # %entry
249 ; CHECK-NEXT: vadd.vv v8, v8, v12
250 ; CHECK-NEXT: #NO_APP
253 %0 = tail call <vscale x 16 x i16> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 16 x i16> %in, <vscale x 16 x i16> %in2)
254 ret <vscale x 16 x i16> %0
257 define <vscale x 32 x i16> @test_32xi16(<vscale x 32 x i16> %in, <vscale x 32 x i16> %in2) nounwind {
258 ; CHECK-LABEL: test_32xi16:
259 ; CHECK: # %bb.0: # %entry
261 ; CHECK-NEXT: vadd.vv v8, v8, v16
262 ; CHECK-NEXT: #NO_APP
265 %0 = tail call <vscale x 32 x i16> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 32 x i16> %in, <vscale x 32 x i16> %in2)
266 ret <vscale x 32 x i16> %0
269 define <vscale x 1 x i8> @test_1xi8(<vscale x 1 x i8> %in, <vscale x 1 x i8> %in2) nounwind {
270 ; CHECK-LABEL: test_1xi8:
271 ; CHECK: # %bb.0: # %entry
273 ; CHECK-NEXT: vadd.vv v8, v8, v9
274 ; CHECK-NEXT: #NO_APP
277 %0 = tail call <vscale x 1 x i8> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 1 x i8> %in, <vscale x 1 x i8> %in2)
278 ret <vscale x 1 x i8> %0
281 define <vscale x 2 x i8> @test_2xi8(<vscale x 2 x i8> %in, <vscale x 2 x i8> %in2) nounwind {
282 ; CHECK-LABEL: test_2xi8:
283 ; CHECK: # %bb.0: # %entry
285 ; CHECK-NEXT: vadd.vv v8, v8, v9
286 ; CHECK-NEXT: #NO_APP
289 %0 = tail call <vscale x 2 x i8> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 2 x i8> %in, <vscale x 2 x i8> %in2)
290 ret <vscale x 2 x i8> %0
293 define <vscale x 4 x i8> @test_4xi8(<vscale x 4 x i8> %in, <vscale x 4 x i8> %in2) nounwind {
294 ; CHECK-LABEL: test_4xi8:
295 ; CHECK: # %bb.0: # %entry
297 ; CHECK-NEXT: vadd.vv v8, v8, v9
298 ; CHECK-NEXT: #NO_APP
301 %0 = tail call <vscale x 4 x i8> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 4 x i8> %in, <vscale x 4 x i8> %in2)
302 ret <vscale x 4 x i8> %0
305 define <vscale x 8 x i8> @test_8xi8(<vscale x 8 x i8> %in, <vscale x 8 x i8> %in2) nounwind {
306 ; CHECK-LABEL: test_8xi8:
307 ; CHECK: # %bb.0: # %entry
309 ; CHECK-NEXT: vadd.vv v8, v8, v9
310 ; CHECK-NEXT: #NO_APP
313 %0 = tail call <vscale x 8 x i8> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 8 x i8> %in, <vscale x 8 x i8> %in2)
314 ret <vscale x 8 x i8> %0
317 define <vscale x 16 x i8> @test_16xi8(<vscale x 16 x i8> %in, <vscale x 16 x i8> %in2) nounwind {
318 ; CHECK-LABEL: test_16xi8:
319 ; CHECK: # %bb.0: # %entry
321 ; CHECK-NEXT: vadd.vv v8, v8, v10
322 ; CHECK-NEXT: #NO_APP
325 %0 = tail call <vscale x 16 x i8> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 16 x i8> %in, <vscale x 16 x i8> %in2)
326 ret <vscale x 16 x i8> %0
329 define <vscale x 32 x i8> @test_32xi8(<vscale x 32 x i8> %in, <vscale x 32 x i8> %in2) nounwind {
330 ; CHECK-LABEL: test_32xi8:
331 ; CHECK: # %bb.0: # %entry
333 ; CHECK-NEXT: vadd.vv v8, v8, v12
334 ; CHECK-NEXT: #NO_APP
337 %0 = tail call <vscale x 32 x i8> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 32 x i8> %in, <vscale x 32 x i8> %in2)
338 ret <vscale x 32 x i8> %0
341 define <vscale x 64 x i8> @test_64xi8(<vscale x 64 x i8> %in, <vscale x 64 x i8> %in2) nounwind {
342 ; CHECK-LABEL: test_64xi8:
343 ; CHECK: # %bb.0: # %entry
345 ; CHECK-NEXT: vadd.vv v8, v8, v16
346 ; CHECK-NEXT: #NO_APP
349 %0 = tail call <vscale x 64 x i8> asm "vadd.vv $0, $1, $2", "=^vr,^vr,^vr"(<vscale x 64 x i8> %in, <vscale x 64 x i8> %in2)
350 ret <vscale x 64 x i8> %0
353 define <vscale x 64 x i8> @test_64xi8_with_mask(<vscale x 64 x i8> %in, <vscale x 64 x i8> %in2, <vscale x 64 x i1> %mask) nounwind {
354 ; CHECK-LABEL: test_64xi8_with_mask:
355 ; CHECK: # %bb.0: # %entry
357 ; CHECK-NEXT: vadd.vv v8, v8, v16, v0.t
358 ; CHECK-NEXT: #NO_APP
361 %0 = tail call <vscale x 64 x i8> asm "vadd.vv $0, $1, $2, $3.t", "=^vr,^vr,^vr,^vm"(<vscale x 64 x i8> %in, <vscale x 64 x i8> %in2, <vscale x 64 x i1> %mask)
362 ret <vscale x 64 x i8> %0
365 define <vscale x 4 x i8> @test_specify_reg_mf2(<vscale x 4 x i8> %in, <vscale x 4 x i8> %in2) nounwind {
366 ; CHECK-LABEL: test_specify_reg_mf2:
367 ; CHECK: # %bb.0: # %entry
368 ; CHECK-NEXT: vmv1r.v v2, v9
369 ; CHECK-NEXT: vmv1r.v v1, v8
371 ; CHECK-NEXT: vadd.vv v0, v1, v2
372 ; CHECK-NEXT: #NO_APP
373 ; CHECK-NEXT: vmv1r.v v8, v0
376 %0 = tail call <vscale x 4 x i8> asm "vadd.vv $0, $1, $2", "={v0},{v1},{v2}"(<vscale x 4 x i8> %in, <vscale x 4 x i8> %in2)
377 ret <vscale x 4 x i8> %0
380 define <vscale x 8 x i8> @test_specify_reg_m1(<vscale x 8 x i8> %in, <vscale x 8 x i8> %in2) nounwind {
381 ; CHECK-LABEL: test_specify_reg_m1:
382 ; CHECK: # %bb.0: # %entry
383 ; CHECK-NEXT: vmv1r.v v2, v9
384 ; CHECK-NEXT: vmv1r.v v1, v8
386 ; CHECK-NEXT: vadd.vv v0, v1, v2
387 ; CHECK-NEXT: #NO_APP
388 ; CHECK-NEXT: vmv1r.v v8, v0
391 %0 = tail call <vscale x 8 x i8> asm "vadd.vv $0, $1, $2", "={v0},{v1},{v2}"(<vscale x 8 x i8> %in, <vscale x 8 x i8> %in2)
392 ret <vscale x 8 x i8> %0
395 define <vscale x 16 x i8> @test_specify_reg_m2(<vscale x 16 x i8> %in, <vscale x 16 x i8> %in2) nounwind {
396 ; CHECK-LABEL: test_specify_reg_m2:
397 ; CHECK: # %bb.0: # %entry
398 ; CHECK-NEXT: vmv2r.v v4, v10
399 ; CHECK-NEXT: vmv2r.v v2, v8
401 ; CHECK-NEXT: vadd.vv v0, v2, v4
402 ; CHECK-NEXT: #NO_APP
403 ; CHECK-NEXT: vmv2r.v v8, v0
406 %0 = tail call <vscale x 16 x i8> asm "vadd.vv $0, $1, $2", "={v0},{v2},{v4}"(<vscale x 16 x i8> %in, <vscale x 16 x i8> %in2)
407 ret <vscale x 16 x i8> %0
410 define <vscale x 1 x i1> @test_specify_reg_mask(<vscale x 1 x i1> %in, <vscale x 1 x i1> %in2) nounwind {
411 ; CHECK-LABEL: test_specify_reg_mask:
412 ; CHECK: # %bb.0: # %entry
413 ; CHECK-NEXT: vmv1r.v v2, v8
414 ; CHECK-NEXT: vmv1r.v v1, v0
416 ; CHECK-NEXT: vmand.mm v0, v1, v2
417 ; CHECK-NEXT: #NO_APP
420 %0 = tail call <vscale x 1 x i1> asm "vmand.mm $0, $1, $2", "={v0},{v1},{v2}"(<vscale x 1 x i1> %in, <vscale x 1 x i1> %in2)
421 ret <vscale x 1 x i1> %0