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
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s
5 define <vscale x 1 x i64> @vwmul_vv_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb) {
6 ; CHECK-LABEL: vwmul_vv_nxv1i64_nxv1i32:
8 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
9 ; CHECK-NEXT: vwmul.vv v10, v8, v9
10 ; CHECK-NEXT: vmv1r.v v8, v10
12 %vc = sext <vscale x 1 x i32> %va to <vscale x 1 x i64>
13 %vd = sext <vscale x 1 x i32> %vb to <vscale x 1 x i64>
14 %ve = mul <vscale x 1 x i64> %vc, %vd
15 ret <vscale x 1 x i64> %ve
18 define <vscale x 1 x i64> @vwmulu_vv_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb) {
19 ; CHECK-LABEL: vwmulu_vv_nxv1i64_nxv1i32:
21 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
22 ; CHECK-NEXT: vwmulu.vv v10, v8, v9
23 ; CHECK-NEXT: vmv1r.v v8, v10
25 %vc = zext <vscale x 1 x i32> %va to <vscale x 1 x i64>
26 %vd = zext <vscale x 1 x i32> %vb to <vscale x 1 x i64>
27 %ve = mul <vscale x 1 x i64> %vc, %vd
28 ret <vscale x 1 x i64> %ve
31 define <vscale x 1 x i64> @vwmulsu_vv_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb) {
32 ; CHECK-LABEL: vwmulsu_vv_nxv1i64_nxv1i32:
34 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
35 ; CHECK-NEXT: vwmulsu.vv v10, v8, v9
36 ; CHECK-NEXT: vmv1r.v v8, v10
38 %vc = sext <vscale x 1 x i32> %va to <vscale x 1 x i64>
39 %vd = zext <vscale x 1 x i32> %vb to <vscale x 1 x i64>
40 %ve = mul <vscale x 1 x i64> %vc, %vd
41 ret <vscale x 1 x i64> %ve
44 define <vscale x 1 x i64> @vwmul_vx_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, i32 %b) {
45 ; CHECK-LABEL: vwmul_vx_nxv1i64_nxv1i32:
47 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
48 ; CHECK-NEXT: vwmul.vx v9, v8, a0
49 ; CHECK-NEXT: vmv1r.v v8, v9
51 %head = insertelement <vscale x 1 x i32> undef, i32 %b, i32 0
52 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> undef, <vscale x 1 x i32> zeroinitializer
53 %vc = sext <vscale x 1 x i32> %va to <vscale x 1 x i64>
54 %vd = sext <vscale x 1 x i32> %splat to <vscale x 1 x i64>
55 %ve = mul <vscale x 1 x i64> %vc, %vd
56 ret <vscale x 1 x i64> %ve
59 define <vscale x 1 x i64> @vwmulu_vx_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, i32 %b) {
60 ; CHECK-LABEL: vwmulu_vx_nxv1i64_nxv1i32:
62 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
63 ; CHECK-NEXT: vwmulu.vx v9, v8, a0
64 ; CHECK-NEXT: vmv1r.v v8, v9
66 %head = insertelement <vscale x 1 x i32> undef, i32 %b, i32 0
67 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> undef, <vscale x 1 x i32> zeroinitializer
68 %vc = zext <vscale x 1 x i32> %va to <vscale x 1 x i64>
69 %vd = zext <vscale x 1 x i32> %splat to <vscale x 1 x i64>
70 %ve = mul <vscale x 1 x i64> %vc, %vd
71 ret <vscale x 1 x i64> %ve
74 define <vscale x 1 x i64> @vwmulsu_vx_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, i32 %b) {
75 ; CHECK-LABEL: vwmulsu_vx_nxv1i64_nxv1i32:
77 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
78 ; CHECK-NEXT: vwmulsu.vx v9, v8, a0
79 ; CHECK-NEXT: vmv1r.v v8, v9
81 %head = insertelement <vscale x 1 x i32> undef, i32 %b, i32 0
82 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> undef, <vscale x 1 x i32> zeroinitializer
83 %vc = sext <vscale x 1 x i32> %va to <vscale x 1 x i64>
84 %vd = zext <vscale x 1 x i32> %splat to <vscale x 1 x i64>
85 %ve = mul <vscale x 1 x i64> %vc, %vd
86 ret <vscale x 1 x i64> %ve
89 define <vscale x 2 x i64> @vwmul_vv_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb) {
90 ; CHECK-LABEL: vwmul_vv_nxv2i64_nxv2i32:
92 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
93 ; CHECK-NEXT: vwmul.vv v10, v8, v9
94 ; CHECK-NEXT: vmv2r.v v8, v10
96 %vc = sext <vscale x 2 x i32> %va to <vscale x 2 x i64>
97 %vd = sext <vscale x 2 x i32> %vb to <vscale x 2 x i64>
98 %ve = mul <vscale x 2 x i64> %vc, %vd
99 ret <vscale x 2 x i64> %ve
102 define <vscale x 2 x i64> @vwmulu_vv_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb) {
103 ; CHECK-LABEL: vwmulu_vv_nxv2i64_nxv2i32:
105 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
106 ; CHECK-NEXT: vwmulu.vv v10, v8, v9
107 ; CHECK-NEXT: vmv2r.v v8, v10
109 %vc = zext <vscale x 2 x i32> %va to <vscale x 2 x i64>
110 %vd = zext <vscale x 2 x i32> %vb to <vscale x 2 x i64>
111 %ve = mul <vscale x 2 x i64> %vc, %vd
112 ret <vscale x 2 x i64> %ve
115 define <vscale x 2 x i64> @vwmulsu_vv_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb) {
116 ; CHECK-LABEL: vwmulsu_vv_nxv2i64_nxv2i32:
118 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
119 ; CHECK-NEXT: vwmulsu.vv v10, v8, v9
120 ; CHECK-NEXT: vmv2r.v v8, v10
122 %vc = sext <vscale x 2 x i32> %va to <vscale x 2 x i64>
123 %vd = zext <vscale x 2 x i32> %vb to <vscale x 2 x i64>
124 %ve = mul <vscale x 2 x i64> %vc, %vd
125 ret <vscale x 2 x i64> %ve
128 define <vscale x 2 x i64> @vwmul_vx_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, i32 %b) {
129 ; CHECK-LABEL: vwmul_vx_nxv2i64_nxv2i32:
131 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
132 ; CHECK-NEXT: vwmul.vx v10, v8, a0
133 ; CHECK-NEXT: vmv2r.v v8, v10
135 %head = insertelement <vscale x 2 x i32> undef, i32 %b, i32 0
136 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> undef, <vscale x 2 x i32> zeroinitializer
137 %vc = sext <vscale x 2 x i32> %va to <vscale x 2 x i64>
138 %vd = sext <vscale x 2 x i32> %splat to <vscale x 2 x i64>
139 %ve = mul <vscale x 2 x i64> %vc, %vd
140 ret <vscale x 2 x i64> %ve
143 define <vscale x 2 x i64> @vwmulu_vx_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, i32 %b) {
144 ; CHECK-LABEL: vwmulu_vx_nxv2i64_nxv2i32:
146 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
147 ; CHECK-NEXT: vwmulu.vx v10, v8, a0
148 ; CHECK-NEXT: vmv2r.v v8, v10
150 %head = insertelement <vscale x 2 x i32> undef, i32 %b, i32 0
151 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> undef, <vscale x 2 x i32> zeroinitializer
152 %vc = zext <vscale x 2 x i32> %va to <vscale x 2 x i64>
153 %vd = zext <vscale x 2 x i32> %splat to <vscale x 2 x i64>
154 %ve = mul <vscale x 2 x i64> %vc, %vd
155 ret <vscale x 2 x i64> %ve
158 define <vscale x 2 x i64> @vwmulsu_vx_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, i32 %b) {
159 ; CHECK-LABEL: vwmulsu_vx_nxv2i64_nxv2i32:
161 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
162 ; CHECK-NEXT: vwmulsu.vx v10, v8, a0
163 ; CHECK-NEXT: vmv2r.v v8, v10
165 %head = insertelement <vscale x 2 x i32> undef, i32 %b, i32 0
166 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> undef, <vscale x 2 x i32> zeroinitializer
167 %vc = sext <vscale x 2 x i32> %va to <vscale x 2 x i64>
168 %vd = zext <vscale x 2 x i32> %splat to <vscale x 2 x i64>
169 %ve = mul <vscale x 2 x i64> %vc, %vd
170 ret <vscale x 2 x i64> %ve
173 define <vscale x 4 x i64> @vwmul_vv_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb) {
174 ; CHECK-LABEL: vwmul_vv_nxv4i64_nxv4i32:
176 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
177 ; CHECK-NEXT: vwmul.vv v12, v8, v10
178 ; CHECK-NEXT: vmv4r.v v8, v12
180 %vc = sext <vscale x 4 x i32> %va to <vscale x 4 x i64>
181 %vd = sext <vscale x 4 x i32> %vb to <vscale x 4 x i64>
182 %ve = mul <vscale x 4 x i64> %vc, %vd
183 ret <vscale x 4 x i64> %ve
186 define <vscale x 4 x i64> @vwmulu_vv_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb) {
187 ; CHECK-LABEL: vwmulu_vv_nxv4i64_nxv4i32:
189 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
190 ; CHECK-NEXT: vwmulu.vv v12, v8, v10
191 ; CHECK-NEXT: vmv4r.v v8, v12
193 %vc = zext <vscale x 4 x i32> %va to <vscale x 4 x i64>
194 %vd = zext <vscale x 4 x i32> %vb to <vscale x 4 x i64>
195 %ve = mul <vscale x 4 x i64> %vc, %vd
196 ret <vscale x 4 x i64> %ve
199 define <vscale x 4 x i64> @vwmulsu_vv_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb) {
200 ; CHECK-LABEL: vwmulsu_vv_nxv4i64_nxv4i32:
202 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
203 ; CHECK-NEXT: vwmulsu.vv v12, v8, v10
204 ; CHECK-NEXT: vmv4r.v v8, v12
206 %vc = sext <vscale x 4 x i32> %va to <vscale x 4 x i64>
207 %vd = zext <vscale x 4 x i32> %vb to <vscale x 4 x i64>
208 %ve = mul <vscale x 4 x i64> %vc, %vd
209 ret <vscale x 4 x i64> %ve
212 define <vscale x 4 x i64> @vwmul_vx_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, i32 %b) {
213 ; CHECK-LABEL: vwmul_vx_nxv4i64_nxv4i32:
215 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
216 ; CHECK-NEXT: vwmul.vx v12, v8, a0
217 ; CHECK-NEXT: vmv4r.v v8, v12
219 %head = insertelement <vscale x 4 x i32> undef, i32 %b, i32 0
220 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
221 %vc = sext <vscale x 4 x i32> %va to <vscale x 4 x i64>
222 %vd = sext <vscale x 4 x i32> %splat to <vscale x 4 x i64>
223 %ve = mul <vscale x 4 x i64> %vc, %vd
224 ret <vscale x 4 x i64> %ve
227 define <vscale x 4 x i64> @vwmulu_vx_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, i32 %b) {
228 ; CHECK-LABEL: vwmulu_vx_nxv4i64_nxv4i32:
230 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
231 ; CHECK-NEXT: vwmulu.vx v12, v8, a0
232 ; CHECK-NEXT: vmv4r.v v8, v12
234 %head = insertelement <vscale x 4 x i32> undef, i32 %b, i32 0
235 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
236 %vc = zext <vscale x 4 x i32> %va to <vscale x 4 x i64>
237 %vd = zext <vscale x 4 x i32> %splat to <vscale x 4 x i64>
238 %ve = mul <vscale x 4 x i64> %vc, %vd
239 ret <vscale x 4 x i64> %ve
242 define <vscale x 4 x i64> @vwmulsu_vx_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, i32 %b) {
243 ; CHECK-LABEL: vwmulsu_vx_nxv4i64_nxv4i32:
245 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
246 ; CHECK-NEXT: vwmulsu.vx v12, v8, a0
247 ; CHECK-NEXT: vmv4r.v v8, v12
249 %head = insertelement <vscale x 4 x i32> undef, i32 %b, i32 0
250 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
251 %vc = sext <vscale x 4 x i32> %va to <vscale x 4 x i64>
252 %vd = zext <vscale x 4 x i32> %splat to <vscale x 4 x i64>
253 %ve = mul <vscale x 4 x i64> %vc, %vd
254 ret <vscale x 4 x i64> %ve
257 define <vscale x 8 x i64> @vwmul_vv_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb) {
258 ; CHECK-LABEL: vwmul_vv_nxv8i64_nxv8i32:
260 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
261 ; CHECK-NEXT: vwmul.vv v16, v8, v12
262 ; CHECK-NEXT: vmv8r.v v8, v16
264 %vc = sext <vscale x 8 x i32> %va to <vscale x 8 x i64>
265 %vd = sext <vscale x 8 x i32> %vb to <vscale x 8 x i64>
266 %ve = mul <vscale x 8 x i64> %vc, %vd
267 ret <vscale x 8 x i64> %ve
270 define <vscale x 8 x i64> @vwmulu_vv_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb) {
271 ; CHECK-LABEL: vwmulu_vv_nxv8i64_nxv8i32:
273 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
274 ; CHECK-NEXT: vwmulu.vv v16, v8, v12
275 ; CHECK-NEXT: vmv8r.v v8, v16
277 %vc = zext <vscale x 8 x i32> %va to <vscale x 8 x i64>
278 %vd = zext <vscale x 8 x i32> %vb to <vscale x 8 x i64>
279 %ve = mul <vscale x 8 x i64> %vc, %vd
280 ret <vscale x 8 x i64> %ve
283 define <vscale x 8 x i64> @vwmulsu_vv_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb) {
284 ; CHECK-LABEL: vwmulsu_vv_nxv8i64_nxv8i32:
286 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
287 ; CHECK-NEXT: vwmulsu.vv v16, v8, v12
288 ; CHECK-NEXT: vmv8r.v v8, v16
290 %vc = sext <vscale x 8 x i32> %va to <vscale x 8 x i64>
291 %vd = zext <vscale x 8 x i32> %vb to <vscale x 8 x i64>
292 %ve = mul <vscale x 8 x i64> %vc, %vd
293 ret <vscale x 8 x i64> %ve
296 define <vscale x 8 x i64> @vwmul_vx_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, i32 %b) {
297 ; CHECK-LABEL: vwmul_vx_nxv8i64_nxv8i32:
299 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
300 ; CHECK-NEXT: vwmul.vx v16, v8, a0
301 ; CHECK-NEXT: vmv8r.v v8, v16
303 %head = insertelement <vscale x 8 x i32> undef, i32 %b, i32 0
304 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> undef, <vscale x 8 x i32> zeroinitializer
305 %vc = sext <vscale x 8 x i32> %va to <vscale x 8 x i64>
306 %vd = sext <vscale x 8 x i32> %splat to <vscale x 8 x i64>
307 %ve = mul <vscale x 8 x i64> %vc, %vd
308 ret <vscale x 8 x i64> %ve
311 define <vscale x 8 x i64> @vwmulu_vx_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, i32 %b) {
312 ; CHECK-LABEL: vwmulu_vx_nxv8i64_nxv8i32:
314 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
315 ; CHECK-NEXT: vwmulu.vx v16, v8, a0
316 ; CHECK-NEXT: vmv8r.v v8, v16
318 %head = insertelement <vscale x 8 x i32> undef, i32 %b, i32 0
319 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> undef, <vscale x 8 x i32> zeroinitializer
320 %vc = zext <vscale x 8 x i32> %va to <vscale x 8 x i64>
321 %vd = zext <vscale x 8 x i32> %splat to <vscale x 8 x i64>
322 %ve = mul <vscale x 8 x i64> %vc, %vd
323 ret <vscale x 8 x i64> %ve
326 define <vscale x 8 x i64> @vwmulsu_vx_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, i32 %b) {
327 ; CHECK-LABEL: vwmulsu_vx_nxv8i64_nxv8i32:
329 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
330 ; CHECK-NEXT: vwmulsu.vx v16, v8, a0
331 ; CHECK-NEXT: vmv8r.v v8, v16
333 %head = insertelement <vscale x 8 x i32> undef, i32 %b, i32 0
334 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> undef, <vscale x 8 x i32> zeroinitializer
335 %vc = sext <vscale x 8 x i32> %va to <vscale x 8 x i64>
336 %vd = zext <vscale x 8 x i32> %splat to <vscale x 8 x i64>
337 %ve = mul <vscale x 8 x i64> %vc, %vd
338 ret <vscale x 8 x i64> %ve
341 define <vscale x 1 x i64> @vwmul_vv_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb) {
342 ; CHECK-LABEL: vwmul_vv_nxv1i64_nxv1i16:
344 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
345 ; CHECK-NEXT: vsext.vf2 v10, v8
346 ; CHECK-NEXT: vsext.vf2 v11, v9
347 ; CHECK-NEXT: vwmul.vv v8, v10, v11
349 %vc = sext <vscale x 1 x i16> %va to <vscale x 1 x i64>
350 %vd = sext <vscale x 1 x i16> %vb to <vscale x 1 x i64>
351 %ve = mul <vscale x 1 x i64> %vc, %vd
352 ret <vscale x 1 x i64> %ve
355 define <vscale x 1 x i64> @vwmulu_vv_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb) {
356 ; CHECK-LABEL: vwmulu_vv_nxv1i64_nxv1i16:
358 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
359 ; CHECK-NEXT: vwmulu.vv v10, v8, v9
360 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
361 ; CHECK-NEXT: vzext.vf2 v8, v10
363 %vc = zext <vscale x 1 x i16> %va to <vscale x 1 x i64>
364 %vd = zext <vscale x 1 x i16> %vb to <vscale x 1 x i64>
365 %ve = mul <vscale x 1 x i64> %vc, %vd
366 ret <vscale x 1 x i64> %ve
369 define <vscale x 1 x i64> @vwmulsu_vv_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb) {
370 ; CHECK-LABEL: vwmulsu_vv_nxv1i64_nxv1i16:
372 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
373 ; CHECK-NEXT: vsext.vf2 v10, v8
374 ; CHECK-NEXT: vzext.vf2 v11, v9
375 ; CHECK-NEXT: vwmulsu.vv v8, v10, v11
377 %vc = sext <vscale x 1 x i16> %va to <vscale x 1 x i64>
378 %vd = zext <vscale x 1 x i16> %vb to <vscale x 1 x i64>
379 %ve = mul <vscale x 1 x i64> %vc, %vd
380 ret <vscale x 1 x i64> %ve
383 define <vscale x 1 x i64> @vwmul_vx_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, i16 %b) {
384 ; CHECK-LABEL: vwmul_vx_nxv1i64_nxv1i16:
386 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
387 ; CHECK-NEXT: vmv.v.x v9, a0
388 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
389 ; CHECK-NEXT: vsext.vf2 v10, v8
390 ; CHECK-NEXT: vsext.vf2 v11, v9
391 ; CHECK-NEXT: vwmul.vv v8, v10, v11
393 %head = insertelement <vscale x 1 x i16> undef, i16 %b, i16 0
394 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> undef, <vscale x 1 x i32> zeroinitializer
395 %vc = sext <vscale x 1 x i16> %va to <vscale x 1 x i64>
396 %vd = sext <vscale x 1 x i16> %splat to <vscale x 1 x i64>
397 %ve = mul <vscale x 1 x i64> %vc, %vd
398 ret <vscale x 1 x i64> %ve
401 define <vscale x 1 x i64> @vwmulu_vx_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, i16 %b) {
402 ; CHECK-LABEL: vwmulu_vx_nxv1i64_nxv1i16:
404 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
405 ; CHECK-NEXT: vwmulu.vx v9, v8, a0
406 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
407 ; CHECK-NEXT: vzext.vf2 v8, v9
409 %head = insertelement <vscale x 1 x i16> undef, i16 %b, i16 0
410 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> undef, <vscale x 1 x i32> zeroinitializer
411 %vc = zext <vscale x 1 x i16> %va to <vscale x 1 x i64>
412 %vd = zext <vscale x 1 x i16> %splat to <vscale x 1 x i64>
413 %ve = mul <vscale x 1 x i64> %vc, %vd
414 ret <vscale x 1 x i64> %ve
417 define <vscale x 1 x i64> @vwmulsu_vx_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, i16 %b) {
418 ; CHECK-LABEL: vwmulsu_vx_nxv1i64_nxv1i16:
420 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
421 ; CHECK-NEXT: vmv.v.x v9, a0
422 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
423 ; CHECK-NEXT: vsext.vf2 v10, v8
424 ; CHECK-NEXT: vzext.vf2 v11, v9
425 ; CHECK-NEXT: vwmulsu.vv v8, v10, v11
427 %head = insertelement <vscale x 1 x i16> undef, i16 %b, i16 0
428 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> undef, <vscale x 1 x i32> zeroinitializer
429 %vc = sext <vscale x 1 x i16> %va to <vscale x 1 x i64>
430 %vd = zext <vscale x 1 x i16> %splat to <vscale x 1 x i64>
431 %ve = mul <vscale x 1 x i64> %vc, %vd
432 ret <vscale x 1 x i64> %ve
435 define <vscale x 2 x i64> @vwmul_vv_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb) {
436 ; CHECK-LABEL: vwmul_vv_nxv2i64_nxv2i16:
438 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
439 ; CHECK-NEXT: vsext.vf2 v10, v8
440 ; CHECK-NEXT: vsext.vf2 v11, v9
441 ; CHECK-NEXT: vwmul.vv v8, v10, v11
443 %vc = sext <vscale x 2 x i16> %va to <vscale x 2 x i64>
444 %vd = sext <vscale x 2 x i16> %vb to <vscale x 2 x i64>
445 %ve = mul <vscale x 2 x i64> %vc, %vd
446 ret <vscale x 2 x i64> %ve
449 define <vscale x 2 x i64> @vwmulu_vv_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb) {
450 ; CHECK-LABEL: vwmulu_vv_nxv2i64_nxv2i16:
452 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
453 ; CHECK-NEXT: vwmulu.vv v10, v8, v9
454 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
455 ; CHECK-NEXT: vzext.vf2 v8, v10
457 %vc = zext <vscale x 2 x i16> %va to <vscale x 2 x i64>
458 %vd = zext <vscale x 2 x i16> %vb to <vscale x 2 x i64>
459 %ve = mul <vscale x 2 x i64> %vc, %vd
460 ret <vscale x 2 x i64> %ve
463 define <vscale x 2 x i64> @vwmulsu_vv_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb) {
464 ; CHECK-LABEL: vwmulsu_vv_nxv2i64_nxv2i16:
466 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
467 ; CHECK-NEXT: vsext.vf2 v10, v8
468 ; CHECK-NEXT: vzext.vf2 v11, v9
469 ; CHECK-NEXT: vwmulsu.vv v8, v10, v11
471 %vc = sext <vscale x 2 x i16> %va to <vscale x 2 x i64>
472 %vd = zext <vscale x 2 x i16> %vb to <vscale x 2 x i64>
473 %ve = mul <vscale x 2 x i64> %vc, %vd
474 ret <vscale x 2 x i64> %ve
477 define <vscale x 2 x i64> @vwmul_vx_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, i16 %b) {
478 ; CHECK-LABEL: vwmul_vx_nxv2i64_nxv2i16:
480 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
481 ; CHECK-NEXT: vmv.v.x v9, a0
482 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
483 ; CHECK-NEXT: vsext.vf2 v10, v8
484 ; CHECK-NEXT: vsext.vf2 v11, v9
485 ; CHECK-NEXT: vwmul.vv v8, v10, v11
487 %head = insertelement <vscale x 2 x i16> undef, i16 %b, i16 0
488 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> undef, <vscale x 2 x i32> zeroinitializer
489 %vc = sext <vscale x 2 x i16> %va to <vscale x 2 x i64>
490 %vd = sext <vscale x 2 x i16> %splat to <vscale x 2 x i64>
491 %ve = mul <vscale x 2 x i64> %vc, %vd
492 ret <vscale x 2 x i64> %ve
495 define <vscale x 2 x i64> @vwmulu_vx_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, i16 %b) {
496 ; CHECK-LABEL: vwmulu_vx_nxv2i64_nxv2i16:
498 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
499 ; CHECK-NEXT: vwmulu.vx v10, v8, a0
500 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
501 ; CHECK-NEXT: vzext.vf2 v8, v10
503 %head = insertelement <vscale x 2 x i16> undef, i16 %b, i16 0
504 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> undef, <vscale x 2 x i32> zeroinitializer
505 %vc = zext <vscale x 2 x i16> %va to <vscale x 2 x i64>
506 %vd = zext <vscale x 2 x i16> %splat to <vscale x 2 x i64>
507 %ve = mul <vscale x 2 x i64> %vc, %vd
508 ret <vscale x 2 x i64> %ve
511 define <vscale x 2 x i64> @vwmulsu_vx_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, i16 %b) {
512 ; CHECK-LABEL: vwmulsu_vx_nxv2i64_nxv2i16:
514 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
515 ; CHECK-NEXT: vmv.v.x v9, a0
516 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
517 ; CHECK-NEXT: vsext.vf2 v10, v8
518 ; CHECK-NEXT: vzext.vf2 v11, v9
519 ; CHECK-NEXT: vwmulsu.vv v8, v10, v11
521 %head = insertelement <vscale x 2 x i16> undef, i16 %b, i16 0
522 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> undef, <vscale x 2 x i32> zeroinitializer
523 %vc = sext <vscale x 2 x i16> %va to <vscale x 2 x i64>
524 %vd = zext <vscale x 2 x i16> %splat to <vscale x 2 x i64>
525 %ve = mul <vscale x 2 x i64> %vc, %vd
526 ret <vscale x 2 x i64> %ve
529 define <vscale x 4 x i64> @vwmul_vv_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb) {
530 ; CHECK-LABEL: vwmul_vv_nxv4i64_nxv4i16:
532 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
533 ; CHECK-NEXT: vsext.vf2 v12, v8
534 ; CHECK-NEXT: vsext.vf2 v14, v9
535 ; CHECK-NEXT: vwmul.vv v8, v12, v14
537 %vc = sext <vscale x 4 x i16> %va to <vscale x 4 x i64>
538 %vd = sext <vscale x 4 x i16> %vb to <vscale x 4 x i64>
539 %ve = mul <vscale x 4 x i64> %vc, %vd
540 ret <vscale x 4 x i64> %ve
543 define <vscale x 4 x i64> @vwmulu_vv_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb) {
544 ; CHECK-LABEL: vwmulu_vv_nxv4i64_nxv4i16:
546 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
547 ; CHECK-NEXT: vwmulu.vv v12, v8, v9
548 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
549 ; CHECK-NEXT: vzext.vf2 v8, v12
551 %vc = zext <vscale x 4 x i16> %va to <vscale x 4 x i64>
552 %vd = zext <vscale x 4 x i16> %vb to <vscale x 4 x i64>
553 %ve = mul <vscale x 4 x i64> %vc, %vd
554 ret <vscale x 4 x i64> %ve
557 define <vscale x 4 x i64> @vwmulsu_vv_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb) {
558 ; CHECK-LABEL: vwmulsu_vv_nxv4i64_nxv4i16:
560 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
561 ; CHECK-NEXT: vsext.vf2 v12, v8
562 ; CHECK-NEXT: vzext.vf2 v14, v9
563 ; CHECK-NEXT: vwmulsu.vv v8, v12, v14
565 %vc = sext <vscale x 4 x i16> %va to <vscale x 4 x i64>
566 %vd = zext <vscale x 4 x i16> %vb to <vscale x 4 x i64>
567 %ve = mul <vscale x 4 x i64> %vc, %vd
568 ret <vscale x 4 x i64> %ve
571 define <vscale x 4 x i64> @vwmul_vx_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, i16 %b) {
572 ; CHECK-LABEL: vwmul_vx_nxv4i64_nxv4i16:
574 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
575 ; CHECK-NEXT: vmv.v.x v9, a0
576 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
577 ; CHECK-NEXT: vsext.vf2 v12, v8
578 ; CHECK-NEXT: vsext.vf2 v14, v9
579 ; CHECK-NEXT: vwmul.vv v8, v12, v14
581 %head = insertelement <vscale x 4 x i16> undef, i16 %b, i16 0
582 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> undef, <vscale x 4 x i32> zeroinitializer
583 %vc = sext <vscale x 4 x i16> %va to <vscale x 4 x i64>
584 %vd = sext <vscale x 4 x i16> %splat to <vscale x 4 x i64>
585 %ve = mul <vscale x 4 x i64> %vc, %vd
586 ret <vscale x 4 x i64> %ve
589 define <vscale x 4 x i64> @vwmulu_vx_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, i16 %b) {
590 ; CHECK-LABEL: vwmulu_vx_nxv4i64_nxv4i16:
592 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
593 ; CHECK-NEXT: vwmulu.vx v12, v8, a0
594 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
595 ; CHECK-NEXT: vzext.vf2 v8, v12
597 %head = insertelement <vscale x 4 x i16> undef, i16 %b, i16 0
598 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> undef, <vscale x 4 x i32> zeroinitializer
599 %vc = zext <vscale x 4 x i16> %va to <vscale x 4 x i64>
600 %vd = zext <vscale x 4 x i16> %splat to <vscale x 4 x i64>
601 %ve = mul <vscale x 4 x i64> %vc, %vd
602 ret <vscale x 4 x i64> %ve
605 define <vscale x 4 x i64> @vwmulsu_vx_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, i16 %b) {
606 ; CHECK-LABEL: vwmulsu_vx_nxv4i64_nxv4i16:
608 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
609 ; CHECK-NEXT: vmv.v.x v9, a0
610 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
611 ; CHECK-NEXT: vsext.vf2 v12, v8
612 ; CHECK-NEXT: vzext.vf2 v14, v9
613 ; CHECK-NEXT: vwmulsu.vv v8, v12, v14
615 %head = insertelement <vscale x 4 x i16> undef, i16 %b, i16 0
616 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> undef, <vscale x 4 x i32> zeroinitializer
617 %vc = sext <vscale x 4 x i16> %va to <vscale x 4 x i64>
618 %vd = zext <vscale x 4 x i16> %splat to <vscale x 4 x i64>
619 %ve = mul <vscale x 4 x i64> %vc, %vd
620 ret <vscale x 4 x i64> %ve
623 define <vscale x 8 x i64> @vwmul_vv_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb) {
624 ; CHECK-LABEL: vwmul_vv_nxv8i64_nxv8i16:
626 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
627 ; CHECK-NEXT: vsext.vf2 v16, v8
628 ; CHECK-NEXT: vsext.vf2 v20, v10
629 ; CHECK-NEXT: vwmul.vv v8, v16, v20
631 %vc = sext <vscale x 8 x i16> %va to <vscale x 8 x i64>
632 %vd = sext <vscale x 8 x i16> %vb to <vscale x 8 x i64>
633 %ve = mul <vscale x 8 x i64> %vc, %vd
634 ret <vscale x 8 x i64> %ve
637 define <vscale x 8 x i64> @vwmulu_vv_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb) {
638 ; CHECK-LABEL: vwmulu_vv_nxv8i64_nxv8i16:
640 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
641 ; CHECK-NEXT: vwmulu.vv v16, v8, v10
642 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
643 ; CHECK-NEXT: vzext.vf2 v8, v16
645 %vc = zext <vscale x 8 x i16> %va to <vscale x 8 x i64>
646 %vd = zext <vscale x 8 x i16> %vb to <vscale x 8 x i64>
647 %ve = mul <vscale x 8 x i64> %vc, %vd
648 ret <vscale x 8 x i64> %ve
651 define <vscale x 8 x i64> @vwmulsu_vv_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb) {
652 ; CHECK-LABEL: vwmulsu_vv_nxv8i64_nxv8i16:
654 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
655 ; CHECK-NEXT: vsext.vf2 v16, v8
656 ; CHECK-NEXT: vzext.vf2 v20, v10
657 ; CHECK-NEXT: vwmulsu.vv v8, v16, v20
659 %vc = sext <vscale x 8 x i16> %va to <vscale x 8 x i64>
660 %vd = zext <vscale x 8 x i16> %vb to <vscale x 8 x i64>
661 %ve = mul <vscale x 8 x i64> %vc, %vd
662 ret <vscale x 8 x i64> %ve
665 define <vscale x 8 x i64> @vwmul_vx_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, i16 %b) {
666 ; CHECK-LABEL: vwmul_vx_nxv8i64_nxv8i16:
668 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
669 ; CHECK-NEXT: vmv.v.x v10, a0
670 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
671 ; CHECK-NEXT: vsext.vf2 v16, v8
672 ; CHECK-NEXT: vsext.vf2 v20, v10
673 ; CHECK-NEXT: vwmul.vv v8, v16, v20
675 %head = insertelement <vscale x 8 x i16> undef, i16 %b, i16 0
676 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
677 %vc = sext <vscale x 8 x i16> %va to <vscale x 8 x i64>
678 %vd = sext <vscale x 8 x i16> %splat to <vscale x 8 x i64>
679 %ve = mul <vscale x 8 x i64> %vc, %vd
680 ret <vscale x 8 x i64> %ve
683 define <vscale x 8 x i64> @vwmulu_vx_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, i16 %b) {
684 ; CHECK-LABEL: vwmulu_vx_nxv8i64_nxv8i16:
686 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
687 ; CHECK-NEXT: vwmulu.vx v16, v8, a0
688 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
689 ; CHECK-NEXT: vzext.vf2 v8, v16
691 %head = insertelement <vscale x 8 x i16> undef, i16 %b, i16 0
692 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
693 %vc = zext <vscale x 8 x i16> %va to <vscale x 8 x i64>
694 %vd = zext <vscale x 8 x i16> %splat to <vscale x 8 x i64>
695 %ve = mul <vscale x 8 x i64> %vc, %vd
696 ret <vscale x 8 x i64> %ve
699 define <vscale x 8 x i64> @vwmulsu_vx_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, i16 %b) {
700 ; CHECK-LABEL: vwmulsu_vx_nxv8i64_nxv8i16:
702 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
703 ; CHECK-NEXT: vmv.v.x v10, a0
704 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
705 ; CHECK-NEXT: vsext.vf2 v16, v8
706 ; CHECK-NEXT: vzext.vf2 v20, v10
707 ; CHECK-NEXT: vwmulsu.vv v8, v16, v20
709 %head = insertelement <vscale x 8 x i16> undef, i16 %b, i16 0
710 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
711 %vc = sext <vscale x 8 x i16> %va to <vscale x 8 x i64>
712 %vd = zext <vscale x 8 x i16> %splat to <vscale x 8 x i64>
713 %ve = mul <vscale x 8 x i64> %vc, %vd
714 ret <vscale x 8 x i64> %ve
717 define <vscale x 1 x i64> @vwmul_vv_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb) {
718 ; CHECK-LABEL: vwmul_vv_nxv1i64_nxv1i8:
720 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
721 ; CHECK-NEXT: vsext.vf4 v10, v8
722 ; CHECK-NEXT: vsext.vf4 v11, v9
723 ; CHECK-NEXT: vwmul.vv v8, v10, v11
725 %vc = sext <vscale x 1 x i8> %va to <vscale x 1 x i64>
726 %vd = sext <vscale x 1 x i8> %vb to <vscale x 1 x i64>
727 %ve = mul <vscale x 1 x i64> %vc, %vd
728 ret <vscale x 1 x i64> %ve
731 define <vscale x 1 x i64> @vwmulu_vv_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb) {
732 ; CHECK-LABEL: vwmulu_vv_nxv1i64_nxv1i8:
734 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
735 ; CHECK-NEXT: vwmulu.vv v10, v8, v9
736 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
737 ; CHECK-NEXT: vzext.vf4 v8, v10
739 %vc = zext <vscale x 1 x i8> %va to <vscale x 1 x i64>
740 %vd = zext <vscale x 1 x i8> %vb to <vscale x 1 x i64>
741 %ve = mul <vscale x 1 x i64> %vc, %vd
742 ret <vscale x 1 x i64> %ve
745 define <vscale x 1 x i64> @vwmulsu_vv_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb) {
746 ; CHECK-LABEL: vwmulsu_vv_nxv1i64_nxv1i8:
748 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
749 ; CHECK-NEXT: vsext.vf4 v10, v8
750 ; CHECK-NEXT: vzext.vf4 v11, v9
751 ; CHECK-NEXT: vwmulsu.vv v8, v10, v11
753 %vc = sext <vscale x 1 x i8> %va to <vscale x 1 x i64>
754 %vd = zext <vscale x 1 x i8> %vb to <vscale x 1 x i64>
755 %ve = mul <vscale x 1 x i64> %vc, %vd
756 ret <vscale x 1 x i64> %ve
759 define <vscale x 1 x i64> @vwmul_vx_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, i8 %b) {
760 ; CHECK-LABEL: vwmul_vx_nxv1i64_nxv1i8:
762 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
763 ; CHECK-NEXT: vmv.v.x v9, a0
764 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
765 ; CHECK-NEXT: vsext.vf4 v10, v8
766 ; CHECK-NEXT: vsext.vf4 v11, v9
767 ; CHECK-NEXT: vwmul.vv v8, v10, v11
769 %head = insertelement <vscale x 1 x i8> undef, i8 %b, i8 0
770 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> undef, <vscale x 1 x i32> zeroinitializer
771 %vc = sext <vscale x 1 x i8> %va to <vscale x 1 x i64>
772 %vd = sext <vscale x 1 x i8> %splat to <vscale x 1 x i64>
773 %ve = mul <vscale x 1 x i64> %vc, %vd
774 ret <vscale x 1 x i64> %ve
777 define <vscale x 1 x i64> @vwmulu_vx_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, i8 %b) {
778 ; CHECK-LABEL: vwmulu_vx_nxv1i64_nxv1i8:
780 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
781 ; CHECK-NEXT: vwmulu.vx v9, v8, a0
782 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
783 ; CHECK-NEXT: vzext.vf4 v8, v9
785 %head = insertelement <vscale x 1 x i8> undef, i8 %b, i8 0
786 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> undef, <vscale x 1 x i32> zeroinitializer
787 %vc = zext <vscale x 1 x i8> %va to <vscale x 1 x i64>
788 %vd = zext <vscale x 1 x i8> %splat to <vscale x 1 x i64>
789 %ve = mul <vscale x 1 x i64> %vc, %vd
790 ret <vscale x 1 x i64> %ve
793 define <vscale x 1 x i64> @vwmulsu_vx_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, i8 %b) {
794 ; CHECK-LABEL: vwmulsu_vx_nxv1i64_nxv1i8:
796 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
797 ; CHECK-NEXT: vmv.v.x v9, a0
798 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
799 ; CHECK-NEXT: vsext.vf4 v10, v8
800 ; CHECK-NEXT: vzext.vf4 v11, v9
801 ; CHECK-NEXT: vwmulsu.vv v8, v10, v11
803 %head = insertelement <vscale x 1 x i8> undef, i8 %b, i8 0
804 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> undef, <vscale x 1 x i32> zeroinitializer
805 %vc = sext <vscale x 1 x i8> %va to <vscale x 1 x i64>
806 %vd = zext <vscale x 1 x i8> %splat to <vscale x 1 x i64>
807 %ve = mul <vscale x 1 x i64> %vc, %vd
808 ret <vscale x 1 x i64> %ve
811 define <vscale x 2 x i64> @vwmul_vv_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb) {
812 ; CHECK-LABEL: vwmul_vv_nxv2i64_nxv2i8:
814 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
815 ; CHECK-NEXT: vsext.vf4 v10, v8
816 ; CHECK-NEXT: vsext.vf4 v11, v9
817 ; CHECK-NEXT: vwmul.vv v8, v10, v11
819 %vc = sext <vscale x 2 x i8> %va to <vscale x 2 x i64>
820 %vd = sext <vscale x 2 x i8> %vb to <vscale x 2 x i64>
821 %ve = mul <vscale x 2 x i64> %vc, %vd
822 ret <vscale x 2 x i64> %ve
825 define <vscale x 2 x i64> @vwmulu_vv_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb) {
826 ; CHECK-LABEL: vwmulu_vv_nxv2i64_nxv2i8:
828 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
829 ; CHECK-NEXT: vwmulu.vv v10, v8, v9
830 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
831 ; CHECK-NEXT: vzext.vf4 v8, v10
833 %vc = zext <vscale x 2 x i8> %va to <vscale x 2 x i64>
834 %vd = zext <vscale x 2 x i8> %vb to <vscale x 2 x i64>
835 %ve = mul <vscale x 2 x i64> %vc, %vd
836 ret <vscale x 2 x i64> %ve
839 define <vscale x 2 x i64> @vwmulsu_vv_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb) {
840 ; CHECK-LABEL: vwmulsu_vv_nxv2i64_nxv2i8:
842 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
843 ; CHECK-NEXT: vsext.vf4 v10, v8
844 ; CHECK-NEXT: vzext.vf4 v11, v9
845 ; CHECK-NEXT: vwmulsu.vv v8, v10, v11
847 %vc = sext <vscale x 2 x i8> %va to <vscale x 2 x i64>
848 %vd = zext <vscale x 2 x i8> %vb to <vscale x 2 x i64>
849 %ve = mul <vscale x 2 x i64> %vc, %vd
850 ret <vscale x 2 x i64> %ve
853 define <vscale x 2 x i64> @vwmul_vx_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, i8 %b) {
854 ; CHECK-LABEL: vwmul_vx_nxv2i64_nxv2i8:
856 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
857 ; CHECK-NEXT: vmv.v.x v9, a0
858 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
859 ; CHECK-NEXT: vsext.vf4 v10, v8
860 ; CHECK-NEXT: vsext.vf4 v11, v9
861 ; CHECK-NEXT: vwmul.vv v8, v10, v11
863 %head = insertelement <vscale x 2 x i8> undef, i8 %b, i8 0
864 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> undef, <vscale x 2 x i32> zeroinitializer
865 %vc = sext <vscale x 2 x i8> %va to <vscale x 2 x i64>
866 %vd = sext <vscale x 2 x i8> %splat to <vscale x 2 x i64>
867 %ve = mul <vscale x 2 x i64> %vc, %vd
868 ret <vscale x 2 x i64> %ve
871 define <vscale x 2 x i64> @vwmulu_vx_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, i8 %b) {
872 ; CHECK-LABEL: vwmulu_vx_nxv2i64_nxv2i8:
874 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
875 ; CHECK-NEXT: vwmulu.vx v10, v8, a0
876 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
877 ; CHECK-NEXT: vzext.vf4 v8, v10
879 %head = insertelement <vscale x 2 x i8> undef, i8 %b, i8 0
880 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> undef, <vscale x 2 x i32> zeroinitializer
881 %vc = zext <vscale x 2 x i8> %va to <vscale x 2 x i64>
882 %vd = zext <vscale x 2 x i8> %splat to <vscale x 2 x i64>
883 %ve = mul <vscale x 2 x i64> %vc, %vd
884 ret <vscale x 2 x i64> %ve
887 define <vscale x 2 x i64> @vwmulsu_vx_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, i8 %b) {
888 ; CHECK-LABEL: vwmulsu_vx_nxv2i64_nxv2i8:
890 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
891 ; CHECK-NEXT: vmv.v.x v9, a0
892 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
893 ; CHECK-NEXT: vsext.vf4 v10, v8
894 ; CHECK-NEXT: vzext.vf4 v11, v9
895 ; CHECK-NEXT: vwmulsu.vv v8, v10, v11
897 %head = insertelement <vscale x 2 x i8> undef, i8 %b, i8 0
898 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> undef, <vscale x 2 x i32> zeroinitializer
899 %vc = sext <vscale x 2 x i8> %va to <vscale x 2 x i64>
900 %vd = zext <vscale x 2 x i8> %splat to <vscale x 2 x i64>
901 %ve = mul <vscale x 2 x i64> %vc, %vd
902 ret <vscale x 2 x i64> %ve
905 define <vscale x 4 x i64> @vwmul_vv_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb) {
906 ; CHECK-LABEL: vwmul_vv_nxv4i64_nxv4i8:
908 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
909 ; CHECK-NEXT: vsext.vf4 v12, v8
910 ; CHECK-NEXT: vsext.vf4 v14, v9
911 ; CHECK-NEXT: vwmul.vv v8, v12, v14
913 %vc = sext <vscale x 4 x i8> %va to <vscale x 4 x i64>
914 %vd = sext <vscale x 4 x i8> %vb to <vscale x 4 x i64>
915 %ve = mul <vscale x 4 x i64> %vc, %vd
916 ret <vscale x 4 x i64> %ve
919 define <vscale x 4 x i64> @vwmulu_vv_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb) {
920 ; CHECK-LABEL: vwmulu_vv_nxv4i64_nxv4i8:
922 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
923 ; CHECK-NEXT: vwmulu.vv v12, v8, v9
924 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
925 ; CHECK-NEXT: vzext.vf4 v8, v12
927 %vc = zext <vscale x 4 x i8> %va to <vscale x 4 x i64>
928 %vd = zext <vscale x 4 x i8> %vb to <vscale x 4 x i64>
929 %ve = mul <vscale x 4 x i64> %vc, %vd
930 ret <vscale x 4 x i64> %ve
933 define <vscale x 4 x i64> @vwmulsu_vv_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb) {
934 ; CHECK-LABEL: vwmulsu_vv_nxv4i64_nxv4i8:
936 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
937 ; CHECK-NEXT: vsext.vf4 v12, v8
938 ; CHECK-NEXT: vzext.vf4 v14, v9
939 ; CHECK-NEXT: vwmulsu.vv v8, v12, v14
941 %vc = sext <vscale x 4 x i8> %va to <vscale x 4 x i64>
942 %vd = zext <vscale x 4 x i8> %vb to <vscale x 4 x i64>
943 %ve = mul <vscale x 4 x i64> %vc, %vd
944 ret <vscale x 4 x i64> %ve
947 define <vscale x 4 x i64> @vwmul_vx_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, i8 %b) {
948 ; CHECK-LABEL: vwmul_vx_nxv4i64_nxv4i8:
950 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
951 ; CHECK-NEXT: vmv.v.x v9, a0
952 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
953 ; CHECK-NEXT: vsext.vf4 v12, v8
954 ; CHECK-NEXT: vsext.vf4 v14, v9
955 ; CHECK-NEXT: vwmul.vv v8, v12, v14
957 %head = insertelement <vscale x 4 x i8> undef, i8 %b, i8 0
958 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> undef, <vscale x 4 x i32> zeroinitializer
959 %vc = sext <vscale x 4 x i8> %va to <vscale x 4 x i64>
960 %vd = sext <vscale x 4 x i8> %splat to <vscale x 4 x i64>
961 %ve = mul <vscale x 4 x i64> %vc, %vd
962 ret <vscale x 4 x i64> %ve
965 define <vscale x 4 x i64> @vwmulu_vx_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, i8 %b) {
966 ; CHECK-LABEL: vwmulu_vx_nxv4i64_nxv4i8:
968 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
969 ; CHECK-NEXT: vwmulu.vx v12, v8, a0
970 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
971 ; CHECK-NEXT: vzext.vf4 v8, v12
973 %head = insertelement <vscale x 4 x i8> undef, i8 %b, i8 0
974 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> undef, <vscale x 4 x i32> zeroinitializer
975 %vc = zext <vscale x 4 x i8> %va to <vscale x 4 x i64>
976 %vd = zext <vscale x 4 x i8> %splat to <vscale x 4 x i64>
977 %ve = mul <vscale x 4 x i64> %vc, %vd
978 ret <vscale x 4 x i64> %ve
981 define <vscale x 4 x i64> @vwmulsu_vx_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, i8 %b) {
982 ; CHECK-LABEL: vwmulsu_vx_nxv4i64_nxv4i8:
984 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
985 ; CHECK-NEXT: vmv.v.x v9, a0
986 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
987 ; CHECK-NEXT: vsext.vf4 v12, v8
988 ; CHECK-NEXT: vzext.vf4 v14, v9
989 ; CHECK-NEXT: vwmulsu.vv v8, v12, v14
991 %head = insertelement <vscale x 4 x i8> undef, i8 %b, i8 0
992 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> undef, <vscale x 4 x i32> zeroinitializer
993 %vc = sext <vscale x 4 x i8> %va to <vscale x 4 x i64>
994 %vd = zext <vscale x 4 x i8> %splat to <vscale x 4 x i64>
995 %ve = mul <vscale x 4 x i64> %vc, %vd
996 ret <vscale x 4 x i64> %ve
999 define <vscale x 8 x i64> @vwmul_vv_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb) {
1000 ; CHECK-LABEL: vwmul_vv_nxv8i64_nxv8i8:
1002 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
1003 ; CHECK-NEXT: vsext.vf4 v16, v8
1004 ; CHECK-NEXT: vsext.vf4 v20, v9
1005 ; CHECK-NEXT: vwmul.vv v8, v16, v20
1007 %vc = sext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1008 %vd = sext <vscale x 8 x i8> %vb to <vscale x 8 x i64>
1009 %ve = mul <vscale x 8 x i64> %vc, %vd
1010 ret <vscale x 8 x i64> %ve
1013 define <vscale x 8 x i64> @vwmulu_vv_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb) {
1014 ; CHECK-LABEL: vwmulu_vv_nxv8i64_nxv8i8:
1016 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
1017 ; CHECK-NEXT: vwmulu.vv v16, v8, v9
1018 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1019 ; CHECK-NEXT: vzext.vf4 v8, v16
1021 %vc = zext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1022 %vd = zext <vscale x 8 x i8> %vb to <vscale x 8 x i64>
1023 %ve = mul <vscale x 8 x i64> %vc, %vd
1024 ret <vscale x 8 x i64> %ve
1027 define <vscale x 8 x i64> @vwmulsu_vv_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb) {
1028 ; CHECK-LABEL: vwmulsu_vv_nxv8i64_nxv8i8:
1030 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
1031 ; CHECK-NEXT: vsext.vf4 v16, v8
1032 ; CHECK-NEXT: vzext.vf4 v20, v9
1033 ; CHECK-NEXT: vwmulsu.vv v8, v16, v20
1035 %vc = sext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1036 %vd = zext <vscale x 8 x i8> %vb to <vscale x 8 x i64>
1037 %ve = mul <vscale x 8 x i64> %vc, %vd
1038 ret <vscale x 8 x i64> %ve
1041 define <vscale x 8 x i64> @vwmul_vx_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, i8 %b) {
1042 ; CHECK-LABEL: vwmul_vx_nxv8i64_nxv8i8:
1044 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
1045 ; CHECK-NEXT: vmv.v.x v9, a0
1046 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
1047 ; CHECK-NEXT: vsext.vf4 v16, v8
1048 ; CHECK-NEXT: vsext.vf4 v20, v9
1049 ; CHECK-NEXT: vwmul.vv v8, v16, v20
1051 %head = insertelement <vscale x 8 x i8> undef, i8 %b, i8 0
1052 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> undef, <vscale x 8 x i32> zeroinitializer
1053 %vc = sext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1054 %vd = sext <vscale x 8 x i8> %splat to <vscale x 8 x i64>
1055 %ve = mul <vscale x 8 x i64> %vc, %vd
1056 ret <vscale x 8 x i64> %ve
1059 define <vscale x 8 x i64> @vwmulu_vx_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, i8 %b) {
1060 ; CHECK-LABEL: vwmulu_vx_nxv8i64_nxv8i8:
1062 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
1063 ; CHECK-NEXT: vwmulu.vx v16, v8, a0
1064 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1065 ; CHECK-NEXT: vzext.vf4 v8, v16
1067 %head = insertelement <vscale x 8 x i8> undef, i8 %b, i8 0
1068 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> undef, <vscale x 8 x i32> zeroinitializer
1069 %vc = zext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1070 %vd = zext <vscale x 8 x i8> %splat to <vscale x 8 x i64>
1071 %ve = mul <vscale x 8 x i64> %vc, %vd
1072 ret <vscale x 8 x i64> %ve
1075 define <vscale x 8 x i64> @vwmulsu_vx_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, i8 %b) {
1076 ; CHECK-LABEL: vwmulsu_vx_nxv8i64_nxv8i8:
1078 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
1079 ; CHECK-NEXT: vmv.v.x v9, a0
1080 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
1081 ; CHECK-NEXT: vsext.vf4 v16, v8
1082 ; CHECK-NEXT: vzext.vf4 v20, v9
1083 ; CHECK-NEXT: vwmulsu.vv v8, v16, v20
1085 %head = insertelement <vscale x 8 x i8> undef, i8 %b, i8 0
1086 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> undef, <vscale x 8 x i32> zeroinitializer
1087 %vc = sext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1088 %vd = zext <vscale x 8 x i8> %splat to <vscale x 8 x i64>
1089 %ve = mul <vscale x 8 x i64> %vc, %vd
1090 ret <vscale x 8 x i64> %ve