1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
4 define <vscale x 1 x i8> @sext_nxv1i1_nxv1i8(<vscale x 1 x i1> %v) {
5 ; CHECK-LABEL: sext_nxv1i1_nxv1i8:
7 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
8 ; CHECK-NEXT: vmv.v.i v8, 0
9 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
11 %r = sext <vscale x 1 x i1> %v to <vscale x 1 x i8>
12 ret <vscale x 1 x i8> %r
15 define <vscale x 1 x i8> @zext_nxv1i1_nxv1i8(<vscale x 1 x i1> %v) {
16 ; CHECK-LABEL: zext_nxv1i1_nxv1i8:
18 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
19 ; CHECK-NEXT: vmv.v.i v8, 0
20 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
22 %r = zext <vscale x 1 x i1> %v to <vscale x 1 x i8>
23 ret <vscale x 1 x i8> %r
26 define <vscale x 1 x i1> @trunc_nxv1i8_nxv1i1(<vscale x 1 x i8> %v) {
27 ; CHECK-LABEL: trunc_nxv1i8_nxv1i1:
29 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
30 ; CHECK-NEXT: vand.vi v8, v8, 1
31 ; CHECK-NEXT: vmsne.vi v0, v8, 0
33 %r = trunc <vscale x 1 x i8> %v to <vscale x 1 x i1>
34 ret <vscale x 1 x i1> %r
37 define <vscale x 2 x i8> @sext_nxv2i1_nxv2i8(<vscale x 2 x i1> %v) {
38 ; CHECK-LABEL: sext_nxv2i1_nxv2i8:
40 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
41 ; CHECK-NEXT: vmv.v.i v8, 0
42 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
44 %r = sext <vscale x 2 x i1> %v to <vscale x 2 x i8>
45 ret <vscale x 2 x i8> %r
48 define <vscale x 2 x i8> @zext_nxv2i1_nxv2i8(<vscale x 2 x i1> %v) {
49 ; CHECK-LABEL: zext_nxv2i1_nxv2i8:
51 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
52 ; CHECK-NEXT: vmv.v.i v8, 0
53 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
55 %r = zext <vscale x 2 x i1> %v to <vscale x 2 x i8>
56 ret <vscale x 2 x i8> %r
59 define <vscale x 2 x i1> @trunc_nxv2i8_nxv2i1(<vscale x 2 x i8> %v) {
60 ; CHECK-LABEL: trunc_nxv2i8_nxv2i1:
62 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
63 ; CHECK-NEXT: vand.vi v8, v8, 1
64 ; CHECK-NEXT: vmsne.vi v0, v8, 0
66 %r = trunc <vscale x 2 x i8> %v to <vscale x 2 x i1>
67 ret <vscale x 2 x i1> %r
70 define <vscale x 4 x i8> @sext_nxv4i1_nxv4i8(<vscale x 4 x i1> %v) {
71 ; CHECK-LABEL: sext_nxv4i1_nxv4i8:
73 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
74 ; CHECK-NEXT: vmv.v.i v8, 0
75 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
77 %r = sext <vscale x 4 x i1> %v to <vscale x 4 x i8>
78 ret <vscale x 4 x i8> %r
81 define <vscale x 4 x i8> @zext_nxv4i1_nxv4i8(<vscale x 4 x i1> %v) {
82 ; CHECK-LABEL: zext_nxv4i1_nxv4i8:
84 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
85 ; CHECK-NEXT: vmv.v.i v8, 0
86 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
88 %r = zext <vscale x 4 x i1> %v to <vscale x 4 x i8>
89 ret <vscale x 4 x i8> %r
92 define <vscale x 4 x i1> @trunc_nxv4i8_nxv4i1(<vscale x 4 x i8> %v) {
93 ; CHECK-LABEL: trunc_nxv4i8_nxv4i1:
95 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
96 ; CHECK-NEXT: vand.vi v8, v8, 1
97 ; CHECK-NEXT: vmsne.vi v0, v8, 0
99 %r = trunc <vscale x 4 x i8> %v to <vscale x 4 x i1>
100 ret <vscale x 4 x i1> %r
103 define <vscale x 8 x i8> @sext_nxv8i1_nxv8i8(<vscale x 8 x i1> %v) {
104 ; CHECK-LABEL: sext_nxv8i1_nxv8i8:
106 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
107 ; CHECK-NEXT: vmv.v.i v8, 0
108 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
110 %r = sext <vscale x 8 x i1> %v to <vscale x 8 x i8>
111 ret <vscale x 8 x i8> %r
114 define <vscale x 8 x i8> @zext_nxv8i1_nxv8i8(<vscale x 8 x i1> %v) {
115 ; CHECK-LABEL: zext_nxv8i1_nxv8i8:
117 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
118 ; CHECK-NEXT: vmv.v.i v8, 0
119 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
121 %r = zext <vscale x 8 x i1> %v to <vscale x 8 x i8>
122 ret <vscale x 8 x i8> %r
125 define <vscale x 8 x i1> @trunc_nxv8i8_nxv8i1(<vscale x 8 x i8> %v) {
126 ; CHECK-LABEL: trunc_nxv8i8_nxv8i1:
128 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
129 ; CHECK-NEXT: vand.vi v8, v8, 1
130 ; CHECK-NEXT: vmsne.vi v0, v8, 0
132 %r = trunc <vscale x 8 x i8> %v to <vscale x 8 x i1>
133 ret <vscale x 8 x i1> %r
136 define <vscale x 16 x i8> @sext_nxv16i1_nxv16i8(<vscale x 16 x i1> %v) {
137 ; CHECK-LABEL: sext_nxv16i1_nxv16i8:
139 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
140 ; CHECK-NEXT: vmv.v.i v8, 0
141 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
143 %r = sext <vscale x 16 x i1> %v to <vscale x 16 x i8>
144 ret <vscale x 16 x i8> %r
147 define <vscale x 16 x i8> @zext_nxv16i1_nxv16i8(<vscale x 16 x i1> %v) {
148 ; CHECK-LABEL: zext_nxv16i1_nxv16i8:
150 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
151 ; CHECK-NEXT: vmv.v.i v8, 0
152 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
154 %r = zext <vscale x 16 x i1> %v to <vscale x 16 x i8>
155 ret <vscale x 16 x i8> %r
158 define <vscale x 16 x i1> @trunc_nxv16i8_nxv16i1(<vscale x 16 x i8> %v) {
159 ; CHECK-LABEL: trunc_nxv16i8_nxv16i1:
161 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
162 ; CHECK-NEXT: vand.vi v8, v8, 1
163 ; CHECK-NEXT: vmsne.vi v0, v8, 0
165 %r = trunc <vscale x 16 x i8> %v to <vscale x 16 x i1>
166 ret <vscale x 16 x i1> %r
169 define <vscale x 32 x i8> @sext_nxv32i1_nxv32i8(<vscale x 32 x i1> %v) {
170 ; CHECK-LABEL: sext_nxv32i1_nxv32i8:
172 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
173 ; CHECK-NEXT: vmv.v.i v8, 0
174 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
176 %r = sext <vscale x 32 x i1> %v to <vscale x 32 x i8>
177 ret <vscale x 32 x i8> %r
180 define <vscale x 32 x i8> @zext_nxv32i1_nxv32i8(<vscale x 32 x i1> %v) {
181 ; CHECK-LABEL: zext_nxv32i1_nxv32i8:
183 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
184 ; CHECK-NEXT: vmv.v.i v8, 0
185 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
187 %r = zext <vscale x 32 x i1> %v to <vscale x 32 x i8>
188 ret <vscale x 32 x i8> %r
191 define <vscale x 32 x i1> @trunc_nxv32i8_nxv32i1(<vscale x 32 x i8> %v) {
192 ; CHECK-LABEL: trunc_nxv32i8_nxv32i1:
194 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
195 ; CHECK-NEXT: vand.vi v8, v8, 1
196 ; CHECK-NEXT: vmsne.vi v0, v8, 0
198 %r = trunc <vscale x 32 x i8> %v to <vscale x 32 x i1>
199 ret <vscale x 32 x i1> %r
202 define <vscale x 64 x i8> @sext_nxv64i1_nxv64i8(<vscale x 64 x i1> %v) {
203 ; CHECK-LABEL: sext_nxv64i1_nxv64i8:
205 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
206 ; CHECK-NEXT: vmv.v.i v8, 0
207 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
209 %r = sext <vscale x 64 x i1> %v to <vscale x 64 x i8>
210 ret <vscale x 64 x i8> %r
213 define <vscale x 64 x i8> @zext_nxv64i1_nxv64i8(<vscale x 64 x i1> %v) {
214 ; CHECK-LABEL: zext_nxv64i1_nxv64i8:
216 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
217 ; CHECK-NEXT: vmv.v.i v8, 0
218 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
220 %r = zext <vscale x 64 x i1> %v to <vscale x 64 x i8>
221 ret <vscale x 64 x i8> %r
224 define <vscale x 64 x i1> @trunc_nxv64i8_nxv64i1(<vscale x 64 x i8> %v) {
225 ; CHECK-LABEL: trunc_nxv64i8_nxv64i1:
227 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
228 ; CHECK-NEXT: vand.vi v8, v8, 1
229 ; CHECK-NEXT: vmsne.vi v0, v8, 0
231 %r = trunc <vscale x 64 x i8> %v to <vscale x 64 x i1>
232 ret <vscale x 64 x i1> %r
235 define <vscale x 1 x i16> @sext_nxv1i1_nxv1i16(<vscale x 1 x i1> %v) {
236 ; CHECK-LABEL: sext_nxv1i1_nxv1i16:
238 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
239 ; CHECK-NEXT: vmv.v.i v8, 0
240 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
242 %r = sext <vscale x 1 x i1> %v to <vscale x 1 x i16>
243 ret <vscale x 1 x i16> %r
246 define <vscale x 1 x i16> @zext_nxv1i1_nxv1i16(<vscale x 1 x i1> %v) {
247 ; CHECK-LABEL: zext_nxv1i1_nxv1i16:
249 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
250 ; CHECK-NEXT: vmv.v.i v8, 0
251 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
253 %r = zext <vscale x 1 x i1> %v to <vscale x 1 x i16>
254 ret <vscale x 1 x i16> %r
257 define <vscale x 1 x i1> @trunc_nxv1i16_nxv1i1(<vscale x 1 x i16> %v) {
258 ; CHECK-LABEL: trunc_nxv1i16_nxv1i1:
260 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
261 ; CHECK-NEXT: vand.vi v8, v8, 1
262 ; CHECK-NEXT: vmsne.vi v0, v8, 0
264 %r = trunc <vscale x 1 x i16> %v to <vscale x 1 x i1>
265 ret <vscale x 1 x i1> %r
268 define <vscale x 2 x i16> @sext_nxv2i1_nxv2i16(<vscale x 2 x i1> %v) {
269 ; CHECK-LABEL: sext_nxv2i1_nxv2i16:
271 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
272 ; CHECK-NEXT: vmv.v.i v8, 0
273 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
275 %r = sext <vscale x 2 x i1> %v to <vscale x 2 x i16>
276 ret <vscale x 2 x i16> %r
279 define <vscale x 2 x i16> @zext_nxv2i1_nxv2i16(<vscale x 2 x i1> %v) {
280 ; CHECK-LABEL: zext_nxv2i1_nxv2i16:
282 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
283 ; CHECK-NEXT: vmv.v.i v8, 0
284 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
286 %r = zext <vscale x 2 x i1> %v to <vscale x 2 x i16>
287 ret <vscale x 2 x i16> %r
290 define <vscale x 2 x i1> @trunc_nxv2i16_nxv2i1(<vscale x 2 x i16> %v) {
291 ; CHECK-LABEL: trunc_nxv2i16_nxv2i1:
293 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
294 ; CHECK-NEXT: vand.vi v8, v8, 1
295 ; CHECK-NEXT: vmsne.vi v0, v8, 0
297 %r = trunc <vscale x 2 x i16> %v to <vscale x 2 x i1>
298 ret <vscale x 2 x i1> %r
301 define <vscale x 4 x i16> @sext_nxv4i1_nxv4i16(<vscale x 4 x i1> %v) {
302 ; CHECK-LABEL: sext_nxv4i1_nxv4i16:
304 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
305 ; CHECK-NEXT: vmv.v.i v8, 0
306 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
308 %r = sext <vscale x 4 x i1> %v to <vscale x 4 x i16>
309 ret <vscale x 4 x i16> %r
312 define <vscale x 4 x i16> @zext_nxv4i1_nxv4i16(<vscale x 4 x i1> %v) {
313 ; CHECK-LABEL: zext_nxv4i1_nxv4i16:
315 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
316 ; CHECK-NEXT: vmv.v.i v8, 0
317 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
319 %r = zext <vscale x 4 x i1> %v to <vscale x 4 x i16>
320 ret <vscale x 4 x i16> %r
323 define <vscale x 4 x i1> @trunc_nxv4i16_nxv4i1(<vscale x 4 x i16> %v) {
324 ; CHECK-LABEL: trunc_nxv4i16_nxv4i1:
326 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
327 ; CHECK-NEXT: vand.vi v8, v8, 1
328 ; CHECK-NEXT: vmsne.vi v0, v8, 0
330 %r = trunc <vscale x 4 x i16> %v to <vscale x 4 x i1>
331 ret <vscale x 4 x i1> %r
334 define <vscale x 8 x i16> @sext_nxv8i1_nxv8i16(<vscale x 8 x i1> %v) {
335 ; CHECK-LABEL: sext_nxv8i1_nxv8i16:
337 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
338 ; CHECK-NEXT: vmv.v.i v8, 0
339 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
341 %r = sext <vscale x 8 x i1> %v to <vscale x 8 x i16>
342 ret <vscale x 8 x i16> %r
345 define <vscale x 8 x i16> @zext_nxv8i1_nxv8i16(<vscale x 8 x i1> %v) {
346 ; CHECK-LABEL: zext_nxv8i1_nxv8i16:
348 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
349 ; CHECK-NEXT: vmv.v.i v8, 0
350 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
352 %r = zext <vscale x 8 x i1> %v to <vscale x 8 x i16>
353 ret <vscale x 8 x i16> %r
356 define <vscale x 8 x i1> @trunc_nxv8i16_nxv8i1(<vscale x 8 x i16> %v) {
357 ; CHECK-LABEL: trunc_nxv8i16_nxv8i1:
359 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
360 ; CHECK-NEXT: vand.vi v8, v8, 1
361 ; CHECK-NEXT: vmsne.vi v0, v8, 0
363 %r = trunc <vscale x 8 x i16> %v to <vscale x 8 x i1>
364 ret <vscale x 8 x i1> %r
367 define <vscale x 16 x i16> @sext_nxv16i1_nxv16i16(<vscale x 16 x i1> %v) {
368 ; CHECK-LABEL: sext_nxv16i1_nxv16i16:
370 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
371 ; CHECK-NEXT: vmv.v.i v8, 0
372 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
374 %r = sext <vscale x 16 x i1> %v to <vscale x 16 x i16>
375 ret <vscale x 16 x i16> %r
378 define <vscale x 16 x i16> @zext_nxv16i1_nxv16i16(<vscale x 16 x i1> %v) {
379 ; CHECK-LABEL: zext_nxv16i1_nxv16i16:
381 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
382 ; CHECK-NEXT: vmv.v.i v8, 0
383 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
385 %r = zext <vscale x 16 x i1> %v to <vscale x 16 x i16>
386 ret <vscale x 16 x i16> %r
389 define <vscale x 16 x i1> @trunc_nxv16i16_nxv16i1(<vscale x 16 x i16> %v) {
390 ; CHECK-LABEL: trunc_nxv16i16_nxv16i1:
392 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
393 ; CHECK-NEXT: vand.vi v8, v8, 1
394 ; CHECK-NEXT: vmsne.vi v0, v8, 0
396 %r = trunc <vscale x 16 x i16> %v to <vscale x 16 x i1>
397 ret <vscale x 16 x i1> %r
400 define <vscale x 32 x i16> @sext_nxv32i1_nxv32i16(<vscale x 32 x i1> %v) {
401 ; CHECK-LABEL: sext_nxv32i1_nxv32i16:
403 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
404 ; CHECK-NEXT: vmv.v.i v8, 0
405 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
407 %r = sext <vscale x 32 x i1> %v to <vscale x 32 x i16>
408 ret <vscale x 32 x i16> %r
411 define <vscale x 32 x i16> @zext_nxv32i1_nxv32i16(<vscale x 32 x i1> %v) {
412 ; CHECK-LABEL: zext_nxv32i1_nxv32i16:
414 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
415 ; CHECK-NEXT: vmv.v.i v8, 0
416 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
418 %r = zext <vscale x 32 x i1> %v to <vscale x 32 x i16>
419 ret <vscale x 32 x i16> %r
422 define <vscale x 32 x i1> @trunc_nxv32i16_nxv32i1(<vscale x 32 x i16> %v) {
423 ; CHECK-LABEL: trunc_nxv32i16_nxv32i1:
425 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
426 ; CHECK-NEXT: vand.vi v8, v8, 1
427 ; CHECK-NEXT: vmsne.vi v0, v8, 0
429 %r = trunc <vscale x 32 x i16> %v to <vscale x 32 x i1>
430 ret <vscale x 32 x i1> %r
433 define <vscale x 1 x i32> @sext_nxv1i1_nxv1i32(<vscale x 1 x i1> %v) {
434 ; CHECK-LABEL: sext_nxv1i1_nxv1i32:
436 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
437 ; CHECK-NEXT: vmv.v.i v8, 0
438 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
440 %r = sext <vscale x 1 x i1> %v to <vscale x 1 x i32>
441 ret <vscale x 1 x i32> %r
444 define <vscale x 1 x i32> @zext_nxv1i1_nxv1i32(<vscale x 1 x i1> %v) {
445 ; CHECK-LABEL: zext_nxv1i1_nxv1i32:
447 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
448 ; CHECK-NEXT: vmv.v.i v8, 0
449 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
451 %r = zext <vscale x 1 x i1> %v to <vscale x 1 x i32>
452 ret <vscale x 1 x i32> %r
455 define <vscale x 1 x i1> @trunc_nxv1i32_nxv1i1(<vscale x 1 x i32> %v) {
456 ; CHECK-LABEL: trunc_nxv1i32_nxv1i1:
458 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
459 ; CHECK-NEXT: vand.vi v8, v8, 1
460 ; CHECK-NEXT: vmsne.vi v0, v8, 0
462 %r = trunc <vscale x 1 x i32> %v to <vscale x 1 x i1>
463 ret <vscale x 1 x i1> %r
466 define <vscale x 2 x i32> @sext_nxv2i1_nxv2i32(<vscale x 2 x i1> %v) {
467 ; CHECK-LABEL: sext_nxv2i1_nxv2i32:
469 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
470 ; CHECK-NEXT: vmv.v.i v8, 0
471 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
473 %r = sext <vscale x 2 x i1> %v to <vscale x 2 x i32>
474 ret <vscale x 2 x i32> %r
477 define <vscale x 2 x i32> @zext_nxv2i1_nxv2i32(<vscale x 2 x i1> %v) {
478 ; CHECK-LABEL: zext_nxv2i1_nxv2i32:
480 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
481 ; CHECK-NEXT: vmv.v.i v8, 0
482 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
484 %r = zext <vscale x 2 x i1> %v to <vscale x 2 x i32>
485 ret <vscale x 2 x i32> %r
488 define <vscale x 2 x i1> @trunc_nxv2i32_nxv2i1(<vscale x 2 x i32> %v) {
489 ; CHECK-LABEL: trunc_nxv2i32_nxv2i1:
491 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
492 ; CHECK-NEXT: vand.vi v8, v8, 1
493 ; CHECK-NEXT: vmsne.vi v0, v8, 0
495 %r = trunc <vscale x 2 x i32> %v to <vscale x 2 x i1>
496 ret <vscale x 2 x i1> %r
499 define <vscale x 4 x i32> @sext_nxv4i1_nxv4i32(<vscale x 4 x i1> %v) {
500 ; CHECK-LABEL: sext_nxv4i1_nxv4i32:
502 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
503 ; CHECK-NEXT: vmv.v.i v8, 0
504 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
506 %r = sext <vscale x 4 x i1> %v to <vscale x 4 x i32>
507 ret <vscale x 4 x i32> %r
510 define <vscale x 4 x i32> @zext_nxv4i1_nxv4i32(<vscale x 4 x i1> %v) {
511 ; CHECK-LABEL: zext_nxv4i1_nxv4i32:
513 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
514 ; CHECK-NEXT: vmv.v.i v8, 0
515 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
517 %r = zext <vscale x 4 x i1> %v to <vscale x 4 x i32>
518 ret <vscale x 4 x i32> %r
521 define <vscale x 4 x i1> @trunc_nxv4i32_nxv4i1(<vscale x 4 x i32> %v) {
522 ; CHECK-LABEL: trunc_nxv4i32_nxv4i1:
524 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
525 ; CHECK-NEXT: vand.vi v8, v8, 1
526 ; CHECK-NEXT: vmsne.vi v0, v8, 0
528 %r = trunc <vscale x 4 x i32> %v to <vscale x 4 x i1>
529 ret <vscale x 4 x i1> %r
532 define <vscale x 8 x i32> @sext_nxv8i1_nxv8i32(<vscale x 8 x i1> %v) {
533 ; CHECK-LABEL: sext_nxv8i1_nxv8i32:
535 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
536 ; CHECK-NEXT: vmv.v.i v8, 0
537 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
539 %r = sext <vscale x 8 x i1> %v to <vscale x 8 x i32>
540 ret <vscale x 8 x i32> %r
543 define <vscale x 8 x i32> @zext_nxv8i1_nxv8i32(<vscale x 8 x i1> %v) {
544 ; CHECK-LABEL: zext_nxv8i1_nxv8i32:
546 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
547 ; CHECK-NEXT: vmv.v.i v8, 0
548 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
550 %r = zext <vscale x 8 x i1> %v to <vscale x 8 x i32>
551 ret <vscale x 8 x i32> %r
554 define <vscale x 8 x i1> @trunc_nxv8i32_nxv8i1(<vscale x 8 x i32> %v) {
555 ; CHECK-LABEL: trunc_nxv8i32_nxv8i1:
557 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
558 ; CHECK-NEXT: vand.vi v8, v8, 1
559 ; CHECK-NEXT: vmsne.vi v0, v8, 0
561 %r = trunc <vscale x 8 x i32> %v to <vscale x 8 x i1>
562 ret <vscale x 8 x i1> %r
565 define <vscale x 16 x i32> @sext_nxv16i1_nxv16i32(<vscale x 16 x i1> %v) {
566 ; CHECK-LABEL: sext_nxv16i1_nxv16i32:
568 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
569 ; CHECK-NEXT: vmv.v.i v8, 0
570 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
572 %r = sext <vscale x 16 x i1> %v to <vscale x 16 x i32>
573 ret <vscale x 16 x i32> %r
576 define <vscale x 16 x i32> @zext_nxv16i1_nxv16i32(<vscale x 16 x i1> %v) {
577 ; CHECK-LABEL: zext_nxv16i1_nxv16i32:
579 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
580 ; CHECK-NEXT: vmv.v.i v8, 0
581 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
583 %r = zext <vscale x 16 x i1> %v to <vscale x 16 x i32>
584 ret <vscale x 16 x i32> %r
587 define <vscale x 16 x i1> @trunc_nxv16i32_nxv16i1(<vscale x 16 x i32> %v) {
588 ; CHECK-LABEL: trunc_nxv16i32_nxv16i1:
590 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
591 ; CHECK-NEXT: vand.vi v8, v8, 1
592 ; CHECK-NEXT: vmsne.vi v0, v8, 0
594 %r = trunc <vscale x 16 x i32> %v to <vscale x 16 x i1>
595 ret <vscale x 16 x i1> %r
598 define <vscale x 1 x i64> @sext_nxv1i1_nxv1i64(<vscale x 1 x i1> %v) {
599 ; CHECK-LABEL: sext_nxv1i1_nxv1i64:
601 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
602 ; CHECK-NEXT: vmv.v.i v8, 0
603 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
605 %r = sext <vscale x 1 x i1> %v to <vscale x 1 x i64>
606 ret <vscale x 1 x i64> %r
609 define <vscale x 1 x i64> @zext_nxv1i1_nxv1i64(<vscale x 1 x i1> %v) {
610 ; CHECK-LABEL: zext_nxv1i1_nxv1i64:
612 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
613 ; CHECK-NEXT: vmv.v.i v8, 0
614 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
616 %r = zext <vscale x 1 x i1> %v to <vscale x 1 x i64>
617 ret <vscale x 1 x i64> %r
620 define <vscale x 1 x i1> @trunc_nxv1i64_nxv1i1(<vscale x 1 x i64> %v) {
621 ; CHECK-LABEL: trunc_nxv1i64_nxv1i1:
623 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
624 ; CHECK-NEXT: vand.vi v8, v8, 1
625 ; CHECK-NEXT: vmsne.vi v0, v8, 0
627 %r = trunc <vscale x 1 x i64> %v to <vscale x 1 x i1>
628 ret <vscale x 1 x i1> %r
631 define <vscale x 2 x i64> @sext_nxv2i1_nxv2i64(<vscale x 2 x i1> %v) {
632 ; CHECK-LABEL: sext_nxv2i1_nxv2i64:
634 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
635 ; CHECK-NEXT: vmv.v.i v8, 0
636 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
638 %r = sext <vscale x 2 x i1> %v to <vscale x 2 x i64>
639 ret <vscale x 2 x i64> %r
642 define <vscale x 2 x i64> @zext_nxv2i1_nxv2i64(<vscale x 2 x i1> %v) {
643 ; CHECK-LABEL: zext_nxv2i1_nxv2i64:
645 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
646 ; CHECK-NEXT: vmv.v.i v8, 0
647 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
649 %r = zext <vscale x 2 x i1> %v to <vscale x 2 x i64>
650 ret <vscale x 2 x i64> %r
653 define <vscale x 2 x i1> @trunc_nxv2i64_nxv2i1(<vscale x 2 x i64> %v) {
654 ; CHECK-LABEL: trunc_nxv2i64_nxv2i1:
656 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
657 ; CHECK-NEXT: vand.vi v8, v8, 1
658 ; CHECK-NEXT: vmsne.vi v0, v8, 0
660 %r = trunc <vscale x 2 x i64> %v to <vscale x 2 x i1>
661 ret <vscale x 2 x i1> %r
664 define <vscale x 4 x i64> @sext_nxv4i1_nxv4i64(<vscale x 4 x i1> %v) {
665 ; CHECK-LABEL: sext_nxv4i1_nxv4i64:
667 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
668 ; CHECK-NEXT: vmv.v.i v8, 0
669 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
671 %r = sext <vscale x 4 x i1> %v to <vscale x 4 x i64>
672 ret <vscale x 4 x i64> %r
675 define <vscale x 4 x i64> @zext_nxv4i1_nxv4i64(<vscale x 4 x i1> %v) {
676 ; CHECK-LABEL: zext_nxv4i1_nxv4i64:
678 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
679 ; CHECK-NEXT: vmv.v.i v8, 0
680 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
682 %r = zext <vscale x 4 x i1> %v to <vscale x 4 x i64>
683 ret <vscale x 4 x i64> %r
686 define <vscale x 4 x i1> @trunc_nxv4i64_nxv4i1(<vscale x 4 x i64> %v) {
687 ; CHECK-LABEL: trunc_nxv4i64_nxv4i1:
689 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
690 ; CHECK-NEXT: vand.vi v8, v8, 1
691 ; CHECK-NEXT: vmsne.vi v0, v8, 0
693 %r = trunc <vscale x 4 x i64> %v to <vscale x 4 x i1>
694 ret <vscale x 4 x i1> %r
697 define <vscale x 8 x i64> @sext_nxv8i1_nxv8i64(<vscale x 8 x i1> %v) {
698 ; CHECK-LABEL: sext_nxv8i1_nxv8i64:
700 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
701 ; CHECK-NEXT: vmv.v.i v8, 0
702 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
704 %r = sext <vscale x 8 x i1> %v to <vscale x 8 x i64>
705 ret <vscale x 8 x i64> %r
708 define <vscale x 8 x i64> @zext_nxv8i1_nxv8i64(<vscale x 8 x i1> %v) {
709 ; CHECK-LABEL: zext_nxv8i1_nxv8i64:
711 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
712 ; CHECK-NEXT: vmv.v.i v8, 0
713 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
715 %r = zext <vscale x 8 x i1> %v to <vscale x 8 x i64>
716 ret <vscale x 8 x i64> %r
719 define <vscale x 8 x i1> @trunc_nxv8i64_nxv8i1(<vscale x 8 x i64> %v) {
720 ; CHECK-LABEL: trunc_nxv8i64_nxv8i1:
722 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
723 ; CHECK-NEXT: vand.vi v8, v8, 1
724 ; CHECK-NEXT: vmsne.vi v0, v8, 0
726 %r = trunc <vscale x 8 x i64> %v to <vscale x 8 x i1>
727 ret <vscale x 8 x i1> %r