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> @vwsub_vv_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb) {
6 ; CHECK-LABEL: vwsub_vv_nxv1i64_nxv1i32:
8 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
9 ; CHECK-NEXT: vwsub.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 = sub <vscale x 1 x i64> %vc, %vd
15 ret <vscale x 1 x i64> %ve
18 define <vscale x 1 x i64> @vwsubu_vv_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb) {
19 ; CHECK-LABEL: vwsubu_vv_nxv1i64_nxv1i32:
21 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
22 ; CHECK-NEXT: vwsubu.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 = sub <vscale x 1 x i64> %vc, %vd
28 ret <vscale x 1 x i64> %ve
31 define <vscale x 1 x i64> @vwsub_vx_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, i32 %b) {
32 ; CHECK-LABEL: vwsub_vx_nxv1i64_nxv1i32:
34 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
35 ; CHECK-NEXT: vwsub.vx v9, v8, a0
36 ; CHECK-NEXT: vmv1r.v v8, v9
38 %head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
39 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
40 %vc = sext <vscale x 1 x i32> %va to <vscale x 1 x i64>
41 %vd = sext <vscale x 1 x i32> %splat to <vscale x 1 x i64>
42 %ve = sub <vscale x 1 x i64> %vc, %vd
43 ret <vscale x 1 x i64> %ve
46 define <vscale x 1 x i64> @vwsubu_vx_nxv1i64_nxv1i32(<vscale x 1 x i32> %va, i32 %b) {
47 ; CHECK-LABEL: vwsubu_vx_nxv1i64_nxv1i32:
49 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
50 ; CHECK-NEXT: vwsubu.vx v9, v8, a0
51 ; CHECK-NEXT: vmv1r.v v8, v9
53 %head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
54 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
55 %vc = zext <vscale x 1 x i32> %va to <vscale x 1 x i64>
56 %vd = zext <vscale x 1 x i32> %splat to <vscale x 1 x i64>
57 %ve = sub <vscale x 1 x i64> %vc, %vd
58 ret <vscale x 1 x i64> %ve
61 define <vscale x 1 x i64> @vwsub_wv_nxv1i64_nxv1i32(<vscale x 1 x i64> %va, <vscale x 1 x i32> %vb) {
62 ; CHECK-LABEL: vwsub_wv_nxv1i64_nxv1i32:
64 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
65 ; CHECK-NEXT: vwsub.wv v8, v8, v9
67 %vc = sext <vscale x 1 x i32> %vb to <vscale x 1 x i64>
68 %vd = sub <vscale x 1 x i64> %va, %vc
69 ret <vscale x 1 x i64> %vd
72 define <vscale x 1 x i64> @vwsubu_wv_nxv1i64_nxv1i32(<vscale x 1 x i64> %va, <vscale x 1 x i32> %vb) {
73 ; CHECK-LABEL: vwsubu_wv_nxv1i64_nxv1i32:
75 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
76 ; CHECK-NEXT: vwsubu.wv v8, v8, v9
78 %vc = zext <vscale x 1 x i32> %vb to <vscale x 1 x i64>
79 %vd = sub <vscale x 1 x i64> %va, %vc
80 ret <vscale x 1 x i64> %vd
83 define <vscale x 1 x i64> @vwsub_wx_nxv1i64_nxv1i32(<vscale x 1 x i64> %va, i32 %b) {
84 ; CHECK-LABEL: vwsub_wx_nxv1i64_nxv1i32:
86 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
87 ; CHECK-NEXT: vwsub.wx v8, v8, a0
89 %head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
90 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
91 %vb = sext <vscale x 1 x i32> %splat to <vscale x 1 x i64>
92 %vc = sub <vscale x 1 x i64> %va, %vb
93 ret <vscale x 1 x i64> %vc
96 define <vscale x 1 x i64> @vwsubu_wx_nxv1i64_nxv1i32(<vscale x 1 x i64> %va, i32 %b) {
97 ; CHECK-LABEL: vwsubu_wx_nxv1i64_nxv1i32:
99 ; CHECK-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
100 ; CHECK-NEXT: vwsubu.wx v8, v8, a0
102 %head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
103 %splat = shufflevector <vscale x 1 x i32> %head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
104 %vb = zext <vscale x 1 x i32> %splat to <vscale x 1 x i64>
105 %vc = sub <vscale x 1 x i64> %va, %vb
106 ret <vscale x 1 x i64> %vc
109 define <vscale x 2 x i64> @vwsub_vv_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb) {
110 ; CHECK-LABEL: vwsub_vv_nxv2i64_nxv2i32:
112 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
113 ; CHECK-NEXT: vwsub.vv v10, v8, v9
114 ; CHECK-NEXT: vmv2r.v v8, v10
116 %vc = sext <vscale x 2 x i32> %va to <vscale x 2 x i64>
117 %vd = sext <vscale x 2 x i32> %vb to <vscale x 2 x i64>
118 %ve = sub <vscale x 2 x i64> %vc, %vd
119 ret <vscale x 2 x i64> %ve
122 define <vscale x 2 x i64> @vwsubu_vv_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb) {
123 ; CHECK-LABEL: vwsubu_vv_nxv2i64_nxv2i32:
125 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
126 ; CHECK-NEXT: vwsubu.vv v10, v8, v9
127 ; CHECK-NEXT: vmv2r.v v8, v10
129 %vc = zext <vscale x 2 x i32> %va to <vscale x 2 x i64>
130 %vd = zext <vscale x 2 x i32> %vb to <vscale x 2 x i64>
131 %ve = sub <vscale x 2 x i64> %vc, %vd
132 ret <vscale x 2 x i64> %ve
135 define <vscale x 2 x i64> @vwsub_vx_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, i32 %b) {
136 ; CHECK-LABEL: vwsub_vx_nxv2i64_nxv2i32:
138 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
139 ; CHECK-NEXT: vwsub.vx v10, v8, a0
140 ; CHECK-NEXT: vmv2r.v v8, v10
142 %head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
143 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
144 %vc = sext <vscale x 2 x i32> %va to <vscale x 2 x i64>
145 %vd = sext <vscale x 2 x i32> %splat to <vscale x 2 x i64>
146 %ve = sub <vscale x 2 x i64> %vc, %vd
147 ret <vscale x 2 x i64> %ve
150 define <vscale x 2 x i64> @vwsubu_vx_nxv2i64_nxv2i32(<vscale x 2 x i32> %va, i32 %b) {
151 ; CHECK-LABEL: vwsubu_vx_nxv2i64_nxv2i32:
153 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
154 ; CHECK-NEXT: vwsubu.vx v10, v8, a0
155 ; CHECK-NEXT: vmv2r.v v8, v10
157 %head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
158 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
159 %vc = zext <vscale x 2 x i32> %va to <vscale x 2 x i64>
160 %vd = zext <vscale x 2 x i32> %splat to <vscale x 2 x i64>
161 %ve = sub <vscale x 2 x i64> %vc, %vd
162 ret <vscale x 2 x i64> %ve
165 define <vscale x 2 x i64> @vwsub_wv_nxv2i64_nxv2i32(<vscale x 2 x i64> %va, <vscale x 2 x i32> %vb) {
166 ; CHECK-LABEL: vwsub_wv_nxv2i64_nxv2i32:
168 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
169 ; CHECK-NEXT: vwsub.wv v8, v8, v10
171 %vc = sext <vscale x 2 x i32> %vb to <vscale x 2 x i64>
172 %vd = sub <vscale x 2 x i64> %va, %vc
173 ret <vscale x 2 x i64> %vd
176 define <vscale x 2 x i64> @vwsubu_wv_nxv2i64_nxv2i32(<vscale x 2 x i64> %va, <vscale x 2 x i32> %vb) {
177 ; CHECK-LABEL: vwsubu_wv_nxv2i64_nxv2i32:
179 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
180 ; CHECK-NEXT: vwsubu.wv v8, v8, v10
182 %vc = zext <vscale x 2 x i32> %vb to <vscale x 2 x i64>
183 %vd = sub <vscale x 2 x i64> %va, %vc
184 ret <vscale x 2 x i64> %vd
187 define <vscale x 2 x i64> @vwsub_wx_nxv2i64_nxv2i32(<vscale x 2 x i64> %va, i32 %b) {
188 ; CHECK-LABEL: vwsub_wx_nxv2i64_nxv2i32:
190 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
191 ; CHECK-NEXT: vwsub.wx v8, v8, a0
193 %head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
194 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
195 %vb = sext <vscale x 2 x i32> %splat to <vscale x 2 x i64>
196 %vc = sub <vscale x 2 x i64> %va, %vb
197 ret <vscale x 2 x i64> %vc
200 define <vscale x 2 x i64> @vwsubu_wx_nxv2i64_nxv2i32(<vscale x 2 x i64> %va, i32 %b) {
201 ; CHECK-LABEL: vwsubu_wx_nxv2i64_nxv2i32:
203 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
204 ; CHECK-NEXT: vwsubu.wx v8, v8, a0
206 %head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
207 %splat = shufflevector <vscale x 2 x i32> %head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
208 %vb = zext <vscale x 2 x i32> %splat to <vscale x 2 x i64>
209 %vc = sub <vscale x 2 x i64> %va, %vb
210 ret <vscale x 2 x i64> %vc
213 define <vscale x 4 x i64> @vwsub_vv_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb) {
214 ; CHECK-LABEL: vwsub_vv_nxv4i64_nxv4i32:
216 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
217 ; CHECK-NEXT: vwsub.vv v12, v8, v10
218 ; CHECK-NEXT: vmv4r.v v8, v12
220 %vc = sext <vscale x 4 x i32> %va to <vscale x 4 x i64>
221 %vd = sext <vscale x 4 x i32> %vb to <vscale x 4 x i64>
222 %ve = sub <vscale x 4 x i64> %vc, %vd
223 ret <vscale x 4 x i64> %ve
226 define <vscale x 4 x i64> @vwsubu_vv_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb) {
227 ; CHECK-LABEL: vwsubu_vv_nxv4i64_nxv4i32:
229 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
230 ; CHECK-NEXT: vwsubu.vv v12, v8, v10
231 ; CHECK-NEXT: vmv4r.v v8, v12
233 %vc = zext <vscale x 4 x i32> %va to <vscale x 4 x i64>
234 %vd = zext <vscale x 4 x i32> %vb to <vscale x 4 x i64>
235 %ve = sub <vscale x 4 x i64> %vc, %vd
236 ret <vscale x 4 x i64> %ve
239 define <vscale x 4 x i64> @vwsub_vx_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, i32 %b) {
240 ; CHECK-LABEL: vwsub_vx_nxv4i64_nxv4i32:
242 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
243 ; CHECK-NEXT: vwsub.vx v12, v8, a0
244 ; CHECK-NEXT: vmv4r.v v8, v12
246 %head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
247 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
248 %vc = sext <vscale x 4 x i32> %va to <vscale x 4 x i64>
249 %vd = sext <vscale x 4 x i32> %splat to <vscale x 4 x i64>
250 %ve = sub <vscale x 4 x i64> %vc, %vd
251 ret <vscale x 4 x i64> %ve
254 define <vscale x 4 x i64> @vwsubu_vx_nxv4i64_nxv4i32(<vscale x 4 x i32> %va, i32 %b) {
255 ; CHECK-LABEL: vwsubu_vx_nxv4i64_nxv4i32:
257 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
258 ; CHECK-NEXT: vwsubu.vx v12, v8, a0
259 ; CHECK-NEXT: vmv4r.v v8, v12
261 %head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
262 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
263 %vc = zext <vscale x 4 x i32> %va to <vscale x 4 x i64>
264 %vd = zext <vscale x 4 x i32> %splat to <vscale x 4 x i64>
265 %ve = sub <vscale x 4 x i64> %vc, %vd
266 ret <vscale x 4 x i64> %ve
269 define <vscale x 4 x i64> @vwsub_wv_nxv4i64_nxv4i32(<vscale x 4 x i64> %va, <vscale x 4 x i32> %vb) {
270 ; CHECK-LABEL: vwsub_wv_nxv4i64_nxv4i32:
272 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
273 ; CHECK-NEXT: vwsub.wv v8, v8, v12
275 %vc = sext <vscale x 4 x i32> %vb to <vscale x 4 x i64>
276 %vd = sub <vscale x 4 x i64> %va, %vc
277 ret <vscale x 4 x i64> %vd
280 define <vscale x 4 x i64> @vwsubu_wv_nxv4i64_nxv4i32(<vscale x 4 x i64> %va, <vscale x 4 x i32> %vb) {
281 ; CHECK-LABEL: vwsubu_wv_nxv4i64_nxv4i32:
283 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
284 ; CHECK-NEXT: vwsubu.wv v8, v8, v12
286 %vc = zext <vscale x 4 x i32> %vb to <vscale x 4 x i64>
287 %vd = sub <vscale x 4 x i64> %va, %vc
288 ret <vscale x 4 x i64> %vd
291 define <vscale x 4 x i64> @vwsub_wx_nxv4i64_nxv4i32(<vscale x 4 x i64> %va, i32 %b) {
292 ; CHECK-LABEL: vwsub_wx_nxv4i64_nxv4i32:
294 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
295 ; CHECK-NEXT: vwsub.wx v8, v8, a0
297 %head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
298 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
299 %vb = sext <vscale x 4 x i32> %splat to <vscale x 4 x i64>
300 %vc = sub <vscale x 4 x i64> %va, %vb
301 ret <vscale x 4 x i64> %vc
304 define <vscale x 4 x i64> @vwsubu_wx_nxv4i64_nxv4i32(<vscale x 4 x i64> %va, i32 %b) {
305 ; CHECK-LABEL: vwsubu_wx_nxv4i64_nxv4i32:
307 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
308 ; CHECK-NEXT: vwsubu.wx v8, v8, a0
310 %head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
311 %splat = shufflevector <vscale x 4 x i32> %head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
312 %vb = zext <vscale x 4 x i32> %splat to <vscale x 4 x i64>
313 %vc = sub <vscale x 4 x i64> %va, %vb
314 ret <vscale x 4 x i64> %vc
317 define <vscale x 8 x i64> @vwsub_vv_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb) {
318 ; CHECK-LABEL: vwsub_vv_nxv8i64_nxv8i32:
320 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
321 ; CHECK-NEXT: vwsub.vv v16, v8, v12
322 ; CHECK-NEXT: vmv8r.v v8, v16
324 %vc = sext <vscale x 8 x i32> %va to <vscale x 8 x i64>
325 %vd = sext <vscale x 8 x i32> %vb to <vscale x 8 x i64>
326 %ve = sub <vscale x 8 x i64> %vc, %vd
327 ret <vscale x 8 x i64> %ve
330 define <vscale x 8 x i64> @vwsubu_vv_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb) {
331 ; CHECK-LABEL: vwsubu_vv_nxv8i64_nxv8i32:
333 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
334 ; CHECK-NEXT: vwsubu.vv v16, v8, v12
335 ; CHECK-NEXT: vmv8r.v v8, v16
337 %vc = zext <vscale x 8 x i32> %va to <vscale x 8 x i64>
338 %vd = zext <vscale x 8 x i32> %vb to <vscale x 8 x i64>
339 %ve = sub <vscale x 8 x i64> %vc, %vd
340 ret <vscale x 8 x i64> %ve
343 define <vscale x 8 x i64> @vwsub_vx_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, i32 %b) {
344 ; CHECK-LABEL: vwsub_vx_nxv8i64_nxv8i32:
346 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
347 ; CHECK-NEXT: vwsub.vx v16, v8, a0
348 ; CHECK-NEXT: vmv8r.v v8, v16
350 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
351 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
352 %vc = sext <vscale x 8 x i32> %va to <vscale x 8 x i64>
353 %vd = sext <vscale x 8 x i32> %splat to <vscale x 8 x i64>
354 %ve = sub <vscale x 8 x i64> %vc, %vd
355 ret <vscale x 8 x i64> %ve
358 define <vscale x 8 x i64> @vwsubu_vx_nxv8i64_nxv8i32(<vscale x 8 x i32> %va, i32 %b) {
359 ; CHECK-LABEL: vwsubu_vx_nxv8i64_nxv8i32:
361 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
362 ; CHECK-NEXT: vwsubu.vx v16, v8, a0
363 ; CHECK-NEXT: vmv8r.v v8, v16
365 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
366 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
367 %vc = zext <vscale x 8 x i32> %va to <vscale x 8 x i64>
368 %vd = zext <vscale x 8 x i32> %splat to <vscale x 8 x i64>
369 %ve = sub <vscale x 8 x i64> %vc, %vd
370 ret <vscale x 8 x i64> %ve
373 define <vscale x 8 x i64> @vwsub_wv_nxv8i64_nxv8i32(<vscale x 8 x i64> %va, <vscale x 8 x i32> %vb) {
374 ; CHECK-LABEL: vwsub_wv_nxv8i64_nxv8i32:
376 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
377 ; CHECK-NEXT: vwsub.wv v8, v8, v16
379 %vc = sext <vscale x 8 x i32> %vb to <vscale x 8 x i64>
380 %vd = sub <vscale x 8 x i64> %va, %vc
381 ret <vscale x 8 x i64> %vd
384 define <vscale x 8 x i64> @vwsubu_wv_nxv8i64_nxv8i32(<vscale x 8 x i64> %va, <vscale x 8 x i32> %vb) {
385 ; CHECK-LABEL: vwsubu_wv_nxv8i64_nxv8i32:
387 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
388 ; CHECK-NEXT: vwsubu.wv v8, v8, v16
390 %vc = zext <vscale x 8 x i32> %vb to <vscale x 8 x i64>
391 %vd = sub <vscale x 8 x i64> %va, %vc
392 ret <vscale x 8 x i64> %vd
395 define <vscale x 8 x i64> @vwsub_wx_nxv8i64_nxv8i32(<vscale x 8 x i64> %va, i32 %b) {
396 ; CHECK-LABEL: vwsub_wx_nxv8i64_nxv8i32:
398 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
399 ; CHECK-NEXT: vwsub.wx v8, v8, a0
401 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
402 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
403 %vb = sext <vscale x 8 x i32> %splat to <vscale x 8 x i64>
404 %vc = sub <vscale x 8 x i64> %va, %vb
405 ret <vscale x 8 x i64> %vc
408 define <vscale x 8 x i64> @vwsubu_wx_nxv8i64_nxv8i32(<vscale x 8 x i64> %va, i32 %b) {
409 ; CHECK-LABEL: vwsubu_wx_nxv8i64_nxv8i32:
411 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
412 ; CHECK-NEXT: vwsubu.wx v8, v8, a0
414 %head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
415 %splat = shufflevector <vscale x 8 x i32> %head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
416 %vb = zext <vscale x 8 x i32> %splat to <vscale x 8 x i64>
417 %vc = sub <vscale x 8 x i64> %va, %vb
418 ret <vscale x 8 x i64> %vc
421 define <vscale x 1 x i64> @vwsub_vv_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb) {
422 ; CHECK-LABEL: vwsub_vv_nxv1i64_nxv1i16:
424 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
425 ; CHECK-NEXT: vsext.vf2 v10, v8
426 ; CHECK-NEXT: vsext.vf2 v11, v9
427 ; CHECK-NEXT: vwsub.vv v8, v10, v11
429 %vc = sext <vscale x 1 x i16> %va to <vscale x 1 x i64>
430 %vd = sext <vscale x 1 x i16> %vb to <vscale x 1 x i64>
431 %ve = sub <vscale x 1 x i64> %vc, %vd
432 ret <vscale x 1 x i64> %ve
435 define <vscale x 1 x i64> @vwsubu_vv_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb) {
436 ; CHECK-LABEL: vwsubu_vv_nxv1i64_nxv1i16:
438 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
439 ; CHECK-NEXT: vwsubu.vv v10, v8, v9
440 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
441 ; CHECK-NEXT: vsext.vf2 v8, v10
443 %vc = zext <vscale x 1 x i16> %va to <vscale x 1 x i64>
444 %vd = zext <vscale x 1 x i16> %vb to <vscale x 1 x i64>
445 %ve = sub <vscale x 1 x i64> %vc, %vd
446 ret <vscale x 1 x i64> %ve
449 define <vscale x 1 x i64> @vwsub_vx_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, i16 %b) {
450 ; CHECK-LABEL: vwsub_vx_nxv1i64_nxv1i16:
452 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
453 ; CHECK-NEXT: vmv.v.x v9, a0
454 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
455 ; CHECK-NEXT: vsext.vf2 v10, v8
456 ; CHECK-NEXT: vsext.vf2 v11, v9
457 ; CHECK-NEXT: vwsub.vv v8, v10, v11
459 %head = insertelement <vscale x 1 x i16> poison, i16 %b, i16 0
460 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
461 %vc = sext <vscale x 1 x i16> %va to <vscale x 1 x i64>
462 %vd = sext <vscale x 1 x i16> %splat to <vscale x 1 x i64>
463 %ve = sub <vscale x 1 x i64> %vc, %vd
464 ret <vscale x 1 x i64> %ve
467 define <vscale x 1 x i64> @vwsubu_vx_nxv1i64_nxv1i16(<vscale x 1 x i16> %va, i16 %b) {
468 ; CHECK-LABEL: vwsubu_vx_nxv1i64_nxv1i16:
470 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
471 ; CHECK-NEXT: vwsubu.vx v9, v8, a0
472 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
473 ; CHECK-NEXT: vsext.vf2 v8, v9
475 %head = insertelement <vscale x 1 x i16> poison, i16 %b, i16 0
476 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
477 %vc = zext <vscale x 1 x i16> %va to <vscale x 1 x i64>
478 %vd = zext <vscale x 1 x i16> %splat to <vscale x 1 x i64>
479 %ve = sub <vscale x 1 x i64> %vc, %vd
480 ret <vscale x 1 x i64> %ve
483 define <vscale x 1 x i64> @vwsub_wv_nxv1i64_nxv1i16(<vscale x 1 x i64> %va, <vscale x 1 x i16> %vb) {
484 ; CHECK-LABEL: vwsub_wv_nxv1i64_nxv1i16:
486 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
487 ; CHECK-NEXT: vsext.vf2 v10, v9
488 ; CHECK-NEXT: vwsub.wv v8, v8, v10
490 %vc = sext <vscale x 1 x i16> %vb to <vscale x 1 x i64>
491 %vd = sub <vscale x 1 x i64> %va, %vc
492 ret <vscale x 1 x i64> %vd
495 define <vscale x 1 x i64> @vwsubu_wv_nxv1i64_nxv1i16(<vscale x 1 x i64> %va, <vscale x 1 x i16> %vb) {
496 ; CHECK-LABEL: vwsubu_wv_nxv1i64_nxv1i16:
498 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
499 ; CHECK-NEXT: vzext.vf2 v10, v9
500 ; CHECK-NEXT: vwsubu.wv v8, v8, v10
502 %vc = zext <vscale x 1 x i16> %vb to <vscale x 1 x i64>
503 %vd = sub <vscale x 1 x i64> %va, %vc
504 ret <vscale x 1 x i64> %vd
507 define <vscale x 1 x i64> @vwsub_wx_nxv1i64_nxv1i16(<vscale x 1 x i64> %va, i16 %b) {
508 ; CHECK-LABEL: vwsub_wx_nxv1i64_nxv1i16:
510 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
511 ; CHECK-NEXT: vmv.v.x v9, a0
512 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
513 ; CHECK-NEXT: vsext.vf2 v10, v9
514 ; CHECK-NEXT: vwsub.wv v8, v8, v10
516 %head = insertelement <vscale x 1 x i16> poison, i16 %b, i16 0
517 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
518 %vb = sext <vscale x 1 x i16> %splat to <vscale x 1 x i64>
519 %vc = sub <vscale x 1 x i64> %va, %vb
520 ret <vscale x 1 x i64> %vc
523 define <vscale x 1 x i64> @vwsubu_wx_nxv1i64_nxv1i16(<vscale x 1 x i64> %va, i16 %b) {
524 ; CHECK-LABEL: vwsubu_wx_nxv1i64_nxv1i16:
526 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
527 ; CHECK-NEXT: vmv.v.x v9, a0
528 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
529 ; CHECK-NEXT: vzext.vf2 v10, v9
530 ; CHECK-NEXT: vwsubu.wv v8, v8, v10
532 %head = insertelement <vscale x 1 x i16> poison, i16 %b, i16 0
533 %splat = shufflevector <vscale x 1 x i16> %head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
534 %vb = zext <vscale x 1 x i16> %splat to <vscale x 1 x i64>
535 %vc = sub <vscale x 1 x i64> %va, %vb
536 ret <vscale x 1 x i64> %vc
539 define <vscale x 2 x i64> @vwsub_vv_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb) {
540 ; CHECK-LABEL: vwsub_vv_nxv2i64_nxv2i16:
542 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
543 ; CHECK-NEXT: vsext.vf2 v10, v8
544 ; CHECK-NEXT: vsext.vf2 v11, v9
545 ; CHECK-NEXT: vwsub.vv v8, v10, v11
547 %vc = sext <vscale x 2 x i16> %va to <vscale x 2 x i64>
548 %vd = sext <vscale x 2 x i16> %vb to <vscale x 2 x i64>
549 %ve = sub <vscale x 2 x i64> %vc, %vd
550 ret <vscale x 2 x i64> %ve
553 define <vscale x 2 x i64> @vwsubu_vv_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb) {
554 ; CHECK-LABEL: vwsubu_vv_nxv2i64_nxv2i16:
556 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
557 ; CHECK-NEXT: vwsubu.vv v10, v8, v9
558 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
559 ; CHECK-NEXT: vsext.vf2 v8, v10
561 %vc = zext <vscale x 2 x i16> %va to <vscale x 2 x i64>
562 %vd = zext <vscale x 2 x i16> %vb to <vscale x 2 x i64>
563 %ve = sub <vscale x 2 x i64> %vc, %vd
564 ret <vscale x 2 x i64> %ve
567 define <vscale x 2 x i64> @vwsub_vx_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, i16 %b) {
568 ; CHECK-LABEL: vwsub_vx_nxv2i64_nxv2i16:
570 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
571 ; CHECK-NEXT: vmv.v.x v9, a0
572 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
573 ; CHECK-NEXT: vsext.vf2 v10, v8
574 ; CHECK-NEXT: vsext.vf2 v11, v9
575 ; CHECK-NEXT: vwsub.vv v8, v10, v11
577 %head = insertelement <vscale x 2 x i16> poison, i16 %b, i16 0
578 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
579 %vc = sext <vscale x 2 x i16> %va to <vscale x 2 x i64>
580 %vd = sext <vscale x 2 x i16> %splat to <vscale x 2 x i64>
581 %ve = sub <vscale x 2 x i64> %vc, %vd
582 ret <vscale x 2 x i64> %ve
585 define <vscale x 2 x i64> @vwsubu_vx_nxv2i64_nxv2i16(<vscale x 2 x i16> %va, i16 %b) {
586 ; CHECK-LABEL: vwsubu_vx_nxv2i64_nxv2i16:
588 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
589 ; CHECK-NEXT: vwsubu.vx v10, v8, a0
590 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
591 ; CHECK-NEXT: vsext.vf2 v8, v10
593 %head = insertelement <vscale x 2 x i16> poison, i16 %b, i16 0
594 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
595 %vc = zext <vscale x 2 x i16> %va to <vscale x 2 x i64>
596 %vd = zext <vscale x 2 x i16> %splat to <vscale x 2 x i64>
597 %ve = sub <vscale x 2 x i64> %vc, %vd
598 ret <vscale x 2 x i64> %ve
601 define <vscale x 2 x i64> @vwsub_wv_nxv2i64_nxv2i16(<vscale x 2 x i64> %va, <vscale x 2 x i16> %vb) {
602 ; CHECK-LABEL: vwsub_wv_nxv2i64_nxv2i16:
604 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
605 ; CHECK-NEXT: vsext.vf2 v11, v10
606 ; CHECK-NEXT: vwsub.wv v8, v8, v11
608 %vc = sext <vscale x 2 x i16> %vb to <vscale x 2 x i64>
609 %vd = sub <vscale x 2 x i64> %va, %vc
610 ret <vscale x 2 x i64> %vd
613 define <vscale x 2 x i64> @vwsubu_wv_nxv2i64_nxv2i16(<vscale x 2 x i64> %va, <vscale x 2 x i16> %vb) {
614 ; CHECK-LABEL: vwsubu_wv_nxv2i64_nxv2i16:
616 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
617 ; CHECK-NEXT: vzext.vf2 v11, v10
618 ; CHECK-NEXT: vwsubu.wv v8, v8, v11
620 %vc = zext <vscale x 2 x i16> %vb to <vscale x 2 x i64>
621 %vd = sub <vscale x 2 x i64> %va, %vc
622 ret <vscale x 2 x i64> %vd
625 define <vscale x 2 x i64> @vwsub_wx_nxv2i64_nxv2i16(<vscale x 2 x i64> %va, i16 %b) {
626 ; CHECK-LABEL: vwsub_wx_nxv2i64_nxv2i16:
628 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
629 ; CHECK-NEXT: vmv.v.x v10, a0
630 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
631 ; CHECK-NEXT: vsext.vf2 v11, v10
632 ; CHECK-NEXT: vwsub.wv v8, v8, v11
634 %head = insertelement <vscale x 2 x i16> poison, i16 %b, i16 0
635 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
636 %vb = sext <vscale x 2 x i16> %splat to <vscale x 2 x i64>
637 %vc = sub <vscale x 2 x i64> %va, %vb
638 ret <vscale x 2 x i64> %vc
641 define <vscale x 2 x i64> @vwsubu_wx_nxv2i64_nxv2i16(<vscale x 2 x i64> %va, i16 %b) {
642 ; CHECK-LABEL: vwsubu_wx_nxv2i64_nxv2i16:
644 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
645 ; CHECK-NEXT: vmv.v.x v10, a0
646 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
647 ; CHECK-NEXT: vzext.vf2 v11, v10
648 ; CHECK-NEXT: vwsubu.wv v8, v8, v11
650 %head = insertelement <vscale x 2 x i16> poison, i16 %b, i16 0
651 %splat = shufflevector <vscale x 2 x i16> %head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
652 %vb = zext <vscale x 2 x i16> %splat to <vscale x 2 x i64>
653 %vc = sub <vscale x 2 x i64> %va, %vb
654 ret <vscale x 2 x i64> %vc
657 define <vscale x 4 x i64> @vwsub_vv_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb) {
658 ; CHECK-LABEL: vwsub_vv_nxv4i64_nxv4i16:
660 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
661 ; CHECK-NEXT: vsext.vf2 v12, v8
662 ; CHECK-NEXT: vsext.vf2 v14, v9
663 ; CHECK-NEXT: vwsub.vv v8, v12, v14
665 %vc = sext <vscale x 4 x i16> %va to <vscale x 4 x i64>
666 %vd = sext <vscale x 4 x i16> %vb to <vscale x 4 x i64>
667 %ve = sub <vscale x 4 x i64> %vc, %vd
668 ret <vscale x 4 x i64> %ve
671 define <vscale x 4 x i64> @vwsubu_vv_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb) {
672 ; CHECK-LABEL: vwsubu_vv_nxv4i64_nxv4i16:
674 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
675 ; CHECK-NEXT: vwsubu.vv v12, v8, v9
676 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
677 ; CHECK-NEXT: vsext.vf2 v8, v12
679 %vc = zext <vscale x 4 x i16> %va to <vscale x 4 x i64>
680 %vd = zext <vscale x 4 x i16> %vb to <vscale x 4 x i64>
681 %ve = sub <vscale x 4 x i64> %vc, %vd
682 ret <vscale x 4 x i64> %ve
685 define <vscale x 4 x i64> @vwsub_vx_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, i16 %b) {
686 ; CHECK-LABEL: vwsub_vx_nxv4i64_nxv4i16:
688 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
689 ; CHECK-NEXT: vmv.v.x v9, a0
690 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
691 ; CHECK-NEXT: vsext.vf2 v12, v8
692 ; CHECK-NEXT: vsext.vf2 v14, v9
693 ; CHECK-NEXT: vwsub.vv v8, v12, v14
695 %head = insertelement <vscale x 4 x i16> poison, i16 %b, i16 0
696 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
697 %vc = sext <vscale x 4 x i16> %va to <vscale x 4 x i64>
698 %vd = sext <vscale x 4 x i16> %splat to <vscale x 4 x i64>
699 %ve = sub <vscale x 4 x i64> %vc, %vd
700 ret <vscale x 4 x i64> %ve
703 define <vscale x 4 x i64> @vwsubu_vx_nxv4i64_nxv4i16(<vscale x 4 x i16> %va, i16 %b) {
704 ; CHECK-LABEL: vwsubu_vx_nxv4i64_nxv4i16:
706 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
707 ; CHECK-NEXT: vwsubu.vx v12, v8, a0
708 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
709 ; CHECK-NEXT: vsext.vf2 v8, v12
711 %head = insertelement <vscale x 4 x i16> poison, i16 %b, i16 0
712 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
713 %vc = zext <vscale x 4 x i16> %va to <vscale x 4 x i64>
714 %vd = zext <vscale x 4 x i16> %splat to <vscale x 4 x i64>
715 %ve = sub <vscale x 4 x i64> %vc, %vd
716 ret <vscale x 4 x i64> %ve
719 define <vscale x 4 x i64> @vwsub_wv_nxv4i64_nxv4i16(<vscale x 4 x i64> %va, <vscale x 4 x i16> %vb) {
720 ; CHECK-LABEL: vwsub_wv_nxv4i64_nxv4i16:
722 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
723 ; CHECK-NEXT: vsext.vf2 v14, v12
724 ; CHECK-NEXT: vwsub.wv v8, v8, v14
726 %vc = sext <vscale x 4 x i16> %vb to <vscale x 4 x i64>
727 %vd = sub <vscale x 4 x i64> %va, %vc
728 ret <vscale x 4 x i64> %vd
731 define <vscale x 4 x i64> @vwsubu_wv_nxv4i64_nxv4i16(<vscale x 4 x i64> %va, <vscale x 4 x i16> %vb) {
732 ; CHECK-LABEL: vwsubu_wv_nxv4i64_nxv4i16:
734 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
735 ; CHECK-NEXT: vzext.vf2 v14, v12
736 ; CHECK-NEXT: vwsubu.wv v8, v8, v14
738 %vc = zext <vscale x 4 x i16> %vb to <vscale x 4 x i64>
739 %vd = sub <vscale x 4 x i64> %va, %vc
740 ret <vscale x 4 x i64> %vd
743 define <vscale x 4 x i64> @vwsub_wx_nxv4i64_nxv4i16(<vscale x 4 x i64> %va, i16 %b) {
744 ; CHECK-LABEL: vwsub_wx_nxv4i64_nxv4i16:
746 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
747 ; CHECK-NEXT: vmv.v.x v12, a0
748 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
749 ; CHECK-NEXT: vsext.vf2 v14, v12
750 ; CHECK-NEXT: vwsub.wv v8, v8, v14
752 %head = insertelement <vscale x 4 x i16> poison, i16 %b, i16 0
753 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
754 %vb = sext <vscale x 4 x i16> %splat to <vscale x 4 x i64>
755 %vc = sub <vscale x 4 x i64> %va, %vb
756 ret <vscale x 4 x i64> %vc
759 define <vscale x 4 x i64> @vwsubu_wx_nxv4i64_nxv4i16(<vscale x 4 x i64> %va, i16 %b) {
760 ; CHECK-LABEL: vwsubu_wx_nxv4i64_nxv4i16:
762 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
763 ; CHECK-NEXT: vmv.v.x v12, a0
764 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
765 ; CHECK-NEXT: vzext.vf2 v14, v12
766 ; CHECK-NEXT: vwsubu.wv v8, v8, v14
768 %head = insertelement <vscale x 4 x i16> poison, i16 %b, i16 0
769 %splat = shufflevector <vscale x 4 x i16> %head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
770 %vb = zext <vscale x 4 x i16> %splat to <vscale x 4 x i64>
771 %vc = sub <vscale x 4 x i64> %va, %vb
772 ret <vscale x 4 x i64> %vc
775 define <vscale x 8 x i64> @vwsub_vv_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb) {
776 ; CHECK-LABEL: vwsub_vv_nxv8i64_nxv8i16:
778 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
779 ; CHECK-NEXT: vsext.vf2 v16, v8
780 ; CHECK-NEXT: vsext.vf2 v20, v10
781 ; CHECK-NEXT: vwsub.vv v8, v16, v20
783 %vc = sext <vscale x 8 x i16> %va to <vscale x 8 x i64>
784 %vd = sext <vscale x 8 x i16> %vb to <vscale x 8 x i64>
785 %ve = sub <vscale x 8 x i64> %vc, %vd
786 ret <vscale x 8 x i64> %ve
789 define <vscale x 8 x i64> @vwsubu_vv_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb) {
790 ; CHECK-LABEL: vwsubu_vv_nxv8i64_nxv8i16:
792 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
793 ; CHECK-NEXT: vwsubu.vv v16, v8, v10
794 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
795 ; CHECK-NEXT: vsext.vf2 v8, v16
797 %vc = zext <vscale x 8 x i16> %va to <vscale x 8 x i64>
798 %vd = zext <vscale x 8 x i16> %vb to <vscale x 8 x i64>
799 %ve = sub <vscale x 8 x i64> %vc, %vd
800 ret <vscale x 8 x i64> %ve
803 define <vscale x 8 x i64> @vwsub_vx_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, i16 %b) {
804 ; CHECK-LABEL: vwsub_vx_nxv8i64_nxv8i16:
806 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
807 ; CHECK-NEXT: vmv.v.x v10, a0
808 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
809 ; CHECK-NEXT: vsext.vf2 v16, v8
810 ; CHECK-NEXT: vsext.vf2 v20, v10
811 ; CHECK-NEXT: vwsub.vv v8, v16, v20
813 %head = insertelement <vscale x 8 x i16> poison, i16 %b, i16 0
814 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
815 %vc = sext <vscale x 8 x i16> %va to <vscale x 8 x i64>
816 %vd = sext <vscale x 8 x i16> %splat to <vscale x 8 x i64>
817 %ve = sub <vscale x 8 x i64> %vc, %vd
818 ret <vscale x 8 x i64> %ve
821 define <vscale x 8 x i64> @vwsubu_vx_nxv8i64_nxv8i16(<vscale x 8 x i16> %va, i16 %b) {
822 ; CHECK-LABEL: vwsubu_vx_nxv8i64_nxv8i16:
824 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
825 ; CHECK-NEXT: vwsubu.vx v16, v8, a0
826 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
827 ; CHECK-NEXT: vsext.vf2 v8, v16
829 %head = insertelement <vscale x 8 x i16> poison, i16 %b, i16 0
830 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
831 %vc = zext <vscale x 8 x i16> %va to <vscale x 8 x i64>
832 %vd = zext <vscale x 8 x i16> %splat to <vscale x 8 x i64>
833 %ve = sub <vscale x 8 x i64> %vc, %vd
834 ret <vscale x 8 x i64> %ve
837 define <vscale x 8 x i64> @vwsub_wv_nxv8i64_nxv8i16(<vscale x 8 x i64> %va, <vscale x 8 x i16> %vb) {
838 ; CHECK-LABEL: vwsub_wv_nxv8i64_nxv8i16:
840 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
841 ; CHECK-NEXT: vsext.vf2 v20, v16
842 ; CHECK-NEXT: vwsub.wv v8, v8, v20
844 %vc = sext <vscale x 8 x i16> %vb to <vscale x 8 x i64>
845 %vd = sub <vscale x 8 x i64> %va, %vc
846 ret <vscale x 8 x i64> %vd
849 define <vscale x 8 x i64> @vwsubu_wv_nxv8i64_nxv8i16(<vscale x 8 x i64> %va, <vscale x 8 x i16> %vb) {
850 ; CHECK-LABEL: vwsubu_wv_nxv8i64_nxv8i16:
852 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
853 ; CHECK-NEXT: vzext.vf2 v20, v16
854 ; CHECK-NEXT: vwsubu.wv v8, v8, v20
856 %vc = zext <vscale x 8 x i16> %vb to <vscale x 8 x i64>
857 %vd = sub <vscale x 8 x i64> %va, %vc
858 ret <vscale x 8 x i64> %vd
861 define <vscale x 8 x i64> @vwsub_wx_nxv8i64_nxv8i16(<vscale x 8 x i64> %va, i16 %b) {
862 ; CHECK-LABEL: vwsub_wx_nxv8i64_nxv8i16:
864 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
865 ; CHECK-NEXT: vmv.v.x v16, a0
866 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
867 ; CHECK-NEXT: vsext.vf2 v20, v16
868 ; CHECK-NEXT: vwsub.wv v8, v8, v20
870 %head = insertelement <vscale x 8 x i16> poison, i16 %b, i16 0
871 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
872 %vb = sext <vscale x 8 x i16> %splat to <vscale x 8 x i64>
873 %vc = sub <vscale x 8 x i64> %va, %vb
874 ret <vscale x 8 x i64> %vc
877 define <vscale x 8 x i64> @vwsubu_wx_nxv8i64_nxv8i16(<vscale x 8 x i64> %va, i16 %b) {
878 ; CHECK-LABEL: vwsubu_wx_nxv8i64_nxv8i16:
880 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
881 ; CHECK-NEXT: vmv.v.x v16, a0
882 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
883 ; CHECK-NEXT: vzext.vf2 v20, v16
884 ; CHECK-NEXT: vwsubu.wv v8, v8, v20
886 %head = insertelement <vscale x 8 x i16> poison, i16 %b, i16 0
887 %splat = shufflevector <vscale x 8 x i16> %head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
888 %vb = zext <vscale x 8 x i16> %splat to <vscale x 8 x i64>
889 %vc = sub <vscale x 8 x i64> %va, %vb
890 ret <vscale x 8 x i64> %vc
893 define <vscale x 1 x i64> @vwsub_vv_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb) {
894 ; CHECK-LABEL: vwsub_vv_nxv1i64_nxv1i8:
896 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
897 ; CHECK-NEXT: vsext.vf4 v10, v8
898 ; CHECK-NEXT: vsext.vf4 v11, v9
899 ; CHECK-NEXT: vwsub.vv v8, v10, v11
901 %vc = sext <vscale x 1 x i8> %va to <vscale x 1 x i64>
902 %vd = sext <vscale x 1 x i8> %vb to <vscale x 1 x i64>
903 %ve = sub <vscale x 1 x i64> %vc, %vd
904 ret <vscale x 1 x i64> %ve
907 define <vscale x 1 x i64> @vwsubu_vv_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb) {
908 ; CHECK-LABEL: vwsubu_vv_nxv1i64_nxv1i8:
910 ; CHECK-NEXT: vsetvli a0, zero, e8, mf8, ta, ma
911 ; CHECK-NEXT: vwsubu.vv v10, v8, v9
912 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
913 ; CHECK-NEXT: vsext.vf4 v8, v10
915 %vc = zext <vscale x 1 x i8> %va to <vscale x 1 x i64>
916 %vd = zext <vscale x 1 x i8> %vb to <vscale x 1 x i64>
917 %ve = sub <vscale x 1 x i64> %vc, %vd
918 ret <vscale x 1 x i64> %ve
921 define <vscale x 1 x i64> @vwsub_vx_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, i8 %b) {
922 ; CHECK-LABEL: vwsub_vx_nxv1i64_nxv1i8:
924 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
925 ; CHECK-NEXT: vmv.v.x v9, a0
926 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
927 ; CHECK-NEXT: vsext.vf4 v10, v8
928 ; CHECK-NEXT: vsext.vf4 v11, v9
929 ; CHECK-NEXT: vwsub.vv v8, v10, v11
931 %head = insertelement <vscale x 1 x i8> poison, i8 %b, i8 0
932 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
933 %vc = sext <vscale x 1 x i8> %va to <vscale x 1 x i64>
934 %vd = sext <vscale x 1 x i8> %splat to <vscale x 1 x i64>
935 %ve = sub <vscale x 1 x i64> %vc, %vd
936 ret <vscale x 1 x i64> %ve
939 define <vscale x 1 x i64> @vwsubu_vx_nxv1i64_nxv1i8(<vscale x 1 x i8> %va, i8 %b) {
940 ; CHECK-LABEL: vwsubu_vx_nxv1i64_nxv1i8:
942 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
943 ; CHECK-NEXT: vwsubu.vx v9, v8, a0
944 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
945 ; CHECK-NEXT: vsext.vf4 v8, v9
947 %head = insertelement <vscale x 1 x i8> poison, i8 %b, i8 0
948 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
949 %vc = zext <vscale x 1 x i8> %va to <vscale x 1 x i64>
950 %vd = zext <vscale x 1 x i8> %splat to <vscale x 1 x i64>
951 %ve = sub <vscale x 1 x i64> %vc, %vd
952 ret <vscale x 1 x i64> %ve
955 define <vscale x 1 x i64> @vwsub_wv_nxv1i64_nxv1i8(<vscale x 1 x i64> %va, <vscale x 1 x i8> %vb) {
956 ; CHECK-LABEL: vwsub_wv_nxv1i64_nxv1i8:
958 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
959 ; CHECK-NEXT: vsext.vf4 v10, v9
960 ; CHECK-NEXT: vwsub.wv v8, v8, v10
962 %vc = sext <vscale x 1 x i8> %vb to <vscale x 1 x i64>
963 %vd = sub <vscale x 1 x i64> %va, %vc
964 ret <vscale x 1 x i64> %vd
967 define <vscale x 1 x i64> @vwsubu_wv_nxv1i64_nxv1i8(<vscale x 1 x i64> %va, <vscale x 1 x i8> %vb) {
968 ; CHECK-LABEL: vwsubu_wv_nxv1i64_nxv1i8:
970 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
971 ; CHECK-NEXT: vzext.vf4 v10, v9
972 ; CHECK-NEXT: vwsubu.wv v8, v8, v10
974 %vc = zext <vscale x 1 x i8> %vb to <vscale x 1 x i64>
975 %vd = sub <vscale x 1 x i64> %va, %vc
976 ret <vscale x 1 x i64> %vd
979 define <vscale x 1 x i64> @vwsub_wx_nxv1i64_nxv1i8(<vscale x 1 x i64> %va, i8 %b) {
980 ; CHECK-LABEL: vwsub_wx_nxv1i64_nxv1i8:
982 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
983 ; CHECK-NEXT: vmv.v.x v9, a0
984 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
985 ; CHECK-NEXT: vsext.vf4 v10, v9
986 ; CHECK-NEXT: vwsub.wv v8, v8, v10
988 %head = insertelement <vscale x 1 x i8> poison, i8 %b, i8 0
989 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
990 %vb = sext <vscale x 1 x i8> %splat to <vscale x 1 x i64>
991 %vc = sub <vscale x 1 x i64> %va, %vb
992 ret <vscale x 1 x i64> %vc
995 define <vscale x 1 x i64> @vwsubu_wx_nxv1i64_nxv1i8(<vscale x 1 x i64> %va, i8 %b) {
996 ; CHECK-LABEL: vwsubu_wx_nxv1i64_nxv1i8:
998 ; CHECK-NEXT: vsetvli a1, zero, e8, mf8, ta, ma
999 ; CHECK-NEXT: vmv.v.x v9, a0
1000 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1001 ; CHECK-NEXT: vzext.vf4 v10, v9
1002 ; CHECK-NEXT: vwsubu.wv v8, v8, v10
1004 %head = insertelement <vscale x 1 x i8> poison, i8 %b, i8 0
1005 %splat = shufflevector <vscale x 1 x i8> %head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
1006 %vb = zext <vscale x 1 x i8> %splat to <vscale x 1 x i64>
1007 %vc = sub <vscale x 1 x i64> %va, %vb
1008 ret <vscale x 1 x i64> %vc
1011 define <vscale x 2 x i64> @vwsub_vv_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb) {
1012 ; CHECK-LABEL: vwsub_vv_nxv2i64_nxv2i8:
1014 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
1015 ; CHECK-NEXT: vsext.vf4 v10, v8
1016 ; CHECK-NEXT: vsext.vf4 v11, v9
1017 ; CHECK-NEXT: vwsub.vv v8, v10, v11
1019 %vc = sext <vscale x 2 x i8> %va to <vscale x 2 x i64>
1020 %vd = sext <vscale x 2 x i8> %vb to <vscale x 2 x i64>
1021 %ve = sub <vscale x 2 x i64> %vc, %vd
1022 ret <vscale x 2 x i64> %ve
1025 define <vscale x 2 x i64> @vwsubu_vv_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb) {
1026 ; CHECK-LABEL: vwsubu_vv_nxv2i64_nxv2i8:
1028 ; CHECK-NEXT: vsetvli a0, zero, e8, mf4, ta, ma
1029 ; CHECK-NEXT: vwsubu.vv v10, v8, v9
1030 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
1031 ; CHECK-NEXT: vsext.vf4 v8, v10
1033 %vc = zext <vscale x 2 x i8> %va to <vscale x 2 x i64>
1034 %vd = zext <vscale x 2 x i8> %vb to <vscale x 2 x i64>
1035 %ve = sub <vscale x 2 x i64> %vc, %vd
1036 ret <vscale x 2 x i64> %ve
1039 define <vscale x 2 x i64> @vwsub_vx_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, i8 %b) {
1040 ; CHECK-LABEL: vwsub_vx_nxv2i64_nxv2i8:
1042 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
1043 ; CHECK-NEXT: vmv.v.x v9, a0
1044 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
1045 ; CHECK-NEXT: vsext.vf4 v10, v8
1046 ; CHECK-NEXT: vsext.vf4 v11, v9
1047 ; CHECK-NEXT: vwsub.vv v8, v10, v11
1049 %head = insertelement <vscale x 2 x i8> poison, i8 %b, i8 0
1050 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
1051 %vc = sext <vscale x 2 x i8> %va to <vscale x 2 x i64>
1052 %vd = sext <vscale x 2 x i8> %splat to <vscale x 2 x i64>
1053 %ve = sub <vscale x 2 x i64> %vc, %vd
1054 ret <vscale x 2 x i64> %ve
1057 define <vscale x 2 x i64> @vwsubu_vx_nxv2i64_nxv2i8(<vscale x 2 x i8> %va, i8 %b) {
1058 ; CHECK-LABEL: vwsubu_vx_nxv2i64_nxv2i8:
1060 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
1061 ; CHECK-NEXT: vwsubu.vx v10, v8, a0
1062 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
1063 ; CHECK-NEXT: vsext.vf4 v8, v10
1065 %head = insertelement <vscale x 2 x i8> poison, i8 %b, i8 0
1066 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
1067 %vc = zext <vscale x 2 x i8> %va to <vscale x 2 x i64>
1068 %vd = zext <vscale x 2 x i8> %splat to <vscale x 2 x i64>
1069 %ve = sub <vscale x 2 x i64> %vc, %vd
1070 ret <vscale x 2 x i64> %ve
1073 define <vscale x 2 x i64> @vwsub_wv_nxv2i64_nxv2i8(<vscale x 2 x i64> %va, <vscale x 2 x i8> %vb) {
1074 ; CHECK-LABEL: vwsub_wv_nxv2i64_nxv2i8:
1076 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
1077 ; CHECK-NEXT: vsext.vf4 v11, v10
1078 ; CHECK-NEXT: vwsub.wv v8, v8, v11
1080 %vc = sext <vscale x 2 x i8> %vb to <vscale x 2 x i64>
1081 %vd = sub <vscale x 2 x i64> %va, %vc
1082 ret <vscale x 2 x i64> %vd
1085 define <vscale x 2 x i64> @vwsubu_wv_nxv2i64_nxv2i8(<vscale x 2 x i64> %va, <vscale x 2 x i8> %vb) {
1086 ; CHECK-LABEL: vwsubu_wv_nxv2i64_nxv2i8:
1088 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
1089 ; CHECK-NEXT: vzext.vf4 v11, v10
1090 ; CHECK-NEXT: vwsubu.wv v8, v8, v11
1092 %vc = zext <vscale x 2 x i8> %vb to <vscale x 2 x i64>
1093 %vd = sub <vscale x 2 x i64> %va, %vc
1094 ret <vscale x 2 x i64> %vd
1097 define <vscale x 2 x i64> @vwsub_wx_nxv2i64_nxv2i8(<vscale x 2 x i64> %va, i8 %b) {
1098 ; CHECK-LABEL: vwsub_wx_nxv2i64_nxv2i8:
1100 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
1101 ; CHECK-NEXT: vmv.v.x v10, a0
1102 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
1103 ; CHECK-NEXT: vsext.vf4 v11, v10
1104 ; CHECK-NEXT: vwsub.wv v8, v8, v11
1106 %head = insertelement <vscale x 2 x i8> poison, i8 %b, i8 0
1107 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
1108 %vb = sext <vscale x 2 x i8> %splat to <vscale x 2 x i64>
1109 %vc = sub <vscale x 2 x i64> %va, %vb
1110 ret <vscale x 2 x i64> %vc
1113 define <vscale x 2 x i64> @vwsubu_wx_nxv2i64_nxv2i8(<vscale x 2 x i64> %va, i8 %b) {
1114 ; CHECK-LABEL: vwsubu_wx_nxv2i64_nxv2i8:
1116 ; CHECK-NEXT: vsetvli a1, zero, e8, mf4, ta, ma
1117 ; CHECK-NEXT: vmv.v.x v10, a0
1118 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
1119 ; CHECK-NEXT: vzext.vf4 v11, v10
1120 ; CHECK-NEXT: vwsubu.wv v8, v8, v11
1122 %head = insertelement <vscale x 2 x i8> poison, i8 %b, i8 0
1123 %splat = shufflevector <vscale x 2 x i8> %head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
1124 %vb = zext <vscale x 2 x i8> %splat to <vscale x 2 x i64>
1125 %vc = sub <vscale x 2 x i64> %va, %vb
1126 ret <vscale x 2 x i64> %vc
1129 define <vscale x 4 x i64> @vwsub_vv_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb) {
1130 ; CHECK-LABEL: vwsub_vv_nxv4i64_nxv4i8:
1132 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
1133 ; CHECK-NEXT: vsext.vf4 v12, v8
1134 ; CHECK-NEXT: vsext.vf4 v14, v9
1135 ; CHECK-NEXT: vwsub.vv v8, v12, v14
1137 %vc = sext <vscale x 4 x i8> %va to <vscale x 4 x i64>
1138 %vd = sext <vscale x 4 x i8> %vb to <vscale x 4 x i64>
1139 %ve = sub <vscale x 4 x i64> %vc, %vd
1140 ret <vscale x 4 x i64> %ve
1143 define <vscale x 4 x i64> @vwsubu_vv_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb) {
1144 ; CHECK-LABEL: vwsubu_vv_nxv4i64_nxv4i8:
1146 ; CHECK-NEXT: vsetvli a0, zero, e8, mf2, ta, ma
1147 ; CHECK-NEXT: vwsubu.vv v12, v8, v9
1148 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
1149 ; CHECK-NEXT: vsext.vf4 v8, v12
1151 %vc = zext <vscale x 4 x i8> %va to <vscale x 4 x i64>
1152 %vd = zext <vscale x 4 x i8> %vb to <vscale x 4 x i64>
1153 %ve = sub <vscale x 4 x i64> %vc, %vd
1154 ret <vscale x 4 x i64> %ve
1157 define <vscale x 4 x i64> @vwsub_vx_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, i8 %b) {
1158 ; CHECK-LABEL: vwsub_vx_nxv4i64_nxv4i8:
1160 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
1161 ; CHECK-NEXT: vmv.v.x v9, a0
1162 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1163 ; CHECK-NEXT: vsext.vf4 v12, v8
1164 ; CHECK-NEXT: vsext.vf4 v14, v9
1165 ; CHECK-NEXT: vwsub.vv v8, v12, v14
1167 %head = insertelement <vscale x 4 x i8> poison, i8 %b, i8 0
1168 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
1169 %vc = sext <vscale x 4 x i8> %va to <vscale x 4 x i64>
1170 %vd = sext <vscale x 4 x i8> %splat to <vscale x 4 x i64>
1171 %ve = sub <vscale x 4 x i64> %vc, %vd
1172 ret <vscale x 4 x i64> %ve
1175 define <vscale x 4 x i64> @vwsubu_vx_nxv4i64_nxv4i8(<vscale x 4 x i8> %va, i8 %b) {
1176 ; CHECK-LABEL: vwsubu_vx_nxv4i64_nxv4i8:
1178 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
1179 ; CHECK-NEXT: vwsubu.vx v12, v8, a0
1180 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
1181 ; CHECK-NEXT: vsext.vf4 v8, v12
1183 %head = insertelement <vscale x 4 x i8> poison, i8 %b, i8 0
1184 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
1185 %vc = zext <vscale x 4 x i8> %va to <vscale x 4 x i64>
1186 %vd = zext <vscale x 4 x i8> %splat to <vscale x 4 x i64>
1187 %ve = sub <vscale x 4 x i64> %vc, %vd
1188 ret <vscale x 4 x i64> %ve
1191 define <vscale x 4 x i64> @vwsub_wv_nxv4i64_nxv4i8(<vscale x 4 x i64> %va, <vscale x 4 x i8> %vb) {
1192 ; CHECK-LABEL: vwsub_wv_nxv4i64_nxv4i8:
1194 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
1195 ; CHECK-NEXT: vsext.vf4 v14, v12
1196 ; CHECK-NEXT: vwsub.wv v8, v8, v14
1198 %vc = sext <vscale x 4 x i8> %vb to <vscale x 4 x i64>
1199 %vd = sub <vscale x 4 x i64> %va, %vc
1200 ret <vscale x 4 x i64> %vd
1203 define <vscale x 4 x i64> @vwsubu_wv_nxv4i64_nxv4i8(<vscale x 4 x i64> %va, <vscale x 4 x i8> %vb) {
1204 ; CHECK-LABEL: vwsubu_wv_nxv4i64_nxv4i8:
1206 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
1207 ; CHECK-NEXT: vzext.vf4 v14, v12
1208 ; CHECK-NEXT: vwsubu.wv v8, v8, v14
1210 %vc = zext <vscale x 4 x i8> %vb to <vscale x 4 x i64>
1211 %vd = sub <vscale x 4 x i64> %va, %vc
1212 ret <vscale x 4 x i64> %vd
1215 define <vscale x 4 x i64> @vwsub_wx_nxv4i64_nxv4i8(<vscale x 4 x i64> %va, i8 %b) {
1216 ; CHECK-LABEL: vwsub_wx_nxv4i64_nxv4i8:
1218 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
1219 ; CHECK-NEXT: vmv.v.x v12, a0
1220 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1221 ; CHECK-NEXT: vsext.vf4 v14, v12
1222 ; CHECK-NEXT: vwsub.wv v8, v8, v14
1224 %head = insertelement <vscale x 4 x i8> poison, i8 %b, i8 0
1225 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
1226 %vb = sext <vscale x 4 x i8> %splat to <vscale x 4 x i64>
1227 %vc = sub <vscale x 4 x i64> %va, %vb
1228 ret <vscale x 4 x i64> %vc
1231 define <vscale x 4 x i64> @vwsubu_wx_nxv4i64_nxv4i8(<vscale x 4 x i64> %va, i8 %b) {
1232 ; CHECK-LABEL: vwsubu_wx_nxv4i64_nxv4i8:
1234 ; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, ma
1235 ; CHECK-NEXT: vmv.v.x v12, a0
1236 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1237 ; CHECK-NEXT: vzext.vf4 v14, v12
1238 ; CHECK-NEXT: vwsubu.wv v8, v8, v14
1240 %head = insertelement <vscale x 4 x i8> poison, i8 %b, i8 0
1241 %splat = shufflevector <vscale x 4 x i8> %head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
1242 %vb = zext <vscale x 4 x i8> %splat to <vscale x 4 x i64>
1243 %vc = sub <vscale x 4 x i64> %va, %vb
1244 ret <vscale x 4 x i64> %vc
1247 define <vscale x 8 x i64> @vwsub_vv_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb) {
1248 ; CHECK-LABEL: vwsub_vv_nxv8i64_nxv8i8:
1250 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
1251 ; CHECK-NEXT: vsext.vf4 v16, v8
1252 ; CHECK-NEXT: vsext.vf4 v20, v9
1253 ; CHECK-NEXT: vwsub.vv v8, v16, v20
1255 %vc = sext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1256 %vd = sext <vscale x 8 x i8> %vb to <vscale x 8 x i64>
1257 %ve = sub <vscale x 8 x i64> %vc, %vd
1258 ret <vscale x 8 x i64> %ve
1261 define <vscale x 8 x i64> @vwsubu_vv_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb) {
1262 ; CHECK-LABEL: vwsubu_vv_nxv8i64_nxv8i8:
1264 ; CHECK-NEXT: vsetvli a0, zero, e8, m1, ta, ma
1265 ; CHECK-NEXT: vwsubu.vv v16, v8, v9
1266 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1267 ; CHECK-NEXT: vsext.vf4 v8, v16
1269 %vc = zext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1270 %vd = zext <vscale x 8 x i8> %vb to <vscale x 8 x i64>
1271 %ve = sub <vscale x 8 x i64> %vc, %vd
1272 ret <vscale x 8 x i64> %ve
1275 define <vscale x 8 x i64> @vwsub_vx_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, i8 %b) {
1276 ; CHECK-LABEL: vwsub_vx_nxv8i64_nxv8i8:
1278 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
1279 ; CHECK-NEXT: vmv.v.x v9, a0
1280 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
1281 ; CHECK-NEXT: vsext.vf4 v16, v8
1282 ; CHECK-NEXT: vsext.vf4 v20, v9
1283 ; CHECK-NEXT: vwsub.vv v8, v16, v20
1285 %head = insertelement <vscale x 8 x i8> poison, i8 %b, i8 0
1286 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
1287 %vc = sext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1288 %vd = sext <vscale x 8 x i8> %splat to <vscale x 8 x i64>
1289 %ve = sub <vscale x 8 x i64> %vc, %vd
1290 ret <vscale x 8 x i64> %ve
1293 define <vscale x 8 x i64> @vwsubu_vx_nxv8i64_nxv8i8(<vscale x 8 x i8> %va, i8 %b) {
1294 ; CHECK-LABEL: vwsubu_vx_nxv8i64_nxv8i8:
1296 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
1297 ; CHECK-NEXT: vwsubu.vx v16, v8, a0
1298 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1299 ; CHECK-NEXT: vsext.vf4 v8, v16
1301 %head = insertelement <vscale x 8 x i8> poison, i8 %b, i8 0
1302 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
1303 %vc = zext <vscale x 8 x i8> %va to <vscale x 8 x i64>
1304 %vd = zext <vscale x 8 x i8> %splat to <vscale x 8 x i64>
1305 %ve = sub <vscale x 8 x i64> %vc, %vd
1306 ret <vscale x 8 x i64> %ve
1309 define <vscale x 8 x i64> @vwsub_wv_nxv8i64_nxv8i8(<vscale x 8 x i64> %va, <vscale x 8 x i8> %vb) {
1310 ; CHECK-LABEL: vwsub_wv_nxv8i64_nxv8i8:
1312 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
1313 ; CHECK-NEXT: vsext.vf4 v20, v16
1314 ; CHECK-NEXT: vwsub.wv v8, v8, v20
1316 %vc = sext <vscale x 8 x i8> %vb to <vscale x 8 x i64>
1317 %vd = sub <vscale x 8 x i64> %va, %vc
1318 ret <vscale x 8 x i64> %vd
1321 define <vscale x 8 x i64> @vwsubu_wv_nxv8i64_nxv8i8(<vscale x 8 x i64> %va, <vscale x 8 x i8> %vb) {
1322 ; CHECK-LABEL: vwsubu_wv_nxv8i64_nxv8i8:
1324 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
1325 ; CHECK-NEXT: vzext.vf4 v20, v16
1326 ; CHECK-NEXT: vwsubu.wv v8, v8, v20
1328 %vc = zext <vscale x 8 x i8> %vb to <vscale x 8 x i64>
1329 %vd = sub <vscale x 8 x i64> %va, %vc
1330 ret <vscale x 8 x i64> %vd
1333 define <vscale x 8 x i64> @vwsub_wx_nxv8i64_nxv8i8(<vscale x 8 x i64> %va, i8 %b) {
1334 ; CHECK-LABEL: vwsub_wx_nxv8i64_nxv8i8:
1336 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
1337 ; CHECK-NEXT: vmv.v.x v16, a0
1338 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
1339 ; CHECK-NEXT: vsext.vf4 v20, v16
1340 ; CHECK-NEXT: vwsub.wv v8, v8, v20
1342 %head = insertelement <vscale x 8 x i8> poison, i8 %b, i8 0
1343 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
1344 %vb = sext <vscale x 8 x i8> %splat to <vscale x 8 x i64>
1345 %vc = sub <vscale x 8 x i64> %va, %vb
1346 ret <vscale x 8 x i64> %vc
1349 define <vscale x 8 x i64> @vwsubu_wx_nxv8i64_nxv8i8(<vscale x 8 x i64> %va, i8 %b) {
1350 ; CHECK-LABEL: vwsubu_wx_nxv8i64_nxv8i8:
1352 ; CHECK-NEXT: vsetvli a1, zero, e8, m1, ta, ma
1353 ; CHECK-NEXT: vmv.v.x v16, a0
1354 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
1355 ; CHECK-NEXT: vzext.vf4 v20, v16
1356 ; CHECK-NEXT: vwsubu.wv v8, v8, v20
1358 %head = insertelement <vscale x 8 x i8> poison, i8 %b, i8 0
1359 %splat = shufflevector <vscale x 8 x i8> %head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
1360 %vb = zext <vscale x 8 x i8> %splat to <vscale x 8 x i64>
1361 %vc = sub <vscale x 8 x i64> %va, %vb
1362 ret <vscale x 8 x i64> %vc