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 --check-prefixes=CHECK,RV32
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64NOM
5 ; RUN: llc -mtriple=riscv32 -mattr=+v,+m -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32
6 ; RUN: llc -mtriple=riscv64 -mattr=+v,+m -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64M
8 define <vscale x 1 x i8> @vmul_vv_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb) {
9 ; CHECK-LABEL: vmul_vv_nxv1i8:
11 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
12 ; CHECK-NEXT: vmul.vv v8, v8, v9
14 %vc = mul <vscale x 1 x i8> %va, %vb
15 ret <vscale x 1 x i8> %vc
18 define <vscale x 1 x i8> @vmul_vx_nxv1i8(<vscale x 1 x i8> %va, i8 signext %b) {
19 ; CHECK-LABEL: vmul_vx_nxv1i8:
21 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
22 ; CHECK-NEXT: vmul.vx v8, v8, a0
24 %head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
25 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
26 %vc = mul <vscale x 1 x i8> %va, %splat
27 ret <vscale x 1 x i8> %vc
30 define <vscale x 1 x i8> @vmul_vi_nxv1i8_0(<vscale x 1 x i8> %va) {
31 ; CHECK-LABEL: vmul_vi_nxv1i8_0:
33 ; CHECK-NEXT: li a0, -7
34 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
35 ; CHECK-NEXT: vmul.vx v8, v8, a0
37 %head = insertelement <vscale x 1 x i8> poison, i8 -7, i32 0
38 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
39 %vc = mul <vscale x 1 x i8> %va, %splat
40 ret <vscale x 1 x i8> %vc
43 define <vscale x 2 x i8> @vmul_vv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb) {
44 ; CHECK-LABEL: vmul_vv_nxv2i8:
46 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
47 ; CHECK-NEXT: vmul.vv v8, v8, v9
49 %vc = mul <vscale x 2 x i8> %va, %vb
50 ret <vscale x 2 x i8> %vc
53 define <vscale x 2 x i8> @vmul_vx_nxv2i8(<vscale x 2 x i8> %va, i8 signext %b) {
54 ; CHECK-LABEL: vmul_vx_nxv2i8:
56 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
57 ; CHECK-NEXT: vmul.vx v8, v8, a0
59 %head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
60 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
61 %vc = mul <vscale x 2 x i8> %va, %splat
62 ret <vscale x 2 x i8> %vc
65 define <vscale x 2 x i8> @vmul_vi_nxv2i8_0(<vscale x 2 x i8> %va) {
66 ; CHECK-LABEL: vmul_vi_nxv2i8_0:
68 ; CHECK-NEXT: li a0, -7
69 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
70 ; CHECK-NEXT: vmul.vx v8, v8, a0
72 %head = insertelement <vscale x 2 x i8> poison, i8 -7, i32 0
73 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
74 %vc = mul <vscale x 2 x i8> %va, %splat
75 ret <vscale x 2 x i8> %vc
78 define <vscale x 4 x i8> @vmul_vv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb) {
79 ; CHECK-LABEL: vmul_vv_nxv4i8:
81 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
82 ; CHECK-NEXT: vmul.vv v8, v8, v9
84 %vc = mul <vscale x 4 x i8> %va, %vb
85 ret <vscale x 4 x i8> %vc
88 define <vscale x 4 x i8> @vmul_vx_nxv4i8(<vscale x 4 x i8> %va, i8 signext %b) {
89 ; CHECK-LABEL: vmul_vx_nxv4i8:
91 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
92 ; CHECK-NEXT: vmul.vx v8, v8, a0
94 %head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
95 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
96 %vc = mul <vscale x 4 x i8> %va, %splat
97 ret <vscale x 4 x i8> %vc
100 define <vscale x 4 x i8> @vmul_vi_nxv4i8_0(<vscale x 4 x i8> %va) {
101 ; CHECK-LABEL: vmul_vi_nxv4i8_0:
103 ; CHECK-NEXT: li a0, -7
104 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
105 ; CHECK-NEXT: vmul.vx v8, v8, a0
107 %head = insertelement <vscale x 4 x i8> poison, i8 -7, i32 0
108 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
109 %vc = mul <vscale x 4 x i8> %va, %splat
110 ret <vscale x 4 x i8> %vc
113 define <vscale x 8 x i8> @vmul_vv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb) {
114 ; CHECK-LABEL: vmul_vv_nxv8i8:
116 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
117 ; CHECK-NEXT: vmul.vv v8, v8, v9
119 %vc = mul <vscale x 8 x i8> %va, %vb
120 ret <vscale x 8 x i8> %vc
123 define <vscale x 8 x i8> @vmul_vx_nxv8i8(<vscale x 8 x i8> %va, i8 signext %b) {
124 ; CHECK-LABEL: vmul_vx_nxv8i8:
126 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
127 ; CHECK-NEXT: vmul.vx v8, v8, a0
129 %head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
130 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
131 %vc = mul <vscale x 8 x i8> %va, %splat
132 ret <vscale x 8 x i8> %vc
135 define <vscale x 8 x i8> @vmul_vi_nxv8i8_0(<vscale x 8 x i8> %va) {
136 ; CHECK-LABEL: vmul_vi_nxv8i8_0:
138 ; CHECK-NEXT: li a0, -7
139 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
140 ; CHECK-NEXT: vmul.vx v8, v8, a0
142 %head = insertelement <vscale x 8 x i8> poison, i8 -7, i32 0
143 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
144 %vc = mul <vscale x 8 x i8> %va, %splat
145 ret <vscale x 8 x i8> %vc
148 define <vscale x 16 x i8> @vmul_vv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb) {
149 ; CHECK-LABEL: vmul_vv_nxv16i8:
151 ; CHECK-NEXT: vsetvli a0, zero, e8, m2, ta, ma
152 ; CHECK-NEXT: vmul.vv v8, v8, v10
154 %vc = mul <vscale x 16 x i8> %va, %vb
155 ret <vscale x 16 x i8> %vc
158 define <vscale x 16 x i8> @vmul_vx_nxv16i8(<vscale x 16 x i8> %va, i8 signext %b) {
159 ; CHECK-LABEL: vmul_vx_nxv16i8:
161 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
162 ; CHECK-NEXT: vmul.vx v8, v8, a0
164 %head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
165 %splat = shufflevector <vscale x 16 x i8> %head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
166 %vc = mul <vscale x 16 x i8> %va, %splat
167 ret <vscale x 16 x i8> %vc
170 define <vscale x 16 x i8> @vmul_vi_nxv16i8_0(<vscale x 16 x i8> %va) {
171 ; CHECK-LABEL: vmul_vi_nxv16i8_0:
173 ; CHECK-NEXT: li a0, -7
174 ; CHECK-NEXT: vsetvli a1, zero, e8, m2, ta, ma
175 ; CHECK-NEXT: vmul.vx v8, v8, a0
177 %head = insertelement <vscale x 16 x i8> poison, i8 -7, i32 0
178 %splat = shufflevector <vscale x 16 x i8> %head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
179 %vc = mul <vscale x 16 x i8> %va, %splat
180 ret <vscale x 16 x i8> %vc
183 define <vscale x 32 x i8> @vmul_vv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb) {
184 ; CHECK-LABEL: vmul_vv_nxv32i8:
186 ; CHECK-NEXT: vsetvli a0, zero, e8, m4, ta, ma
187 ; CHECK-NEXT: vmul.vv v8, v8, v12
189 %vc = mul <vscale x 32 x i8> %va, %vb
190 ret <vscale x 32 x i8> %vc
193 define <vscale x 32 x i8> @vmul_vx_nxv32i8(<vscale x 32 x i8> %va, i8 signext %b) {
194 ; CHECK-LABEL: vmul_vx_nxv32i8:
196 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
197 ; CHECK-NEXT: vmul.vx v8, v8, a0
199 %head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
200 %splat = shufflevector <vscale x 32 x i8> %head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
201 %vc = mul <vscale x 32 x i8> %va, %splat
202 ret <vscale x 32 x i8> %vc
205 define <vscale x 32 x i8> @vmul_vi_nxv32i8_0(<vscale x 32 x i8> %va) {
206 ; CHECK-LABEL: vmul_vi_nxv32i8_0:
208 ; CHECK-NEXT: li a0, -7
209 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
210 ; CHECK-NEXT: vmul.vx v8, v8, a0
212 %head = insertelement <vscale x 32 x i8> poison, i8 -7, i32 0
213 %splat = shufflevector <vscale x 32 x i8> %head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
214 %vc = mul <vscale x 32 x i8> %va, %splat
215 ret <vscale x 32 x i8> %vc
218 define <vscale x 64 x i8> @vmul_vv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb) {
219 ; CHECK-LABEL: vmul_vv_nxv64i8:
221 ; CHECK-NEXT: vsetvli a0, zero, e8, m8, ta, ma
222 ; CHECK-NEXT: vmul.vv v8, v8, v16
224 %vc = mul <vscale x 64 x i8> %va, %vb
225 ret <vscale x 64 x i8> %vc
228 define <vscale x 64 x i8> @vmul_vx_nxv64i8(<vscale x 64 x i8> %va, i8 signext %b) {
229 ; CHECK-LABEL: vmul_vx_nxv64i8:
231 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
232 ; CHECK-NEXT: vmul.vx v8, v8, a0
234 %head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
235 %splat = shufflevector <vscale x 64 x i8> %head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
236 %vc = mul <vscale x 64 x i8> %va, %splat
237 ret <vscale x 64 x i8> %vc
240 define <vscale x 64 x i8> @vmul_vi_nxv64i8_0(<vscale x 64 x i8> %va) {
241 ; CHECK-LABEL: vmul_vi_nxv64i8_0:
243 ; CHECK-NEXT: li a0, -7
244 ; CHECK-NEXT: vsetvli a1, zero, e8, m8, ta, ma
245 ; CHECK-NEXT: vmul.vx v8, v8, a0
247 %head = insertelement <vscale x 64 x i8> poison, i8 -7, i32 0
248 %splat = shufflevector <vscale x 64 x i8> %head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
249 %vc = mul <vscale x 64 x i8> %va, %splat
250 ret <vscale x 64 x i8> %vc
253 define <vscale x 1 x i16> @vmul_vv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb) {
254 ; CHECK-LABEL: vmul_vv_nxv1i16:
256 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
257 ; CHECK-NEXT: vmul.vv v8, v8, v9
259 %vc = mul <vscale x 1 x i16> %va, %vb
260 ret <vscale x 1 x i16> %vc
263 define <vscale x 1 x i16> @vmul_vx_nxv1i16(<vscale x 1 x i16> %va, i16 signext %b) {
264 ; CHECK-LABEL: vmul_vx_nxv1i16:
266 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
267 ; CHECK-NEXT: vmul.vx v8, v8, a0
269 %head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
270 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
271 %vc = mul <vscale x 1 x i16> %va, %splat
272 ret <vscale x 1 x i16> %vc
275 define <vscale x 1 x i16> @vmul_vi_nxv1i16_0(<vscale x 1 x i16> %va) {
276 ; CHECK-LABEL: vmul_vi_nxv1i16_0:
278 ; CHECK-NEXT: li a0, -7
279 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
280 ; CHECK-NEXT: vmul.vx v8, v8, a0
282 %head = insertelement <vscale x 1 x i16> poison, i16 -7, i32 0
283 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
284 %vc = mul <vscale x 1 x i16> %va, %splat
285 ret <vscale x 1 x i16> %vc
288 define <vscale x 2 x i16> @vmul_vv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb) {
289 ; CHECK-LABEL: vmul_vv_nxv2i16:
291 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
292 ; CHECK-NEXT: vmul.vv v8, v8, v9
294 %vc = mul <vscale x 2 x i16> %va, %vb
295 ret <vscale x 2 x i16> %vc
298 define <vscale x 2 x i16> @vmul_vx_nxv2i16(<vscale x 2 x i16> %va, i16 signext %b) {
299 ; CHECK-LABEL: vmul_vx_nxv2i16:
301 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
302 ; CHECK-NEXT: vmul.vx v8, v8, a0
304 %head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
305 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
306 %vc = mul <vscale x 2 x i16> %va, %splat
307 ret <vscale x 2 x i16> %vc
310 define <vscale x 2 x i16> @vmul_vi_nxv2i16_0(<vscale x 2 x i16> %va) {
311 ; CHECK-LABEL: vmul_vi_nxv2i16_0:
313 ; CHECK-NEXT: li a0, -7
314 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
315 ; CHECK-NEXT: vmul.vx v8, v8, a0
317 %head = insertelement <vscale x 2 x i16> poison, i16 -7, i32 0
318 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
319 %vc = mul <vscale x 2 x i16> %va, %splat
320 ret <vscale x 2 x i16> %vc
323 define <vscale x 4 x i16> @vmul_vv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb) {
324 ; CHECK-LABEL: vmul_vv_nxv4i16:
326 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
327 ; CHECK-NEXT: vmul.vv v8, v8, v9
329 %vc = mul <vscale x 4 x i16> %va, %vb
330 ret <vscale x 4 x i16> %vc
333 define <vscale x 4 x i16> @vmul_vx_nxv4i16(<vscale x 4 x i16> %va, i16 signext %b) {
334 ; CHECK-LABEL: vmul_vx_nxv4i16:
336 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
337 ; CHECK-NEXT: vmul.vx v8, v8, a0
339 %head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
340 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
341 %vc = mul <vscale x 4 x i16> %va, %splat
342 ret <vscale x 4 x i16> %vc
345 define <vscale x 4 x i16> @vmul_vi_nxv4i16_0(<vscale x 4 x i16> %va) {
346 ; CHECK-LABEL: vmul_vi_nxv4i16_0:
348 ; CHECK-NEXT: li a0, -7
349 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
350 ; CHECK-NEXT: vmul.vx v8, v8, a0
352 %head = insertelement <vscale x 4 x i16> poison, i16 -7, i32 0
353 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
354 %vc = mul <vscale x 4 x i16> %va, %splat
355 ret <vscale x 4 x i16> %vc
358 define <vscale x 8 x i16> @vmul_vv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb) {
359 ; CHECK-LABEL: vmul_vv_nxv8i16:
361 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
362 ; CHECK-NEXT: vmul.vv v8, v8, v10
364 %vc = mul <vscale x 8 x i16> %va, %vb
365 ret <vscale x 8 x i16> %vc
368 define <vscale x 8 x i16> @vmul_vx_nxv8i16(<vscale x 8 x i16> %va, i16 signext %b) {
369 ; CHECK-LABEL: vmul_vx_nxv8i16:
371 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
372 ; CHECK-NEXT: vmul.vx v8, v8, a0
374 %head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
375 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
376 %vc = mul <vscale x 8 x i16> %va, %splat
377 ret <vscale x 8 x i16> %vc
380 define <vscale x 8 x i16> @vmul_vi_nxv8i16_0(<vscale x 8 x i16> %va) {
381 ; CHECK-LABEL: vmul_vi_nxv8i16_0:
383 ; CHECK-NEXT: li a0, -7
384 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
385 ; CHECK-NEXT: vmul.vx v8, v8, a0
387 %head = insertelement <vscale x 8 x i16> poison, i16 -7, i32 0
388 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
389 %vc = mul <vscale x 8 x i16> %va, %splat
390 ret <vscale x 8 x i16> %vc
393 define <vscale x 16 x i16> @vmul_vv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb) {
394 ; CHECK-LABEL: vmul_vv_nxv16i16:
396 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
397 ; CHECK-NEXT: vmul.vv v8, v8, v12
399 %vc = mul <vscale x 16 x i16> %va, %vb
400 ret <vscale x 16 x i16> %vc
403 define <vscale x 16 x i16> @vmul_vx_nxv16i16(<vscale x 16 x i16> %va, i16 signext %b) {
404 ; CHECK-LABEL: vmul_vx_nxv16i16:
406 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
407 ; CHECK-NEXT: vmul.vx v8, v8, a0
409 %head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
410 %splat = shufflevector <vscale x 16 x i16> %head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
411 %vc = mul <vscale x 16 x i16> %va, %splat
412 ret <vscale x 16 x i16> %vc
415 define <vscale x 16 x i16> @vmul_vi_nxv16i16_0(<vscale x 16 x i16> %va) {
416 ; CHECK-LABEL: vmul_vi_nxv16i16_0:
418 ; CHECK-NEXT: li a0, -7
419 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
420 ; CHECK-NEXT: vmul.vx v8, v8, a0
422 %head = insertelement <vscale x 16 x i16> poison, i16 -7, i32 0
423 %splat = shufflevector <vscale x 16 x i16> %head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
424 %vc = mul <vscale x 16 x i16> %va, %splat
425 ret <vscale x 16 x i16> %vc
428 define <vscale x 32 x i16> @vmul_vv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb) {
429 ; CHECK-LABEL: vmul_vv_nxv32i16:
431 ; CHECK-NEXT: vsetvli a0, zero, e16, m8, ta, ma
432 ; CHECK-NEXT: vmul.vv v8, v8, v16
434 %vc = mul <vscale x 32 x i16> %va, %vb
435 ret <vscale x 32 x i16> %vc
438 define <vscale x 32 x i16> @vmul_vx_nxv32i16(<vscale x 32 x i16> %va, i16 signext %b) {
439 ; CHECK-LABEL: vmul_vx_nxv32i16:
441 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
442 ; CHECK-NEXT: vmul.vx v8, v8, a0
444 %head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
445 %splat = shufflevector <vscale x 32 x i16> %head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
446 %vc = mul <vscale x 32 x i16> %va, %splat
447 ret <vscale x 32 x i16> %vc
450 define <vscale x 32 x i16> @vmul_vi_nxv32i16_0(<vscale x 32 x i16> %va) {
451 ; CHECK-LABEL: vmul_vi_nxv32i16_0:
453 ; CHECK-NEXT: li a0, -7
454 ; CHECK-NEXT: vsetvli a1, zero, e16, m8, ta, ma
455 ; CHECK-NEXT: vmul.vx v8, v8, a0
457 %head = insertelement <vscale x 32 x i16> poison, i16 -7, i32 0
458 %splat = shufflevector <vscale x 32 x i16> %head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
459 %vc = mul <vscale x 32 x i16> %va, %splat
460 ret <vscale x 32 x i16> %vc
463 define <vscale x 1 x i32> @vmul_vv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb) {
464 ; CHECK-LABEL: vmul_vv_nxv1i32:
466 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
467 ; CHECK-NEXT: vmul.vv v8, v8, v9
469 %vc = mul <vscale x 1 x i32> %va, %vb
470 ret <vscale x 1 x i32> %vc
473 define <vscale x 1 x i32> @vmul_vx_nxv1i32(<vscale x 1 x i32> %va, i32 signext %b) {
474 ; CHECK-LABEL: vmul_vx_nxv1i32:
476 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
477 ; CHECK-NEXT: vmul.vx v8, v8, a0
479 %head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
480 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
481 %vc = mul <vscale x 1 x i32> %va, %splat
482 ret <vscale x 1 x i32> %vc
485 define <vscale x 1 x i32> @vmul_vi_nxv1i32_0(<vscale x 1 x i32> %va) {
486 ; CHECK-LABEL: vmul_vi_nxv1i32_0:
488 ; CHECK-NEXT: li a0, -7
489 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
490 ; CHECK-NEXT: vmul.vx v8, v8, a0
492 %head = insertelement <vscale x 1 x i32> poison, i32 -7, i32 0
493 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
494 %vc = mul <vscale x 1 x i32> %va, %splat
495 ret <vscale x 1 x i32> %vc
498 define <vscale x 2 x i32> @vmul_vv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb) {
499 ; CHECK-LABEL: vmul_vv_nxv2i32:
501 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
502 ; CHECK-NEXT: vmul.vv v8, v8, v9
504 %vc = mul <vscale x 2 x i32> %va, %vb
505 ret <vscale x 2 x i32> %vc
508 define <vscale x 2 x i32> @vmul_vx_nxv2i32(<vscale x 2 x i32> %va, i32 signext %b) {
509 ; CHECK-LABEL: vmul_vx_nxv2i32:
511 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
512 ; CHECK-NEXT: vmul.vx v8, v8, a0
514 %head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
515 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
516 %vc = mul <vscale x 2 x i32> %va, %splat
517 ret <vscale x 2 x i32> %vc
520 define <vscale x 2 x i32> @vmul_vi_nxv2i32_0(<vscale x 2 x i32> %va) {
521 ; CHECK-LABEL: vmul_vi_nxv2i32_0:
523 ; CHECK-NEXT: li a0, -7
524 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
525 ; CHECK-NEXT: vmul.vx v8, v8, a0
527 %head = insertelement <vscale x 2 x i32> poison, i32 -7, i32 0
528 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
529 %vc = mul <vscale x 2 x i32> %va, %splat
530 ret <vscale x 2 x i32> %vc
533 define <vscale x 4 x i32> @vmul_vv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb) {
534 ; CHECK-LABEL: vmul_vv_nxv4i32:
536 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
537 ; CHECK-NEXT: vmul.vv v8, v8, v10
539 %vc = mul <vscale x 4 x i32> %va, %vb
540 ret <vscale x 4 x i32> %vc
543 define <vscale x 4 x i32> @vmul_vx_nxv4i32(<vscale x 4 x i32> %va, i32 signext %b) {
544 ; CHECK-LABEL: vmul_vx_nxv4i32:
546 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
547 ; CHECK-NEXT: vmul.vx v8, v8, a0
549 %head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
550 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
551 %vc = mul <vscale x 4 x i32> %va, %splat
552 ret <vscale x 4 x i32> %vc
555 define <vscale x 4 x i32> @vmul_vi_nxv4i32_0(<vscale x 4 x i32> %va) {
556 ; CHECK-LABEL: vmul_vi_nxv4i32_0:
558 ; CHECK-NEXT: li a0, -7
559 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
560 ; CHECK-NEXT: vmul.vx v8, v8, a0
562 %head = insertelement <vscale x 4 x i32> poison, i32 -7, i32 0
563 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
564 %vc = mul <vscale x 4 x i32> %va, %splat
565 ret <vscale x 4 x i32> %vc
568 define <vscale x 8 x i32> @vmul_vv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb) {
569 ; CHECK-LABEL: vmul_vv_nxv8i32:
571 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
572 ; CHECK-NEXT: vmul.vv v8, v8, v12
574 %vc = mul <vscale x 8 x i32> %va, %vb
575 ret <vscale x 8 x i32> %vc
578 define <vscale x 8 x i32> @vmul_vx_nxv8i32(<vscale x 8 x i32> %va, i32 signext %b) {
579 ; CHECK-LABEL: vmul_vx_nxv8i32:
581 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
582 ; CHECK-NEXT: vmul.vx v8, v8, a0
584 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
585 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
586 %vc = mul <vscale x 8 x i32> %va, %splat
587 ret <vscale x 8 x i32> %vc
590 define <vscale x 8 x i32> @vmul_vi_nxv8i32_0(<vscale x 8 x i32> %va) {
591 ; CHECK-LABEL: vmul_vi_nxv8i32_0:
593 ; CHECK-NEXT: li a0, -7
594 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
595 ; CHECK-NEXT: vmul.vx v8, v8, a0
597 %head = insertelement <vscale x 8 x i32> poison, i32 -7, i32 0
598 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
599 %vc = mul <vscale x 8 x i32> %va, %splat
600 ret <vscale x 8 x i32> %vc
603 define <vscale x 16 x i32> @vmul_vv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb) {
604 ; CHECK-LABEL: vmul_vv_nxv16i32:
606 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
607 ; CHECK-NEXT: vmul.vv v8, v8, v16
609 %vc = mul <vscale x 16 x i32> %va, %vb
610 ret <vscale x 16 x i32> %vc
613 define <vscale x 16 x i32> @vmul_vx_nxv16i32(<vscale x 16 x i32> %va, i32 signext %b) {
614 ; CHECK-LABEL: vmul_vx_nxv16i32:
616 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
617 ; CHECK-NEXT: vmul.vx v8, v8, a0
619 %head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
620 %splat = shufflevector <vscale x 16 x i32> %head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
621 %vc = mul <vscale x 16 x i32> %va, %splat
622 ret <vscale x 16 x i32> %vc
625 define <vscale x 16 x i32> @vmul_vi_nxv16i32_0(<vscale x 16 x i32> %va) {
626 ; CHECK-LABEL: vmul_vi_nxv16i32_0:
628 ; CHECK-NEXT: li a0, -7
629 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
630 ; CHECK-NEXT: vmul.vx v8, v8, a0
632 %head = insertelement <vscale x 16 x i32> poison, i32 -7, i32 0
633 %splat = shufflevector <vscale x 16 x i32> %head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
634 %vc = mul <vscale x 16 x i32> %va, %splat
635 ret <vscale x 16 x i32> %vc
638 define <vscale x 1 x i64> @vmul_vv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb) {
639 ; CHECK-LABEL: vmul_vv_nxv1i64:
641 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
642 ; CHECK-NEXT: vmul.vv v8, v8, v9
644 %vc = mul <vscale x 1 x i64> %va, %vb
645 ret <vscale x 1 x i64> %vc
648 define <vscale x 1 x i64> @vmul_vx_nxv1i64(<vscale x 1 x i64> %va, i64 %b) {
649 ; RV32-LABEL: vmul_vx_nxv1i64:
651 ; RV32-NEXT: addi sp, sp, -16
652 ; RV32-NEXT: .cfi_def_cfa_offset 16
653 ; RV32-NEXT: sw a1, 12(sp)
654 ; RV32-NEXT: sw a0, 8(sp)
655 ; RV32-NEXT: addi a0, sp, 8
656 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
657 ; RV32-NEXT: vlse64.v v9, (a0), zero
658 ; RV32-NEXT: vmul.vv v8, v8, v9
659 ; RV32-NEXT: addi sp, sp, 16
662 ; RV64-LABEL: vmul_vx_nxv1i64:
664 ; RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
665 ; RV64-NEXT: vmul.vx v8, v8, a0
667 %head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
668 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
669 %vc = mul <vscale x 1 x i64> %va, %splat
670 ret <vscale x 1 x i64> %vc
673 define <vscale x 1 x i64> @vmul_vi_nxv1i64_0(<vscale x 1 x i64> %va) {
674 ; CHECK-LABEL: vmul_vi_nxv1i64_0:
676 ; CHECK-NEXT: li a0, -7
677 ; CHECK-NEXT: vsetvli a1, zero, e64, m1, ta, ma
678 ; CHECK-NEXT: vmul.vx v8, v8, a0
680 %head = insertelement <vscale x 1 x i64> poison, i64 -7, i32 0
681 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
682 %vc = mul <vscale x 1 x i64> %va, %splat
683 ret <vscale x 1 x i64> %vc
686 define <vscale x 1 x i64> @vmul_vi_nxv1i64_1(<vscale x 1 x i64> %va) {
687 ; CHECK-LABEL: vmul_vi_nxv1i64_1:
689 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
690 ; CHECK-NEXT: vadd.vv v8, v8, v8
692 %head = insertelement <vscale x 1 x i64> poison, i64 2, i32 0
693 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
694 %vc = mul <vscale x 1 x i64> %va, %splat
695 ret <vscale x 1 x i64> %vc
698 define <vscale x 1 x i64> @vmul_vi_nxv1i64_2(<vscale x 1 x i64> %va) {
699 ; CHECK-LABEL: vmul_vi_nxv1i64_2:
701 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
702 ; CHECK-NEXT: vsll.vi v8, v8, 4
704 %head = insertelement <vscale x 1 x i64> poison, i64 16, i32 0
705 %splat = shufflevector <vscale x 1 x i64> %head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
706 %vc = mul <vscale x 1 x i64> %va, %splat
707 ret <vscale x 1 x i64> %vc
710 define <vscale x 2 x i64> @vmul_vv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb) {
711 ; CHECK-LABEL: vmul_vv_nxv2i64:
713 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
714 ; CHECK-NEXT: vmul.vv v8, v8, v10
716 %vc = mul <vscale x 2 x i64> %va, %vb
717 ret <vscale x 2 x i64> %vc
720 define <vscale x 2 x i64> @vmul_vx_nxv2i64(<vscale x 2 x i64> %va, i64 %b) {
721 ; RV32-LABEL: vmul_vx_nxv2i64:
723 ; RV32-NEXT: addi sp, sp, -16
724 ; RV32-NEXT: .cfi_def_cfa_offset 16
725 ; RV32-NEXT: sw a1, 12(sp)
726 ; RV32-NEXT: sw a0, 8(sp)
727 ; RV32-NEXT: addi a0, sp, 8
728 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
729 ; RV32-NEXT: vlse64.v v10, (a0), zero
730 ; RV32-NEXT: vmul.vv v8, v8, v10
731 ; RV32-NEXT: addi sp, sp, 16
734 ; RV64-LABEL: vmul_vx_nxv2i64:
736 ; RV64-NEXT: vsetvli a1, zero, e64, m2, ta, ma
737 ; RV64-NEXT: vmul.vx v8, v8, a0
739 %head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
740 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
741 %vc = mul <vscale x 2 x i64> %va, %splat
742 ret <vscale x 2 x i64> %vc
745 define <vscale x 2 x i64> @vmul_vi_nxv2i64_0(<vscale x 2 x i64> %va) {
746 ; CHECK-LABEL: vmul_vi_nxv2i64_0:
748 ; CHECK-NEXT: li a0, -7
749 ; CHECK-NEXT: vsetvli a1, zero, e64, m2, ta, ma
750 ; CHECK-NEXT: vmul.vx v8, v8, a0
752 %head = insertelement <vscale x 2 x i64> poison, i64 -7, i32 0
753 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
754 %vc = mul <vscale x 2 x i64> %va, %splat
755 ret <vscale x 2 x i64> %vc
758 define <vscale x 2 x i64> @vmul_vi_nxv2i64_1(<vscale x 2 x i64> %va) {
759 ; CHECK-LABEL: vmul_vi_nxv2i64_1:
761 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
762 ; CHECK-NEXT: vadd.vv v8, v8, v8
764 %head = insertelement <vscale x 2 x i64> poison, i64 2, i32 0
765 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
766 %vc = mul <vscale x 2 x i64> %va, %splat
767 ret <vscale x 2 x i64> %vc
770 define <vscale x 2 x i64> @vmul_vi_nxv2i64_2(<vscale x 2 x i64> %va) {
771 ; CHECK-LABEL: vmul_vi_nxv2i64_2:
773 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
774 ; CHECK-NEXT: vsll.vi v8, v8, 4
776 %head = insertelement <vscale x 2 x i64> poison, i64 16, i32 0
777 %splat = shufflevector <vscale x 2 x i64> %head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
778 %vc = mul <vscale x 2 x i64> %va, %splat
779 ret <vscale x 2 x i64> %vc
782 define <vscale x 4 x i64> @vmul_vv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb) {
783 ; CHECK-LABEL: vmul_vv_nxv4i64:
785 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
786 ; CHECK-NEXT: vmul.vv v8, v8, v12
788 %vc = mul <vscale x 4 x i64> %va, %vb
789 ret <vscale x 4 x i64> %vc
792 define <vscale x 4 x i64> @vmul_vx_nxv4i64(<vscale x 4 x i64> %va, i64 %b) {
793 ; RV32-LABEL: vmul_vx_nxv4i64:
795 ; RV32-NEXT: addi sp, sp, -16
796 ; RV32-NEXT: .cfi_def_cfa_offset 16
797 ; RV32-NEXT: sw a1, 12(sp)
798 ; RV32-NEXT: sw a0, 8(sp)
799 ; RV32-NEXT: addi a0, sp, 8
800 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
801 ; RV32-NEXT: vlse64.v v12, (a0), zero
802 ; RV32-NEXT: vmul.vv v8, v8, v12
803 ; RV32-NEXT: addi sp, sp, 16
806 ; RV64-LABEL: vmul_vx_nxv4i64:
808 ; RV64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
809 ; RV64-NEXT: vmul.vx v8, v8, a0
811 %head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
812 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
813 %vc = mul <vscale x 4 x i64> %va, %splat
814 ret <vscale x 4 x i64> %vc
817 define <vscale x 4 x i64> @vmul_vi_nxv4i64_0(<vscale x 4 x i64> %va) {
818 ; CHECK-LABEL: vmul_vi_nxv4i64_0:
820 ; CHECK-NEXT: li a0, -7
821 ; CHECK-NEXT: vsetvli a1, zero, e64, m4, ta, ma
822 ; CHECK-NEXT: vmul.vx v8, v8, a0
824 %head = insertelement <vscale x 4 x i64> poison, i64 -7, i32 0
825 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
826 %vc = mul <vscale x 4 x i64> %va, %splat
827 ret <vscale x 4 x i64> %vc
830 define <vscale x 4 x i64> @vmul_vi_nxv4i64_1(<vscale x 4 x i64> %va) {
831 ; CHECK-LABEL: vmul_vi_nxv4i64_1:
833 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
834 ; CHECK-NEXT: vadd.vv v8, v8, v8
836 %head = insertelement <vscale x 4 x i64> poison, i64 2, i32 0
837 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
838 %vc = mul <vscale x 4 x i64> %va, %splat
839 ret <vscale x 4 x i64> %vc
842 define <vscale x 4 x i64> @vmul_vi_nxv4i64_2(<vscale x 4 x i64> %va) {
843 ; CHECK-LABEL: vmul_vi_nxv4i64_2:
845 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
846 ; CHECK-NEXT: vsll.vi v8, v8, 4
848 %head = insertelement <vscale x 4 x i64> poison, i64 16, i32 0
849 %splat = shufflevector <vscale x 4 x i64> %head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
850 %vc = mul <vscale x 4 x i64> %va, %splat
851 ret <vscale x 4 x i64> %vc
854 define <vscale x 8 x i64> @vmul_vv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb) {
855 ; CHECK-LABEL: vmul_vv_nxv8i64:
857 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
858 ; CHECK-NEXT: vmul.vv v8, v8, v16
860 %vc = mul <vscale x 8 x i64> %va, %vb
861 ret <vscale x 8 x i64> %vc
864 define <vscale x 8 x i64> @vmul_vx_nxv8i64(<vscale x 8 x i64> %va, i64 %b) {
865 ; RV32-LABEL: vmul_vx_nxv8i64:
867 ; RV32-NEXT: addi sp, sp, -16
868 ; RV32-NEXT: .cfi_def_cfa_offset 16
869 ; RV32-NEXT: sw a1, 12(sp)
870 ; RV32-NEXT: sw a0, 8(sp)
871 ; RV32-NEXT: addi a0, sp, 8
872 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
873 ; RV32-NEXT: vlse64.v v16, (a0), zero
874 ; RV32-NEXT: vmul.vv v8, v8, v16
875 ; RV32-NEXT: addi sp, sp, 16
878 ; RV64-LABEL: vmul_vx_nxv8i64:
880 ; RV64-NEXT: vsetvli a1, zero, e64, m8, ta, ma
881 ; RV64-NEXT: vmul.vx v8, v8, a0
883 %head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
884 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
885 %vc = mul <vscale x 8 x i64> %va, %splat
886 ret <vscale x 8 x i64> %vc
889 define <vscale x 8 x i64> @vmul_vi_nxv8i64_0(<vscale x 8 x i64> %va) {
890 ; CHECK-LABEL: vmul_vi_nxv8i64_0:
892 ; CHECK-NEXT: li a0, -7
893 ; CHECK-NEXT: vsetvli a1, zero, e64, m8, ta, ma
894 ; CHECK-NEXT: vmul.vx v8, v8, a0
896 %head = insertelement <vscale x 8 x i64> poison, i64 -7, i32 0
897 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
898 %vc = mul <vscale x 8 x i64> %va, %splat
899 ret <vscale x 8 x i64> %vc
902 define <vscale x 8 x i64> @vmul_vi_nxv8i64_1(<vscale x 8 x i64> %va) {
903 ; CHECK-LABEL: vmul_vi_nxv8i64_1:
905 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
906 ; CHECK-NEXT: vadd.vv v8, v8, v8
908 %head = insertelement <vscale x 8 x i64> poison, i64 2, i32 0
909 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
910 %vc = mul <vscale x 8 x i64> %va, %splat
911 ret <vscale x 8 x i64> %vc
914 define <vscale x 8 x i64> @vmul_vi_nxv8i64_2(<vscale x 8 x i64> %va) {
915 ; CHECK-LABEL: vmul_vi_nxv8i64_2:
917 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
918 ; CHECK-NEXT: vsll.vi v8, v8, 4
920 %head = insertelement <vscale x 8 x i64> poison, i64 16, i32 0
921 %splat = shufflevector <vscale x 8 x i64> %head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
922 %vc = mul <vscale x 8 x i64> %va, %splat
923 ret <vscale x 8 x i64> %vc
926 define <vscale x 8 x i64> @vmul_xx_nxv8i64(i64 %a, i64 %b) nounwind {
927 ; RV32-LABEL: vmul_xx_nxv8i64:
929 ; RV32-NEXT: addi sp, sp, -16
930 ; RV32-NEXT: sw a1, 12(sp)
931 ; RV32-NEXT: sw a0, 8(sp)
932 ; RV32-NEXT: addi a0, sp, 8
933 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
934 ; RV32-NEXT: vlse64.v v8, (a0), zero
935 ; RV32-NEXT: sw a3, 4(sp)
936 ; RV32-NEXT: sw a2, 0(sp)
937 ; RV32-NEXT: mv a0, sp
938 ; RV32-NEXT: vlse64.v v16, (a0), zero
939 ; RV32-NEXT: vmul.vv v8, v8, v16
940 ; RV32-NEXT: addi sp, sp, 16
943 ; RV64NOM-LABEL: vmul_xx_nxv8i64:
945 ; RV64NOM-NEXT: vsetvli a2, zero, e64, m8, ta, ma
946 ; RV64NOM-NEXT: vmv.v.x v8, a0
947 ; RV64NOM-NEXT: vmul.vx v8, v8, a1
950 ; RV64M-LABEL: vmul_xx_nxv8i64:
952 ; RV64M-NEXT: mul a0, a0, a1
953 ; RV64M-NEXT: vsetvli a1, zero, e64, m8, ta, ma
954 ; RV64M-NEXT: vmv.v.x v8, a0
956 %head1 = insertelement <vscale x 8 x i64> poison, i64 %a, i32 0
957 %splat1 = shufflevector <vscale x 8 x i64> %head1, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
958 %head2 = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
959 %splat2 = shufflevector <vscale x 8 x i64> %head2, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
960 %v = mul <vscale x 8 x i64> %splat1, %splat2
961 ret <vscale x 8 x i64> %v
964 define <vscale x 8 x i32> @vmul_vv_mask_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %mask) {
965 ; CHECK-LABEL: vmul_vv_mask_nxv8i32:
967 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, mu
968 ; CHECK-NEXT: vmul.vv v8, v8, v12, v0.t
970 %head = insertelement <vscale x 8 x i32> poison, i32 1, i32 0
971 %one = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
972 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %vb, <vscale x 8 x i32> %one
973 %vc = mul <vscale x 8 x i32> %va, %vs
974 ret <vscale x 8 x i32> %vc
977 define <vscale x 8 x i32> @vmul_vx_mask_nxv8i32(<vscale x 8 x i32> %va, i32 signext %b, <vscale x 8 x i1> %mask) {
978 ; CHECK-LABEL: vmul_vx_mask_nxv8i32:
980 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu
981 ; CHECK-NEXT: vmul.vx v8, v8, a0, v0.t
983 %head1 = insertelement <vscale x 8 x i32> poison, i32 1, i32 0
984 %one = shufflevector <vscale x 8 x i32> %head1, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
985 %head2 = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
986 %splat = shufflevector <vscale x 8 x i32> %head2, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
987 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %splat, <vscale x 8 x i32> %one
988 %vc = mul <vscale x 8 x i32> %va, %vs
989 ret <vscale x 8 x i32> %vc
992 define <vscale x 8 x i32> @vmul_vi_mask_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i1> %mask) {
993 ; CHECK-LABEL: vmul_vi_mask_nxv8i32:
995 ; CHECK-NEXT: li a0, 7
996 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, mu
997 ; CHECK-NEXT: vmul.vx v8, v8, a0, v0.t
999 %head1 = insertelement <vscale x 8 x i32> poison, i32 1, i32 0
1000 %one = shufflevector <vscale x 8 x i32> %head1, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1001 %head2 = insertelement <vscale x 8 x i32> poison, i32 7, i32 0
1002 %splat = shufflevector <vscale x 8 x i32> %head2, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1003 %vs = select <vscale x 8 x i1> %mask, <vscale x 8 x i32> %splat, <vscale x 8 x i32> %one
1004 %vc = mul <vscale x 8 x i32> %va, %vs
1005 ret <vscale x 8 x i32> %vc