1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV32
4 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s --check-prefixes=CHECK,RV64
7 declare <vscale x 8 x i7> @llvm.vp.ssub.sat.nxv8i7(<vscale x 8 x i7>, <vscale x 8 x i7>, <vscale x 8 x i1>, i32)
9 define <vscale x 8 x i7> @vssub_vx_nxv8i7(<vscale x 8 x i7> %a, i7 signext %b, <vscale x 8 x i1> %mask, i32 zeroext %evl) {
10 ; CHECK-LABEL: vssub_vx_nxv8i7:
12 ; CHECK-NEXT: vsetvli a2, zero, e8, m1, ta, ma
13 ; CHECK-NEXT: vadd.vv v8, v8, v8
14 ; CHECK-NEXT: vsra.vi v8, v8, 1
15 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
16 ; CHECK-NEXT: vsub.vx v8, v8, a0, v0.t
17 ; CHECK-NEXT: li a0, 63
18 ; CHECK-NEXT: vmin.vx v8, v8, a0, v0.t
19 ; CHECK-NEXT: li a0, 192
20 ; CHECK-NEXT: vmax.vx v8, v8, a0, v0.t
22 %elt.head = insertelement <vscale x 8 x i7> poison, i7 %b, i32 0
23 %vb = shufflevector <vscale x 8 x i7> %elt.head, <vscale x 8 x i7> poison, <vscale x 8 x i32> zeroinitializer
24 %v = call <vscale x 8 x i7> @llvm.vp.ssub.sat.nxv8i7(<vscale x 8 x i7> %a, <vscale x 8 x i7> %vb, <vscale x 8 x i1> %mask, i32 %evl)
25 ret <vscale x 8 x i7> %v
28 declare <vscale x 1 x i8> @llvm.vp.ssub.sat.nxv1i8(<vscale x 1 x i8>, <vscale x 1 x i8>, <vscale x 1 x i1>, i32)
30 define <vscale x 1 x i8> @vssub_vv_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
31 ; CHECK-LABEL: vssub_vv_nxv1i8:
33 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
34 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
36 %v = call <vscale x 1 x i8> @llvm.vp.ssub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> %m, i32 %evl)
37 ret <vscale x 1 x i8> %v
40 define <vscale x 1 x i8> @vssub_vv_nxv1i8_unmasked(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, i32 zeroext %evl) {
41 ; CHECK-LABEL: vssub_vv_nxv1i8_unmasked:
43 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
44 ; CHECK-NEXT: vssub.vv v8, v8, v9
46 %v = call <vscale x 1 x i8> @llvm.vp.ssub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
47 ret <vscale x 1 x i8> %v
50 define <vscale x 1 x i8> @vssub_vx_nxv1i8(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
51 ; CHECK-LABEL: vssub_vx_nxv1i8:
53 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
54 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
56 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
57 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
58 %v = call <vscale x 1 x i8> @llvm.vp.ssub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> %m, i32 %evl)
59 ret <vscale x 1 x i8> %v
62 define <vscale x 1 x i8> @vssub_vx_nxv1i8_commute(<vscale x 1 x i8> %va, i8 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
63 ; CHECK-LABEL: vssub_vx_nxv1i8_commute:
65 ; CHECK-NEXT: vsetvli a2, zero, e8, mf8, ta, ma
66 ; CHECK-NEXT: vmv.v.x v9, a0
67 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
68 ; CHECK-NEXT: vssub.vv v8, v9, v8, v0.t
70 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
71 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
72 %v = call <vscale x 1 x i8> @llvm.vp.ssub.sat.nxv1i8(<vscale x 1 x i8> %vb, <vscale x 1 x i8> %va, <vscale x 1 x i1> %m, i32 %evl)
73 ret <vscale x 1 x i8> %v
76 define <vscale x 1 x i8> @vssub_vx_nxv1i8_unmasked(<vscale x 1 x i8> %va, i8 %b, i32 zeroext %evl) {
77 ; CHECK-LABEL: vssub_vx_nxv1i8_unmasked:
79 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
80 ; CHECK-NEXT: vssub.vx v8, v8, a0
82 %elt.head = insertelement <vscale x 1 x i8> poison, i8 %b, i32 0
83 %vb = shufflevector <vscale x 1 x i8> %elt.head, <vscale x 1 x i8> poison, <vscale x 1 x i32> zeroinitializer
84 %v = call <vscale x 1 x i8> @llvm.vp.ssub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
85 ret <vscale x 1 x i8> %v
88 define <vscale x 1 x i8> @vssub_vi_nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
89 ; CHECK-LABEL: vssub_vi_nxv1i8:
91 ; CHECK-NEXT: li a1, -1
92 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
93 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
95 %v = call <vscale x 1 x i8> @llvm.vp.ssub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> splat (i8 -1), <vscale x 1 x i1> %m, i32 %evl)
96 ret <vscale x 1 x i8> %v
99 define <vscale x 1 x i8> @vssub_vi_nxv1i8_unmasked(<vscale x 1 x i8> %va, i32 zeroext %evl) {
100 ; CHECK-LABEL: vssub_vi_nxv1i8_unmasked:
102 ; CHECK-NEXT: li a1, -1
103 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
104 ; CHECK-NEXT: vssub.vx v8, v8, a1
106 %v = call <vscale x 1 x i8> @llvm.vp.ssub.sat.nxv1i8(<vscale x 1 x i8> %va, <vscale x 1 x i8> splat (i8 -1), <vscale x 1 x i1> splat (i1 true), i32 %evl)
107 ret <vscale x 1 x i8> %v
110 declare <vscale x 2 x i8> @llvm.vp.ssub.sat.nxv2i8(<vscale x 2 x i8>, <vscale x 2 x i8>, <vscale x 2 x i1>, i32)
112 define <vscale x 2 x i8> @vssub_vv_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
113 ; CHECK-LABEL: vssub_vv_nxv2i8:
115 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
116 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
118 %v = call <vscale x 2 x i8> @llvm.vp.ssub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> %m, i32 %evl)
119 ret <vscale x 2 x i8> %v
122 define <vscale x 2 x i8> @vssub_vv_nxv2i8_unmasked(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, i32 zeroext %evl) {
123 ; CHECK-LABEL: vssub_vv_nxv2i8_unmasked:
125 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
126 ; CHECK-NEXT: vssub.vv v8, v8, v9
128 %v = call <vscale x 2 x i8> @llvm.vp.ssub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
129 ret <vscale x 2 x i8> %v
132 define <vscale x 2 x i8> @vssub_vx_nxv2i8(<vscale x 2 x i8> %va, i8 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
133 ; CHECK-LABEL: vssub_vx_nxv2i8:
135 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
136 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
138 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
139 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
140 %v = call <vscale x 2 x i8> @llvm.vp.ssub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> %m, i32 %evl)
141 ret <vscale x 2 x i8> %v
144 define <vscale x 2 x i8> @vssub_vx_nxv2i8_unmasked(<vscale x 2 x i8> %va, i8 %b, i32 zeroext %evl) {
145 ; CHECK-LABEL: vssub_vx_nxv2i8_unmasked:
147 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
148 ; CHECK-NEXT: vssub.vx v8, v8, a0
150 %elt.head = insertelement <vscale x 2 x i8> poison, i8 %b, i32 0
151 %vb = shufflevector <vscale x 2 x i8> %elt.head, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
152 %v = call <vscale x 2 x i8> @llvm.vp.ssub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
153 ret <vscale x 2 x i8> %v
156 define <vscale x 2 x i8> @vssub_vi_nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
157 ; CHECK-LABEL: vssub_vi_nxv2i8:
159 ; CHECK-NEXT: li a1, -1
160 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
161 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
163 %v = call <vscale x 2 x i8> @llvm.vp.ssub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> splat (i8 -1), <vscale x 2 x i1> %m, i32 %evl)
164 ret <vscale x 2 x i8> %v
167 define <vscale x 2 x i8> @vssub_vi_nxv2i8_unmasked(<vscale x 2 x i8> %va, i32 zeroext %evl) {
168 ; CHECK-LABEL: vssub_vi_nxv2i8_unmasked:
170 ; CHECK-NEXT: li a1, -1
171 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
172 ; CHECK-NEXT: vssub.vx v8, v8, a1
174 %v = call <vscale x 2 x i8> @llvm.vp.ssub.sat.nxv2i8(<vscale x 2 x i8> %va, <vscale x 2 x i8> splat (i8 -1), <vscale x 2 x i1> splat (i1 true), i32 %evl)
175 ret <vscale x 2 x i8> %v
178 declare <vscale x 3 x i8> @llvm.vp.ssub.sat.nxv3i8(<vscale x 3 x i8>, <vscale x 3 x i8>, <vscale x 3 x i1>, i32)
180 define <vscale x 3 x i8> @vssub_vv_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
181 ; CHECK-LABEL: vssub_vv_nxv3i8:
183 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
184 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
186 %v = call <vscale x 3 x i8> @llvm.vp.ssub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> %m, i32 %evl)
187 ret <vscale x 3 x i8> %v
190 define <vscale x 3 x i8> @vssub_vv_nxv3i8_unmasked(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, i32 zeroext %evl) {
191 ; CHECK-LABEL: vssub_vv_nxv3i8_unmasked:
193 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
194 ; CHECK-NEXT: vssub.vv v8, v8, v9
196 %v = call <vscale x 3 x i8> @llvm.vp.ssub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %b, <vscale x 3 x i1> splat (i1 true), i32 %evl)
197 ret <vscale x 3 x i8> %v
200 define <vscale x 3 x i8> @vssub_vx_nxv3i8(<vscale x 3 x i8> %va, i8 %b, <vscale x 3 x i1> %m, i32 zeroext %evl) {
201 ; CHECK-LABEL: vssub_vx_nxv3i8:
203 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
204 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
206 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
207 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
208 %v = call <vscale x 3 x i8> @llvm.vp.ssub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> %m, i32 %evl)
209 ret <vscale x 3 x i8> %v
212 define <vscale x 3 x i8> @vssub_vx_nxv3i8_unmasked(<vscale x 3 x i8> %va, i8 %b, i32 zeroext %evl) {
213 ; CHECK-LABEL: vssub_vx_nxv3i8_unmasked:
215 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
216 ; CHECK-NEXT: vssub.vx v8, v8, a0
218 %elt.head = insertelement <vscale x 3 x i8> poison, i8 %b, i32 0
219 %vb = shufflevector <vscale x 3 x i8> %elt.head, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
220 %v = call <vscale x 3 x i8> @llvm.vp.ssub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> %vb, <vscale x 3 x i1> splat (i1 true), i32 %evl)
221 ret <vscale x 3 x i8> %v
224 define <vscale x 3 x i8> @vssub_vi_nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i1> %m, i32 zeroext %evl) {
225 ; CHECK-LABEL: vssub_vi_nxv3i8:
227 ; CHECK-NEXT: li a1, -1
228 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
229 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
231 %v = call <vscale x 3 x i8> @llvm.vp.ssub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> splat (i8 -1), <vscale x 3 x i1> %m, i32 %evl)
232 ret <vscale x 3 x i8> %v
235 define <vscale x 3 x i8> @vssub_vi_nxv3i8_unmasked(<vscale x 3 x i8> %va, i32 zeroext %evl) {
236 ; CHECK-LABEL: vssub_vi_nxv3i8_unmasked:
238 ; CHECK-NEXT: li a1, -1
239 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
240 ; CHECK-NEXT: vssub.vx v8, v8, a1
242 %v = call <vscale x 3 x i8> @llvm.vp.ssub.sat.nxv3i8(<vscale x 3 x i8> %va, <vscale x 3 x i8> splat (i8 -1), <vscale x 3 x i1> splat (i1 true), i32 %evl)
243 ret <vscale x 3 x i8> %v
246 declare <vscale x 4 x i8> @llvm.vp.ssub.sat.nxv4i8(<vscale x 4 x i8>, <vscale x 4 x i8>, <vscale x 4 x i1>, i32)
248 define <vscale x 4 x i8> @vssub_vv_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
249 ; CHECK-LABEL: vssub_vv_nxv4i8:
251 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
252 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
254 %v = call <vscale x 4 x i8> @llvm.vp.ssub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> %m, i32 %evl)
255 ret <vscale x 4 x i8> %v
258 define <vscale x 4 x i8> @vssub_vv_nxv4i8_unmasked(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, i32 zeroext %evl) {
259 ; CHECK-LABEL: vssub_vv_nxv4i8_unmasked:
261 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
262 ; CHECK-NEXT: vssub.vv v8, v8, v9
264 %v = call <vscale x 4 x i8> @llvm.vp.ssub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
265 ret <vscale x 4 x i8> %v
268 define <vscale x 4 x i8> @vssub_vx_nxv4i8(<vscale x 4 x i8> %va, i8 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
269 ; CHECK-LABEL: vssub_vx_nxv4i8:
271 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
272 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
274 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
275 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
276 %v = call <vscale x 4 x i8> @llvm.vp.ssub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> %m, i32 %evl)
277 ret <vscale x 4 x i8> %v
280 define <vscale x 4 x i8> @vssub_vx_nxv4i8_unmasked(<vscale x 4 x i8> %va, i8 %b, i32 zeroext %evl) {
281 ; CHECK-LABEL: vssub_vx_nxv4i8_unmasked:
283 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
284 ; CHECK-NEXT: vssub.vx v8, v8, a0
286 %elt.head = insertelement <vscale x 4 x i8> poison, i8 %b, i32 0
287 %vb = shufflevector <vscale x 4 x i8> %elt.head, <vscale x 4 x i8> poison, <vscale x 4 x i32> zeroinitializer
288 %v = call <vscale x 4 x i8> @llvm.vp.ssub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
289 ret <vscale x 4 x i8> %v
292 define <vscale x 4 x i8> @vssub_vi_nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
293 ; CHECK-LABEL: vssub_vi_nxv4i8:
295 ; CHECK-NEXT: li a1, -1
296 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
297 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
299 %v = call <vscale x 4 x i8> @llvm.vp.ssub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> splat (i8 -1), <vscale x 4 x i1> %m, i32 %evl)
300 ret <vscale x 4 x i8> %v
303 define <vscale x 4 x i8> @vssub_vi_nxv4i8_unmasked(<vscale x 4 x i8> %va, i32 zeroext %evl) {
304 ; CHECK-LABEL: vssub_vi_nxv4i8_unmasked:
306 ; CHECK-NEXT: li a1, -1
307 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
308 ; CHECK-NEXT: vssub.vx v8, v8, a1
310 %v = call <vscale x 4 x i8> @llvm.vp.ssub.sat.nxv4i8(<vscale x 4 x i8> %va, <vscale x 4 x i8> splat (i8 -1), <vscale x 4 x i1> splat (i1 true), i32 %evl)
311 ret <vscale x 4 x i8> %v
314 declare <vscale x 8 x i8> @llvm.vp.ssub.sat.nxv8i8(<vscale x 8 x i8>, <vscale x 8 x i8>, <vscale x 8 x i1>, i32)
316 define <vscale x 8 x i8> @vssub_vv_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
317 ; CHECK-LABEL: vssub_vv_nxv8i8:
319 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
320 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
322 %v = call <vscale x 8 x i8> @llvm.vp.ssub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> %m, i32 %evl)
323 ret <vscale x 8 x i8> %v
326 define <vscale x 8 x i8> @vssub_vv_nxv8i8_unmasked(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, i32 zeroext %evl) {
327 ; CHECK-LABEL: vssub_vv_nxv8i8_unmasked:
329 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
330 ; CHECK-NEXT: vssub.vv v8, v8, v9
332 %v = call <vscale x 8 x i8> @llvm.vp.ssub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
333 ret <vscale x 8 x i8> %v
336 define <vscale x 8 x i8> @vssub_vx_nxv8i8(<vscale x 8 x i8> %va, i8 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
337 ; CHECK-LABEL: vssub_vx_nxv8i8:
339 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
340 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
342 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
343 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
344 %v = call <vscale x 8 x i8> @llvm.vp.ssub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> %m, i32 %evl)
345 ret <vscale x 8 x i8> %v
348 define <vscale x 8 x i8> @vssub_vx_nxv8i8_unmasked(<vscale x 8 x i8> %va, i8 %b, i32 zeroext %evl) {
349 ; CHECK-LABEL: vssub_vx_nxv8i8_unmasked:
351 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
352 ; CHECK-NEXT: vssub.vx v8, v8, a0
354 %elt.head = insertelement <vscale x 8 x i8> poison, i8 %b, i32 0
355 %vb = shufflevector <vscale x 8 x i8> %elt.head, <vscale x 8 x i8> poison, <vscale x 8 x i32> zeroinitializer
356 %v = call <vscale x 8 x i8> @llvm.vp.ssub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
357 ret <vscale x 8 x i8> %v
360 define <vscale x 8 x i8> @vssub_vi_nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
361 ; CHECK-LABEL: vssub_vi_nxv8i8:
363 ; CHECK-NEXT: li a1, -1
364 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
365 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
367 %v = call <vscale x 8 x i8> @llvm.vp.ssub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> splat (i8 -1), <vscale x 8 x i1> %m, i32 %evl)
368 ret <vscale x 8 x i8> %v
371 define <vscale x 8 x i8> @vssub_vi_nxv8i8_unmasked(<vscale x 8 x i8> %va, i32 zeroext %evl) {
372 ; CHECK-LABEL: vssub_vi_nxv8i8_unmasked:
374 ; CHECK-NEXT: li a1, -1
375 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
376 ; CHECK-NEXT: vssub.vx v8, v8, a1
378 %v = call <vscale x 8 x i8> @llvm.vp.ssub.sat.nxv8i8(<vscale x 8 x i8> %va, <vscale x 8 x i8> splat (i8 -1), <vscale x 8 x i1> splat (i1 true), i32 %evl)
379 ret <vscale x 8 x i8> %v
382 declare <vscale x 16 x i8> @llvm.vp.ssub.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>, <vscale x 16 x i1>, i32)
384 define <vscale x 16 x i8> @vssub_vv_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
385 ; CHECK-LABEL: vssub_vv_nxv16i8:
387 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
388 ; CHECK-NEXT: vssub.vv v8, v8, v10, v0.t
390 %v = call <vscale x 16 x i8> @llvm.vp.ssub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> %m, i32 %evl)
391 ret <vscale x 16 x i8> %v
394 define <vscale x 16 x i8> @vssub_vv_nxv16i8_unmasked(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, i32 zeroext %evl) {
395 ; CHECK-LABEL: vssub_vv_nxv16i8_unmasked:
397 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
398 ; CHECK-NEXT: vssub.vv v8, v8, v10
400 %v = call <vscale x 16 x i8> @llvm.vp.ssub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %b, <vscale x 16 x i1> splat (i1 true), i32 %evl)
401 ret <vscale x 16 x i8> %v
404 define <vscale x 16 x i8> @vssub_vx_nxv16i8(<vscale x 16 x i8> %va, i8 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
405 ; CHECK-LABEL: vssub_vx_nxv16i8:
407 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
408 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
410 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
411 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
412 %v = call <vscale x 16 x i8> @llvm.vp.ssub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> %m, i32 %evl)
413 ret <vscale x 16 x i8> %v
416 define <vscale x 16 x i8> @vssub_vx_nxv16i8_unmasked(<vscale x 16 x i8> %va, i8 %b, i32 zeroext %evl) {
417 ; CHECK-LABEL: vssub_vx_nxv16i8_unmasked:
419 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
420 ; CHECK-NEXT: vssub.vx v8, v8, a0
422 %elt.head = insertelement <vscale x 16 x i8> poison, i8 %b, i32 0
423 %vb = shufflevector <vscale x 16 x i8> %elt.head, <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer
424 %v = call <vscale x 16 x i8> @llvm.vp.ssub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> %vb, <vscale x 16 x i1> splat (i1 true), i32 %evl)
425 ret <vscale x 16 x i8> %v
428 define <vscale x 16 x i8> @vssub_vi_nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
429 ; CHECK-LABEL: vssub_vi_nxv16i8:
431 ; CHECK-NEXT: li a1, -1
432 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
433 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
435 %v = call <vscale x 16 x i8> @llvm.vp.ssub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> splat (i8 -1), <vscale x 16 x i1> %m, i32 %evl)
436 ret <vscale x 16 x i8> %v
439 define <vscale x 16 x i8> @vssub_vi_nxv16i8_unmasked(<vscale x 16 x i8> %va, i32 zeroext %evl) {
440 ; CHECK-LABEL: vssub_vi_nxv16i8_unmasked:
442 ; CHECK-NEXT: li a1, -1
443 ; CHECK-NEXT: vsetvli zero, a0, e8, m2, ta, ma
444 ; CHECK-NEXT: vssub.vx v8, v8, a1
446 %v = call <vscale x 16 x i8> @llvm.vp.ssub.sat.nxv16i8(<vscale x 16 x i8> %va, <vscale x 16 x i8> splat (i8 -1), <vscale x 16 x i1> splat (i1 true), i32 %evl)
447 ret <vscale x 16 x i8> %v
450 declare <vscale x 32 x i8> @llvm.vp.ssub.sat.nxv32i8(<vscale x 32 x i8>, <vscale x 32 x i8>, <vscale x 32 x i1>, i32)
452 define <vscale x 32 x i8> @vssub_vv_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
453 ; CHECK-LABEL: vssub_vv_nxv32i8:
455 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
456 ; CHECK-NEXT: vssub.vv v8, v8, v12, v0.t
458 %v = call <vscale x 32 x i8> @llvm.vp.ssub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> %m, i32 %evl)
459 ret <vscale x 32 x i8> %v
462 define <vscale x 32 x i8> @vssub_vv_nxv32i8_unmasked(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, i32 zeroext %evl) {
463 ; CHECK-LABEL: vssub_vv_nxv32i8_unmasked:
465 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
466 ; CHECK-NEXT: vssub.vv v8, v8, v12
468 %v = call <vscale x 32 x i8> @llvm.vp.ssub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %b, <vscale x 32 x i1> splat (i1 true), i32 %evl)
469 ret <vscale x 32 x i8> %v
472 define <vscale x 32 x i8> @vssub_vx_nxv32i8(<vscale x 32 x i8> %va, i8 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
473 ; CHECK-LABEL: vssub_vx_nxv32i8:
475 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
476 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
478 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
479 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
480 %v = call <vscale x 32 x i8> @llvm.vp.ssub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> %m, i32 %evl)
481 ret <vscale x 32 x i8> %v
484 define <vscale x 32 x i8> @vssub_vx_nxv32i8_unmasked(<vscale x 32 x i8> %va, i8 %b, i32 zeroext %evl) {
485 ; CHECK-LABEL: vssub_vx_nxv32i8_unmasked:
487 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
488 ; CHECK-NEXT: vssub.vx v8, v8, a0
490 %elt.head = insertelement <vscale x 32 x i8> poison, i8 %b, i32 0
491 %vb = shufflevector <vscale x 32 x i8> %elt.head, <vscale x 32 x i8> poison, <vscale x 32 x i32> zeroinitializer
492 %v = call <vscale x 32 x i8> @llvm.vp.ssub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> %vb, <vscale x 32 x i1> splat (i1 true), i32 %evl)
493 ret <vscale x 32 x i8> %v
496 define <vscale x 32 x i8> @vssub_vi_nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
497 ; CHECK-LABEL: vssub_vi_nxv32i8:
499 ; CHECK-NEXT: li a1, -1
500 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
501 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
503 %v = call <vscale x 32 x i8> @llvm.vp.ssub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> splat (i8 -1), <vscale x 32 x i1> %m, i32 %evl)
504 ret <vscale x 32 x i8> %v
507 define <vscale x 32 x i8> @vssub_vi_nxv32i8_unmasked(<vscale x 32 x i8> %va, i32 zeroext %evl) {
508 ; CHECK-LABEL: vssub_vi_nxv32i8_unmasked:
510 ; CHECK-NEXT: li a1, -1
511 ; CHECK-NEXT: vsetvli zero, a0, e8, m4, ta, ma
512 ; CHECK-NEXT: vssub.vx v8, v8, a1
514 %v = call <vscale x 32 x i8> @llvm.vp.ssub.sat.nxv32i8(<vscale x 32 x i8> %va, <vscale x 32 x i8> splat (i8 -1), <vscale x 32 x i1> splat (i1 true), i32 %evl)
515 ret <vscale x 32 x i8> %v
518 declare <vscale x 64 x i8> @llvm.vp.ssub.sat.nxv64i8(<vscale x 64 x i8>, <vscale x 64 x i8>, <vscale x 64 x i1>, i32)
520 define <vscale x 64 x i8> @vssub_vv_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
521 ; CHECK-LABEL: vssub_vv_nxv64i8:
523 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
524 ; CHECK-NEXT: vssub.vv v8, v8, v16, v0.t
526 %v = call <vscale x 64 x i8> @llvm.vp.ssub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> %m, i32 %evl)
527 ret <vscale x 64 x i8> %v
530 define <vscale x 64 x i8> @vssub_vv_nxv64i8_unmasked(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, i32 zeroext %evl) {
531 ; CHECK-LABEL: vssub_vv_nxv64i8_unmasked:
533 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
534 ; CHECK-NEXT: vssub.vv v8, v8, v16
536 %v = call <vscale x 64 x i8> @llvm.vp.ssub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %b, <vscale x 64 x i1> splat (i1 true), i32 %evl)
537 ret <vscale x 64 x i8> %v
540 define <vscale x 64 x i8> @vssub_vx_nxv64i8(<vscale x 64 x i8> %va, i8 %b, <vscale x 64 x i1> %m, i32 zeroext %evl) {
541 ; CHECK-LABEL: vssub_vx_nxv64i8:
543 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
544 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
546 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
547 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
548 %v = call <vscale x 64 x i8> @llvm.vp.ssub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> %m, i32 %evl)
549 ret <vscale x 64 x i8> %v
552 define <vscale x 64 x i8> @vssub_vx_nxv64i8_unmasked(<vscale x 64 x i8> %va, i8 %b, i32 zeroext %evl) {
553 ; CHECK-LABEL: vssub_vx_nxv64i8_unmasked:
555 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
556 ; CHECK-NEXT: vssub.vx v8, v8, a0
558 %elt.head = insertelement <vscale x 64 x i8> poison, i8 %b, i32 0
559 %vb = shufflevector <vscale x 64 x i8> %elt.head, <vscale x 64 x i8> poison, <vscale x 64 x i32> zeroinitializer
560 %v = call <vscale x 64 x i8> @llvm.vp.ssub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> %vb, <vscale x 64 x i1> splat (i1 true), i32 %evl)
561 ret <vscale x 64 x i8> %v
564 define <vscale x 64 x i8> @vssub_vi_nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i1> %m, i32 zeroext %evl) {
565 ; CHECK-LABEL: vssub_vi_nxv64i8:
567 ; CHECK-NEXT: li a1, -1
568 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
569 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
571 %v = call <vscale x 64 x i8> @llvm.vp.ssub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> splat (i8 -1), <vscale x 64 x i1> %m, i32 %evl)
572 ret <vscale x 64 x i8> %v
575 define <vscale x 64 x i8> @vssub_vi_nxv64i8_unmasked(<vscale x 64 x i8> %va, i32 zeroext %evl) {
576 ; CHECK-LABEL: vssub_vi_nxv64i8_unmasked:
578 ; CHECK-NEXT: li a1, -1
579 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
580 ; CHECK-NEXT: vssub.vx v8, v8, a1
582 %v = call <vscale x 64 x i8> @llvm.vp.ssub.sat.nxv64i8(<vscale x 64 x i8> %va, <vscale x 64 x i8> splat (i8 -1), <vscale x 64 x i1> splat (i1 true), i32 %evl)
583 ret <vscale x 64 x i8> %v
586 ; Test that split-legalization works when the mask itself needs splitting.
588 declare <vscale x 128 x i8> @llvm.vp.ssub.sat.nxv128i8(<vscale x 128 x i8>, <vscale x 128 x i8>, <vscale x 128 x i1>, i32)
590 define <vscale x 128 x i8> @vssub_vi_nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i1> %m, i32 zeroext %evl) {
591 ; CHECK-LABEL: vssub_vi_nxv128i8:
593 ; CHECK-NEXT: vmv1r.v v24, v0
594 ; CHECK-NEXT: vsetvli a2, zero, e8, m8, ta, ma
595 ; CHECK-NEXT: vlm.v v0, (a0)
596 ; CHECK-NEXT: csrr a0, vlenb
597 ; CHECK-NEXT: slli a0, a0, 3
598 ; CHECK-NEXT: sub a2, a1, a0
599 ; CHECK-NEXT: sltu a3, a1, a2
600 ; CHECK-NEXT: addi a3, a3, -1
601 ; CHECK-NEXT: and a3, a3, a2
602 ; CHECK-NEXT: li a2, -1
603 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
604 ; CHECK-NEXT: vssub.vx v16, v16, a2, v0.t
605 ; CHECK-NEXT: bltu a1, a0, .LBB50_2
606 ; CHECK-NEXT: # %bb.1:
607 ; CHECK-NEXT: mv a1, a0
608 ; CHECK-NEXT: .LBB50_2:
609 ; CHECK-NEXT: vmv1r.v v0, v24
610 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
611 ; CHECK-NEXT: vssub.vx v8, v8, a2, v0.t
613 %v = call <vscale x 128 x i8> @llvm.vp.ssub.sat.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> splat (i8 -1), <vscale x 128 x i1> %m, i32 %evl)
614 ret <vscale x 128 x i8> %v
617 define <vscale x 128 x i8> @vssub_vi_nxv128i8_unmasked(<vscale x 128 x i8> %va, i32 zeroext %evl) {
618 ; CHECK-LABEL: vssub_vi_nxv128i8_unmasked:
620 ; CHECK-NEXT: csrr a1, vlenb
621 ; CHECK-NEXT: slli a1, a1, 3
622 ; CHECK-NEXT: sub a2, a0, a1
623 ; CHECK-NEXT: sltu a3, a0, a2
624 ; CHECK-NEXT: addi a3, a3, -1
625 ; CHECK-NEXT: and a3, a3, a2
626 ; CHECK-NEXT: li a2, -1
627 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
628 ; CHECK-NEXT: vssub.vx v16, v16, a2
629 ; CHECK-NEXT: bltu a0, a1, .LBB51_2
630 ; CHECK-NEXT: # %bb.1:
631 ; CHECK-NEXT: mv a0, a1
632 ; CHECK-NEXT: .LBB51_2:
633 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
634 ; CHECK-NEXT: vssub.vx v8, v8, a2
636 %v = call <vscale x 128 x i8> @llvm.vp.ssub.sat.nxv128i8(<vscale x 128 x i8> %va, <vscale x 128 x i8> splat (i8 -1), <vscale x 128 x i1> splat (i1 true), i32 %evl)
637 ret <vscale x 128 x i8> %v
640 declare <vscale x 1 x i16> @llvm.vp.ssub.sat.nxv1i16(<vscale x 1 x i16>, <vscale x 1 x i16>, <vscale x 1 x i1>, i32)
642 define <vscale x 1 x i16> @vssub_vv_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
643 ; CHECK-LABEL: vssub_vv_nxv1i16:
645 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
646 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
648 %v = call <vscale x 1 x i16> @llvm.vp.ssub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> %m, i32 %evl)
649 ret <vscale x 1 x i16> %v
652 define <vscale x 1 x i16> @vssub_vv_nxv1i16_unmasked(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, i32 zeroext %evl) {
653 ; CHECK-LABEL: vssub_vv_nxv1i16_unmasked:
655 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
656 ; CHECK-NEXT: vssub.vv v8, v8, v9
658 %v = call <vscale x 1 x i16> @llvm.vp.ssub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
659 ret <vscale x 1 x i16> %v
662 define <vscale x 1 x i16> @vssub_vx_nxv1i16(<vscale x 1 x i16> %va, i16 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
663 ; CHECK-LABEL: vssub_vx_nxv1i16:
665 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
666 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
668 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
669 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
670 %v = call <vscale x 1 x i16> @llvm.vp.ssub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> %m, i32 %evl)
671 ret <vscale x 1 x i16> %v
674 define <vscale x 1 x i16> @vssub_vx_nxv1i16_unmasked(<vscale x 1 x i16> %va, i16 %b, i32 zeroext %evl) {
675 ; CHECK-LABEL: vssub_vx_nxv1i16_unmasked:
677 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
678 ; CHECK-NEXT: vssub.vx v8, v8, a0
680 %elt.head = insertelement <vscale x 1 x i16> poison, i16 %b, i32 0
681 %vb = shufflevector <vscale x 1 x i16> %elt.head, <vscale x 1 x i16> poison, <vscale x 1 x i32> zeroinitializer
682 %v = call <vscale x 1 x i16> @llvm.vp.ssub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
683 ret <vscale x 1 x i16> %v
686 define <vscale x 1 x i16> @vssub_vi_nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
687 ; CHECK-LABEL: vssub_vi_nxv1i16:
689 ; CHECK-NEXT: li a1, -1
690 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
691 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
693 %v = call <vscale x 1 x i16> @llvm.vp.ssub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> splat (i16 -1), <vscale x 1 x i1> %m, i32 %evl)
694 ret <vscale x 1 x i16> %v
697 define <vscale x 1 x i16> @vssub_vi_nxv1i16_unmasked(<vscale x 1 x i16> %va, i32 zeroext %evl) {
698 ; CHECK-LABEL: vssub_vi_nxv1i16_unmasked:
700 ; CHECK-NEXT: li a1, -1
701 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
702 ; CHECK-NEXT: vssub.vx v8, v8, a1
704 %v = call <vscale x 1 x i16> @llvm.vp.ssub.sat.nxv1i16(<vscale x 1 x i16> %va, <vscale x 1 x i16> splat (i16 -1), <vscale x 1 x i1> splat (i1 true), i32 %evl)
705 ret <vscale x 1 x i16> %v
708 declare <vscale x 2 x i16> @llvm.vp.ssub.sat.nxv2i16(<vscale x 2 x i16>, <vscale x 2 x i16>, <vscale x 2 x i1>, i32)
710 define <vscale x 2 x i16> @vssub_vv_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
711 ; CHECK-LABEL: vssub_vv_nxv2i16:
713 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
714 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
716 %v = call <vscale x 2 x i16> @llvm.vp.ssub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> %m, i32 %evl)
717 ret <vscale x 2 x i16> %v
720 define <vscale x 2 x i16> @vssub_vv_nxv2i16_unmasked(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, i32 zeroext %evl) {
721 ; CHECK-LABEL: vssub_vv_nxv2i16_unmasked:
723 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
724 ; CHECK-NEXT: vssub.vv v8, v8, v9
726 %v = call <vscale x 2 x i16> @llvm.vp.ssub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
727 ret <vscale x 2 x i16> %v
730 define <vscale x 2 x i16> @vssub_vx_nxv2i16(<vscale x 2 x i16> %va, i16 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
731 ; CHECK-LABEL: vssub_vx_nxv2i16:
733 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
734 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
736 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
737 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
738 %v = call <vscale x 2 x i16> @llvm.vp.ssub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> %m, i32 %evl)
739 ret <vscale x 2 x i16> %v
742 define <vscale x 2 x i16> @vssub_vx_nxv2i16_unmasked(<vscale x 2 x i16> %va, i16 %b, i32 zeroext %evl) {
743 ; CHECK-LABEL: vssub_vx_nxv2i16_unmasked:
745 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
746 ; CHECK-NEXT: vssub.vx v8, v8, a0
748 %elt.head = insertelement <vscale x 2 x i16> poison, i16 %b, i32 0
749 %vb = shufflevector <vscale x 2 x i16> %elt.head, <vscale x 2 x i16> poison, <vscale x 2 x i32> zeroinitializer
750 %v = call <vscale x 2 x i16> @llvm.vp.ssub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
751 ret <vscale x 2 x i16> %v
754 define <vscale x 2 x i16> @vssub_vi_nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
755 ; CHECK-LABEL: vssub_vi_nxv2i16:
757 ; CHECK-NEXT: li a1, -1
758 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
759 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
761 %v = call <vscale x 2 x i16> @llvm.vp.ssub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> splat (i16 -1), <vscale x 2 x i1> %m, i32 %evl)
762 ret <vscale x 2 x i16> %v
765 define <vscale x 2 x i16> @vssub_vi_nxv2i16_unmasked(<vscale x 2 x i16> %va, i32 zeroext %evl) {
766 ; CHECK-LABEL: vssub_vi_nxv2i16_unmasked:
768 ; CHECK-NEXT: li a1, -1
769 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
770 ; CHECK-NEXT: vssub.vx v8, v8, a1
772 %v = call <vscale x 2 x i16> @llvm.vp.ssub.sat.nxv2i16(<vscale x 2 x i16> %va, <vscale x 2 x i16> splat (i16 -1), <vscale x 2 x i1> splat (i1 true), i32 %evl)
773 ret <vscale x 2 x i16> %v
776 declare <vscale x 4 x i16> @llvm.vp.ssub.sat.nxv4i16(<vscale x 4 x i16>, <vscale x 4 x i16>, <vscale x 4 x i1>, i32)
778 define <vscale x 4 x i16> @vssub_vv_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
779 ; CHECK-LABEL: vssub_vv_nxv4i16:
781 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
782 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
784 %v = call <vscale x 4 x i16> @llvm.vp.ssub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> %m, i32 %evl)
785 ret <vscale x 4 x i16> %v
788 define <vscale x 4 x i16> @vssub_vv_nxv4i16_unmasked(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, i32 zeroext %evl) {
789 ; CHECK-LABEL: vssub_vv_nxv4i16_unmasked:
791 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
792 ; CHECK-NEXT: vssub.vv v8, v8, v9
794 %v = call <vscale x 4 x i16> @llvm.vp.ssub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
795 ret <vscale x 4 x i16> %v
798 define <vscale x 4 x i16> @vssub_vx_nxv4i16(<vscale x 4 x i16> %va, i16 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
799 ; CHECK-LABEL: vssub_vx_nxv4i16:
801 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
802 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
804 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
805 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
806 %v = call <vscale x 4 x i16> @llvm.vp.ssub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> %m, i32 %evl)
807 ret <vscale x 4 x i16> %v
810 define <vscale x 4 x i16> @vssub_vx_nxv4i16_unmasked(<vscale x 4 x i16> %va, i16 %b, i32 zeroext %evl) {
811 ; CHECK-LABEL: vssub_vx_nxv4i16_unmasked:
813 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
814 ; CHECK-NEXT: vssub.vx v8, v8, a0
816 %elt.head = insertelement <vscale x 4 x i16> poison, i16 %b, i32 0
817 %vb = shufflevector <vscale x 4 x i16> %elt.head, <vscale x 4 x i16> poison, <vscale x 4 x i32> zeroinitializer
818 %v = call <vscale x 4 x i16> @llvm.vp.ssub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
819 ret <vscale x 4 x i16> %v
822 define <vscale x 4 x i16> @vssub_vi_nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
823 ; CHECK-LABEL: vssub_vi_nxv4i16:
825 ; CHECK-NEXT: li a1, -1
826 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
827 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
829 %v = call <vscale x 4 x i16> @llvm.vp.ssub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> splat (i16 -1), <vscale x 4 x i1> %m, i32 %evl)
830 ret <vscale x 4 x i16> %v
833 define <vscale x 4 x i16> @vssub_vi_nxv4i16_unmasked(<vscale x 4 x i16> %va, i32 zeroext %evl) {
834 ; CHECK-LABEL: vssub_vi_nxv4i16_unmasked:
836 ; CHECK-NEXT: li a1, -1
837 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
838 ; CHECK-NEXT: vssub.vx v8, v8, a1
840 %v = call <vscale x 4 x i16> @llvm.vp.ssub.sat.nxv4i16(<vscale x 4 x i16> %va, <vscale x 4 x i16> splat (i16 -1), <vscale x 4 x i1> splat (i1 true), i32 %evl)
841 ret <vscale x 4 x i16> %v
844 declare <vscale x 8 x i16> @llvm.vp.ssub.sat.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>, <vscale x 8 x i1>, i32)
846 define <vscale x 8 x i16> @vssub_vv_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
847 ; CHECK-LABEL: vssub_vv_nxv8i16:
849 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
850 ; CHECK-NEXT: vssub.vv v8, v8, v10, v0.t
852 %v = call <vscale x 8 x i16> @llvm.vp.ssub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> %m, i32 %evl)
853 ret <vscale x 8 x i16> %v
856 define <vscale x 8 x i16> @vssub_vv_nxv8i16_unmasked(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, i32 zeroext %evl) {
857 ; CHECK-LABEL: vssub_vv_nxv8i16_unmasked:
859 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
860 ; CHECK-NEXT: vssub.vv v8, v8, v10
862 %v = call <vscale x 8 x i16> @llvm.vp.ssub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
863 ret <vscale x 8 x i16> %v
866 define <vscale x 8 x i16> @vssub_vx_nxv8i16(<vscale x 8 x i16> %va, i16 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
867 ; CHECK-LABEL: vssub_vx_nxv8i16:
869 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
870 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
872 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
873 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
874 %v = call <vscale x 8 x i16> @llvm.vp.ssub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> %m, i32 %evl)
875 ret <vscale x 8 x i16> %v
878 define <vscale x 8 x i16> @vssub_vx_nxv8i16_unmasked(<vscale x 8 x i16> %va, i16 %b, i32 zeroext %evl) {
879 ; CHECK-LABEL: vssub_vx_nxv8i16_unmasked:
881 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
882 ; CHECK-NEXT: vssub.vx v8, v8, a0
884 %elt.head = insertelement <vscale x 8 x i16> poison, i16 %b, i32 0
885 %vb = shufflevector <vscale x 8 x i16> %elt.head, <vscale x 8 x i16> poison, <vscale x 8 x i32> zeroinitializer
886 %v = call <vscale x 8 x i16> @llvm.vp.ssub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
887 ret <vscale x 8 x i16> %v
890 define <vscale x 8 x i16> @vssub_vi_nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
891 ; CHECK-LABEL: vssub_vi_nxv8i16:
893 ; CHECK-NEXT: li a1, -1
894 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
895 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
897 %v = call <vscale x 8 x i16> @llvm.vp.ssub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> splat (i16 -1), <vscale x 8 x i1> %m, i32 %evl)
898 ret <vscale x 8 x i16> %v
901 define <vscale x 8 x i16> @vssub_vi_nxv8i16_unmasked(<vscale x 8 x i16> %va, i32 zeroext %evl) {
902 ; CHECK-LABEL: vssub_vi_nxv8i16_unmasked:
904 ; CHECK-NEXT: li a1, -1
905 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
906 ; CHECK-NEXT: vssub.vx v8, v8, a1
908 %v = call <vscale x 8 x i16> @llvm.vp.ssub.sat.nxv8i16(<vscale x 8 x i16> %va, <vscale x 8 x i16> splat (i16 -1), <vscale x 8 x i1> splat (i1 true), i32 %evl)
909 ret <vscale x 8 x i16> %v
912 declare <vscale x 16 x i16> @llvm.vp.ssub.sat.nxv16i16(<vscale x 16 x i16>, <vscale x 16 x i16>, <vscale x 16 x i1>, i32)
914 define <vscale x 16 x i16> @vssub_vv_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
915 ; CHECK-LABEL: vssub_vv_nxv16i16:
917 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
918 ; CHECK-NEXT: vssub.vv v8, v8, v12, v0.t
920 %v = call <vscale x 16 x i16> @llvm.vp.ssub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> %m, i32 %evl)
921 ret <vscale x 16 x i16> %v
924 define <vscale x 16 x i16> @vssub_vv_nxv16i16_unmasked(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, i32 zeroext %evl) {
925 ; CHECK-LABEL: vssub_vv_nxv16i16_unmasked:
927 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
928 ; CHECK-NEXT: vssub.vv v8, v8, v12
930 %v = call <vscale x 16 x i16> @llvm.vp.ssub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %b, <vscale x 16 x i1> splat (i1 true), i32 %evl)
931 ret <vscale x 16 x i16> %v
934 define <vscale x 16 x i16> @vssub_vx_nxv16i16(<vscale x 16 x i16> %va, i16 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
935 ; CHECK-LABEL: vssub_vx_nxv16i16:
937 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
938 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
940 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
941 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
942 %v = call <vscale x 16 x i16> @llvm.vp.ssub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> %m, i32 %evl)
943 ret <vscale x 16 x i16> %v
946 define <vscale x 16 x i16> @vssub_vx_nxv16i16_unmasked(<vscale x 16 x i16> %va, i16 %b, i32 zeroext %evl) {
947 ; CHECK-LABEL: vssub_vx_nxv16i16_unmasked:
949 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
950 ; CHECK-NEXT: vssub.vx v8, v8, a0
952 %elt.head = insertelement <vscale x 16 x i16> poison, i16 %b, i32 0
953 %vb = shufflevector <vscale x 16 x i16> %elt.head, <vscale x 16 x i16> poison, <vscale x 16 x i32> zeroinitializer
954 %v = call <vscale x 16 x i16> @llvm.vp.ssub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> %vb, <vscale x 16 x i1> splat (i1 true), i32 %evl)
955 ret <vscale x 16 x i16> %v
958 define <vscale x 16 x i16> @vssub_vi_nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
959 ; CHECK-LABEL: vssub_vi_nxv16i16:
961 ; CHECK-NEXT: li a1, -1
962 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
963 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
965 %v = call <vscale x 16 x i16> @llvm.vp.ssub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> splat (i16 -1), <vscale x 16 x i1> %m, i32 %evl)
966 ret <vscale x 16 x i16> %v
969 define <vscale x 16 x i16> @vssub_vi_nxv16i16_unmasked(<vscale x 16 x i16> %va, i32 zeroext %evl) {
970 ; CHECK-LABEL: vssub_vi_nxv16i16_unmasked:
972 ; CHECK-NEXT: li a1, -1
973 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
974 ; CHECK-NEXT: vssub.vx v8, v8, a1
976 %v = call <vscale x 16 x i16> @llvm.vp.ssub.sat.nxv16i16(<vscale x 16 x i16> %va, <vscale x 16 x i16> splat (i16 -1), <vscale x 16 x i1> splat (i1 true), i32 %evl)
977 ret <vscale x 16 x i16> %v
980 declare <vscale x 32 x i16> @llvm.vp.ssub.sat.nxv32i16(<vscale x 32 x i16>, <vscale x 32 x i16>, <vscale x 32 x i1>, i32)
982 define <vscale x 32 x i16> @vssub_vv_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
983 ; CHECK-LABEL: vssub_vv_nxv32i16:
985 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
986 ; CHECK-NEXT: vssub.vv v8, v8, v16, v0.t
988 %v = call <vscale x 32 x i16> @llvm.vp.ssub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> %m, i32 %evl)
989 ret <vscale x 32 x i16> %v
992 define <vscale x 32 x i16> @vssub_vv_nxv32i16_unmasked(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, i32 zeroext %evl) {
993 ; CHECK-LABEL: vssub_vv_nxv32i16_unmasked:
995 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
996 ; CHECK-NEXT: vssub.vv v8, v8, v16
998 %v = call <vscale x 32 x i16> @llvm.vp.ssub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %b, <vscale x 32 x i1> splat (i1 true), i32 %evl)
999 ret <vscale x 32 x i16> %v
1002 define <vscale x 32 x i16> @vssub_vx_nxv32i16(<vscale x 32 x i16> %va, i16 %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1003 ; CHECK-LABEL: vssub_vx_nxv32i16:
1005 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
1006 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
1008 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
1009 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
1010 %v = call <vscale x 32 x i16> @llvm.vp.ssub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> %m, i32 %evl)
1011 ret <vscale x 32 x i16> %v
1014 define <vscale x 32 x i16> @vssub_vx_nxv32i16_unmasked(<vscale x 32 x i16> %va, i16 %b, i32 zeroext %evl) {
1015 ; CHECK-LABEL: vssub_vx_nxv32i16_unmasked:
1017 ; CHECK-NEXT: vsetvli zero, a1, e16, m8, ta, ma
1018 ; CHECK-NEXT: vssub.vx v8, v8, a0
1020 %elt.head = insertelement <vscale x 32 x i16> poison, i16 %b, i32 0
1021 %vb = shufflevector <vscale x 32 x i16> %elt.head, <vscale x 32 x i16> poison, <vscale x 32 x i32> zeroinitializer
1022 %v = call <vscale x 32 x i16> @llvm.vp.ssub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> %vb, <vscale x 32 x i1> splat (i1 true), i32 %evl)
1023 ret <vscale x 32 x i16> %v
1026 define <vscale x 32 x i16> @vssub_vi_nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1027 ; CHECK-LABEL: vssub_vi_nxv32i16:
1029 ; CHECK-NEXT: li a1, -1
1030 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
1031 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1033 %v = call <vscale x 32 x i16> @llvm.vp.ssub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> splat (i16 -1), <vscale x 32 x i1> %m, i32 %evl)
1034 ret <vscale x 32 x i16> %v
1037 define <vscale x 32 x i16> @vssub_vi_nxv32i16_unmasked(<vscale x 32 x i16> %va, i32 zeroext %evl) {
1038 ; CHECK-LABEL: vssub_vi_nxv32i16_unmasked:
1040 ; CHECK-NEXT: li a1, -1
1041 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
1042 ; CHECK-NEXT: vssub.vx v8, v8, a1
1044 %v = call <vscale x 32 x i16> @llvm.vp.ssub.sat.nxv32i16(<vscale x 32 x i16> %va, <vscale x 32 x i16> splat (i16 -1), <vscale x 32 x i1> splat (i1 true), i32 %evl)
1045 ret <vscale x 32 x i16> %v
1048 declare <vscale x 1 x i32> @llvm.vp.ssub.sat.nxv1i32(<vscale x 1 x i32>, <vscale x 1 x i32>, <vscale x 1 x i1>, i32)
1050 define <vscale x 1 x i32> @vssub_vv_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1051 ; CHECK-LABEL: vssub_vv_nxv1i32:
1053 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1054 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
1056 %v = call <vscale x 1 x i32> @llvm.vp.ssub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> %m, i32 %evl)
1057 ret <vscale x 1 x i32> %v
1060 define <vscale x 1 x i32> @vssub_vv_nxv1i32_unmasked(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, i32 zeroext %evl) {
1061 ; CHECK-LABEL: vssub_vv_nxv1i32_unmasked:
1063 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1064 ; CHECK-NEXT: vssub.vv v8, v8, v9
1066 %v = call <vscale x 1 x i32> @llvm.vp.ssub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1067 ret <vscale x 1 x i32> %v
1070 define <vscale x 1 x i32> @vssub_vx_nxv1i32(<vscale x 1 x i32> %va, i32 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1071 ; CHECK-LABEL: vssub_vx_nxv1i32:
1073 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1074 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
1076 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
1077 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1078 %v = call <vscale x 1 x i32> @llvm.vp.ssub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> %m, i32 %evl)
1079 ret <vscale x 1 x i32> %v
1082 define <vscale x 1 x i32> @vssub_vx_nxv1i32_unmasked(<vscale x 1 x i32> %va, i32 %b, i32 zeroext %evl) {
1083 ; CHECK-LABEL: vssub_vx_nxv1i32_unmasked:
1085 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
1086 ; CHECK-NEXT: vssub.vx v8, v8, a0
1088 %elt.head = insertelement <vscale x 1 x i32> poison, i32 %b, i32 0
1089 %vb = shufflevector <vscale x 1 x i32> %elt.head, <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer
1090 %v = call <vscale x 1 x i32> @llvm.vp.ssub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1091 ret <vscale x 1 x i32> %v
1094 define <vscale x 1 x i32> @vssub_vi_nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1095 ; CHECK-LABEL: vssub_vi_nxv1i32:
1097 ; CHECK-NEXT: li a1, -1
1098 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1099 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1101 %v = call <vscale x 1 x i32> @llvm.vp.ssub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> splat (i32 -1), <vscale x 1 x i1> %m, i32 %evl)
1102 ret <vscale x 1 x i32> %v
1105 define <vscale x 1 x i32> @vssub_vi_nxv1i32_unmasked(<vscale x 1 x i32> %va, i32 zeroext %evl) {
1106 ; CHECK-LABEL: vssub_vi_nxv1i32_unmasked:
1108 ; CHECK-NEXT: li a1, -1
1109 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
1110 ; CHECK-NEXT: vssub.vx v8, v8, a1
1112 %v = call <vscale x 1 x i32> @llvm.vp.ssub.sat.nxv1i32(<vscale x 1 x i32> %va, <vscale x 1 x i32> splat (i32 -1), <vscale x 1 x i1> splat (i1 true), i32 %evl)
1113 ret <vscale x 1 x i32> %v
1116 declare <vscale x 2 x i32> @llvm.vp.ssub.sat.nxv2i32(<vscale x 2 x i32>, <vscale x 2 x i32>, <vscale x 2 x i1>, i32)
1118 define <vscale x 2 x i32> @vssub_vv_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1119 ; CHECK-LABEL: vssub_vv_nxv2i32:
1121 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1122 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
1124 %v = call <vscale x 2 x i32> @llvm.vp.ssub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> %m, i32 %evl)
1125 ret <vscale x 2 x i32> %v
1128 define <vscale x 2 x i32> @vssub_vv_nxv2i32_unmasked(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, i32 zeroext %evl) {
1129 ; CHECK-LABEL: vssub_vv_nxv2i32_unmasked:
1131 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1132 ; CHECK-NEXT: vssub.vv v8, v8, v9
1134 %v = call <vscale x 2 x i32> @llvm.vp.ssub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1135 ret <vscale x 2 x i32> %v
1138 define <vscale x 2 x i32> @vssub_vx_nxv2i32(<vscale x 2 x i32> %va, i32 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1139 ; CHECK-LABEL: vssub_vx_nxv2i32:
1141 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1142 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
1144 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
1145 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1146 %v = call <vscale x 2 x i32> @llvm.vp.ssub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> %m, i32 %evl)
1147 ret <vscale x 2 x i32> %v
1150 define <vscale x 2 x i32> @vssub_vx_nxv2i32_unmasked(<vscale x 2 x i32> %va, i32 %b, i32 zeroext %evl) {
1151 ; CHECK-LABEL: vssub_vx_nxv2i32_unmasked:
1153 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
1154 ; CHECK-NEXT: vssub.vx v8, v8, a0
1156 %elt.head = insertelement <vscale x 2 x i32> poison, i32 %b, i32 0
1157 %vb = shufflevector <vscale x 2 x i32> %elt.head, <vscale x 2 x i32> poison, <vscale x 2 x i32> zeroinitializer
1158 %v = call <vscale x 2 x i32> @llvm.vp.ssub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1159 ret <vscale x 2 x i32> %v
1162 define <vscale x 2 x i32> @vssub_vi_nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1163 ; CHECK-LABEL: vssub_vi_nxv2i32:
1165 ; CHECK-NEXT: li a1, -1
1166 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1167 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1169 %v = call <vscale x 2 x i32> @llvm.vp.ssub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> splat (i32 -1), <vscale x 2 x i1> %m, i32 %evl)
1170 ret <vscale x 2 x i32> %v
1173 define <vscale x 2 x i32> @vssub_vi_nxv2i32_unmasked(<vscale x 2 x i32> %va, i32 zeroext %evl) {
1174 ; CHECK-LABEL: vssub_vi_nxv2i32_unmasked:
1176 ; CHECK-NEXT: li a1, -1
1177 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
1178 ; CHECK-NEXT: vssub.vx v8, v8, a1
1180 %v = call <vscale x 2 x i32> @llvm.vp.ssub.sat.nxv2i32(<vscale x 2 x i32> %va, <vscale x 2 x i32> splat (i32 -1), <vscale x 2 x i1> splat (i1 true), i32 %evl)
1181 ret <vscale x 2 x i32> %v
1184 declare <vscale x 4 x i32> @llvm.vp.ssub.sat.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>, <vscale x 4 x i1>, i32)
1186 define <vscale x 4 x i32> @vssub_vv_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1187 ; CHECK-LABEL: vssub_vv_nxv4i32:
1189 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1190 ; CHECK-NEXT: vssub.vv v8, v8, v10, v0.t
1192 %v = call <vscale x 4 x i32> @llvm.vp.ssub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> %m, i32 %evl)
1193 ret <vscale x 4 x i32> %v
1196 define <vscale x 4 x i32> @vssub_vv_nxv4i32_unmasked(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, i32 zeroext %evl) {
1197 ; CHECK-LABEL: vssub_vv_nxv4i32_unmasked:
1199 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1200 ; CHECK-NEXT: vssub.vv v8, v8, v10
1202 %v = call <vscale x 4 x i32> @llvm.vp.ssub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1203 ret <vscale x 4 x i32> %v
1206 define <vscale x 4 x i32> @vssub_vx_nxv4i32(<vscale x 4 x i32> %va, i32 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1207 ; CHECK-LABEL: vssub_vx_nxv4i32:
1209 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1210 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
1212 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
1213 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1214 %v = call <vscale x 4 x i32> @llvm.vp.ssub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> %m, i32 %evl)
1215 ret <vscale x 4 x i32> %v
1218 define <vscale x 4 x i32> @vssub_vx_nxv4i32_unmasked(<vscale x 4 x i32> %va, i32 %b, i32 zeroext %evl) {
1219 ; CHECK-LABEL: vssub_vx_nxv4i32_unmasked:
1221 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
1222 ; CHECK-NEXT: vssub.vx v8, v8, a0
1224 %elt.head = insertelement <vscale x 4 x i32> poison, i32 %b, i32 0
1225 %vb = shufflevector <vscale x 4 x i32> %elt.head, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
1226 %v = call <vscale x 4 x i32> @llvm.vp.ssub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1227 ret <vscale x 4 x i32> %v
1230 define <vscale x 4 x i32> @vssub_vi_nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1231 ; CHECK-LABEL: vssub_vi_nxv4i32:
1233 ; CHECK-NEXT: li a1, -1
1234 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1235 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1237 %v = call <vscale x 4 x i32> @llvm.vp.ssub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> splat (i32 -1), <vscale x 4 x i1> %m, i32 %evl)
1238 ret <vscale x 4 x i32> %v
1241 define <vscale x 4 x i32> @vssub_vi_nxv4i32_unmasked(<vscale x 4 x i32> %va, i32 zeroext %evl) {
1242 ; CHECK-LABEL: vssub_vi_nxv4i32_unmasked:
1244 ; CHECK-NEXT: li a1, -1
1245 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1246 ; CHECK-NEXT: vssub.vx v8, v8, a1
1248 %v = call <vscale x 4 x i32> @llvm.vp.ssub.sat.nxv4i32(<vscale x 4 x i32> %va, <vscale x 4 x i32> splat (i32 -1), <vscale x 4 x i1> splat (i1 true), i32 %evl)
1249 ret <vscale x 4 x i32> %v
1252 declare <vscale x 8 x i32> @llvm.vp.ssub.sat.nxv8i32(<vscale x 8 x i32>, <vscale x 8 x i32>, <vscale x 8 x i1>, i32)
1254 define <vscale x 8 x i32> @vssub_vv_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1255 ; CHECK-LABEL: vssub_vv_nxv8i32:
1257 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1258 ; CHECK-NEXT: vssub.vv v8, v8, v12, v0.t
1260 %v = call <vscale x 8 x i32> @llvm.vp.ssub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> %m, i32 %evl)
1261 ret <vscale x 8 x i32> %v
1264 define <vscale x 8 x i32> @vssub_vv_nxv8i32_unmasked(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, i32 zeroext %evl) {
1265 ; CHECK-LABEL: vssub_vv_nxv8i32_unmasked:
1267 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1268 ; CHECK-NEXT: vssub.vv v8, v8, v12
1270 %v = call <vscale x 8 x i32> @llvm.vp.ssub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1271 ret <vscale x 8 x i32> %v
1274 define <vscale x 8 x i32> @vssub_vx_nxv8i32(<vscale x 8 x i32> %va, i32 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1275 ; CHECK-LABEL: vssub_vx_nxv8i32:
1277 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1278 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
1280 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
1281 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1282 %v = call <vscale x 8 x i32> @llvm.vp.ssub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> %m, i32 %evl)
1283 ret <vscale x 8 x i32> %v
1286 define <vscale x 8 x i32> @vssub_vx_nxv8i32_unmasked(<vscale x 8 x i32> %va, i32 %b, i32 zeroext %evl) {
1287 ; CHECK-LABEL: vssub_vx_nxv8i32_unmasked:
1289 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
1290 ; CHECK-NEXT: vssub.vx v8, v8, a0
1292 %elt.head = insertelement <vscale x 8 x i32> poison, i32 %b, i32 0
1293 %vb = shufflevector <vscale x 8 x i32> %elt.head, <vscale x 8 x i32> poison, <vscale x 8 x i32> zeroinitializer
1294 %v = call <vscale x 8 x i32> @llvm.vp.ssub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1295 ret <vscale x 8 x i32> %v
1298 define <vscale x 8 x i32> @vssub_vi_nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1299 ; CHECK-LABEL: vssub_vi_nxv8i32:
1301 ; CHECK-NEXT: li a1, -1
1302 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1303 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1305 %v = call <vscale x 8 x i32> @llvm.vp.ssub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> splat (i32 -1), <vscale x 8 x i1> %m, i32 %evl)
1306 ret <vscale x 8 x i32> %v
1309 define <vscale x 8 x i32> @vssub_vi_nxv8i32_unmasked(<vscale x 8 x i32> %va, i32 zeroext %evl) {
1310 ; CHECK-LABEL: vssub_vi_nxv8i32_unmasked:
1312 ; CHECK-NEXT: li a1, -1
1313 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1314 ; CHECK-NEXT: vssub.vx v8, v8, a1
1316 %v = call <vscale x 8 x i32> @llvm.vp.ssub.sat.nxv8i32(<vscale x 8 x i32> %va, <vscale x 8 x i32> splat (i32 -1), <vscale x 8 x i1> splat (i1 true), i32 %evl)
1317 ret <vscale x 8 x i32> %v
1320 declare <vscale x 16 x i32> @llvm.vp.ssub.sat.nxv16i32(<vscale x 16 x i32>, <vscale x 16 x i32>, <vscale x 16 x i1>, i32)
1322 define <vscale x 16 x i32> @vssub_vv_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1323 ; CHECK-LABEL: vssub_vv_nxv16i32:
1325 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1326 ; CHECK-NEXT: vssub.vv v8, v8, v16, v0.t
1328 %v = call <vscale x 16 x i32> @llvm.vp.ssub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> %m, i32 %evl)
1329 ret <vscale x 16 x i32> %v
1332 define <vscale x 16 x i32> @vssub_vv_nxv16i32_unmasked(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, i32 zeroext %evl) {
1333 ; CHECK-LABEL: vssub_vv_nxv16i32_unmasked:
1335 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1336 ; CHECK-NEXT: vssub.vv v8, v8, v16
1338 %v = call <vscale x 16 x i32> @llvm.vp.ssub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %b, <vscale x 16 x i1> splat (i1 true), i32 %evl)
1339 ret <vscale x 16 x i32> %v
1342 define <vscale x 16 x i32> @vssub_vx_nxv16i32(<vscale x 16 x i32> %va, i32 %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1343 ; CHECK-LABEL: vssub_vx_nxv16i32:
1345 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1346 ; CHECK-NEXT: vssub.vx v8, v8, a0, v0.t
1348 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
1349 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1350 %v = call <vscale x 16 x i32> @llvm.vp.ssub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> %m, i32 %evl)
1351 ret <vscale x 16 x i32> %v
1354 define <vscale x 16 x i32> @vssub_vx_nxv16i32_unmasked(<vscale x 16 x i32> %va, i32 %b, i32 zeroext %evl) {
1355 ; CHECK-LABEL: vssub_vx_nxv16i32_unmasked:
1357 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
1358 ; CHECK-NEXT: vssub.vx v8, v8, a0
1360 %elt.head = insertelement <vscale x 16 x i32> poison, i32 %b, i32 0
1361 %vb = shufflevector <vscale x 16 x i32> %elt.head, <vscale x 16 x i32> poison, <vscale x 16 x i32> zeroinitializer
1362 %v = call <vscale x 16 x i32> @llvm.vp.ssub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> %vb, <vscale x 16 x i1> splat (i1 true), i32 %evl)
1363 ret <vscale x 16 x i32> %v
1366 define <vscale x 16 x i32> @vssub_vi_nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1367 ; CHECK-LABEL: vssub_vi_nxv16i32:
1369 ; CHECK-NEXT: li a1, -1
1370 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1371 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1373 %v = call <vscale x 16 x i32> @llvm.vp.ssub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> splat (i32 -1), <vscale x 16 x i1> %m, i32 %evl)
1374 ret <vscale x 16 x i32> %v
1377 define <vscale x 16 x i32> @vssub_vi_nxv16i32_unmasked(<vscale x 16 x i32> %va, i32 zeroext %evl) {
1378 ; CHECK-LABEL: vssub_vi_nxv16i32_unmasked:
1380 ; CHECK-NEXT: li a1, -1
1381 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1382 ; CHECK-NEXT: vssub.vx v8, v8, a1
1384 %v = call <vscale x 16 x i32> @llvm.vp.ssub.sat.nxv16i32(<vscale x 16 x i32> %va, <vscale x 16 x i32> splat (i32 -1), <vscale x 16 x i1> splat (i1 true), i32 %evl)
1385 ret <vscale x 16 x i32> %v
1388 ; Test that split-legalization works then the mask needs manual splitting.
1390 declare <vscale x 32 x i32> @llvm.vp.ssub.sat.nxv32i32(<vscale x 32 x i32>, <vscale x 32 x i32>, <vscale x 32 x i1>, i32)
1392 define <vscale x 32 x i32> @vssub_vi_nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
1393 ; CHECK-LABEL: vssub_vi_nxv32i32:
1395 ; CHECK-NEXT: vmv1r.v v24, v0
1396 ; CHECK-NEXT: csrr a1, vlenb
1397 ; CHECK-NEXT: srli a2, a1, 2
1398 ; CHECK-NEXT: vsetvli a3, zero, e8, mf2, ta, ma
1399 ; CHECK-NEXT: vslidedown.vx v0, v0, a2
1400 ; CHECK-NEXT: slli a1, a1, 1
1401 ; CHECK-NEXT: sub a2, a0, a1
1402 ; CHECK-NEXT: sltu a3, a0, a2
1403 ; CHECK-NEXT: addi a3, a3, -1
1404 ; CHECK-NEXT: and a3, a3, a2
1405 ; CHECK-NEXT: li a2, -1
1406 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
1407 ; CHECK-NEXT: vssub.vx v16, v16, a2, v0.t
1408 ; CHECK-NEXT: bltu a0, a1, .LBB118_2
1409 ; CHECK-NEXT: # %bb.1:
1410 ; CHECK-NEXT: mv a0, a1
1411 ; CHECK-NEXT: .LBB118_2:
1412 ; CHECK-NEXT: vmv1r.v v0, v24
1413 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1414 ; CHECK-NEXT: vssub.vx v8, v8, a2, v0.t
1416 %v = call <vscale x 32 x i32> @llvm.vp.ssub.sat.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> splat (i32 -1), <vscale x 32 x i1> %m, i32 %evl)
1417 ret <vscale x 32 x i32> %v
1420 define <vscale x 32 x i32> @vssub_vi_nxv32i32_unmasked(<vscale x 32 x i32> %va, i32 zeroext %evl) {
1421 ; CHECK-LABEL: vssub_vi_nxv32i32_unmasked:
1423 ; CHECK-NEXT: csrr a1, vlenb
1424 ; CHECK-NEXT: slli a1, a1, 1
1425 ; CHECK-NEXT: sub a2, a0, a1
1426 ; CHECK-NEXT: sltu a3, a0, a2
1427 ; CHECK-NEXT: addi a3, a3, -1
1428 ; CHECK-NEXT: and a3, a3, a2
1429 ; CHECK-NEXT: li a2, -1
1430 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
1431 ; CHECK-NEXT: vssub.vx v16, v16, a2
1432 ; CHECK-NEXT: bltu a0, a1, .LBB119_2
1433 ; CHECK-NEXT: # %bb.1:
1434 ; CHECK-NEXT: mv a0, a1
1435 ; CHECK-NEXT: .LBB119_2:
1436 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1437 ; CHECK-NEXT: vssub.vx v8, v8, a2
1439 %v = call <vscale x 32 x i32> @llvm.vp.ssub.sat.nxv32i32(<vscale x 32 x i32> %va, <vscale x 32 x i32> splat (i32 -1), <vscale x 32 x i1> splat (i1 true), i32 %evl)
1440 ret <vscale x 32 x i32> %v
1443 declare <vscale x 1 x i64> @llvm.vp.ssub.sat.nxv1i64(<vscale x 1 x i64>, <vscale x 1 x i64>, <vscale x 1 x i1>, i32)
1445 define <vscale x 1 x i64> @vssub_vv_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1446 ; CHECK-LABEL: vssub_vv_nxv1i64:
1448 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1449 ; CHECK-NEXT: vssub.vv v8, v8, v9, v0.t
1451 %v = call <vscale x 1 x i64> @llvm.vp.ssub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> %m, i32 %evl)
1452 ret <vscale x 1 x i64> %v
1455 define <vscale x 1 x i64> @vssub_vv_nxv1i64_unmasked(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, i32 zeroext %evl) {
1456 ; CHECK-LABEL: vssub_vv_nxv1i64_unmasked:
1458 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1459 ; CHECK-NEXT: vssub.vv v8, v8, v9
1461 %v = call <vscale x 1 x i64> @llvm.vp.ssub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %b, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1462 ret <vscale x 1 x i64> %v
1465 define <vscale x 1 x i64> @vssub_vx_nxv1i64(<vscale x 1 x i64> %va, i64 %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1466 ; RV32-LABEL: vssub_vx_nxv1i64:
1468 ; RV32-NEXT: addi sp, sp, -16
1469 ; RV32-NEXT: .cfi_def_cfa_offset 16
1470 ; RV32-NEXT: sw a1, 12(sp)
1471 ; RV32-NEXT: sw a0, 8(sp)
1472 ; RV32-NEXT: addi a0, sp, 8
1473 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1474 ; RV32-NEXT: vlse64.v v9, (a0), zero
1475 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1476 ; RV32-NEXT: vssub.vv v8, v8, v9, v0.t
1477 ; RV32-NEXT: addi sp, sp, 16
1480 ; RV64-LABEL: vssub_vx_nxv1i64:
1482 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1483 ; RV64-NEXT: vssub.vx v8, v8, a0, v0.t
1485 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1486 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1487 %v = call <vscale x 1 x i64> @llvm.vp.ssub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> %m, i32 %evl)
1488 ret <vscale x 1 x i64> %v
1491 define <vscale x 1 x i64> @vssub_vx_nxv1i64_unmasked(<vscale x 1 x i64> %va, i64 %b, i32 zeroext %evl) {
1492 ; RV32-LABEL: vssub_vx_nxv1i64_unmasked:
1494 ; RV32-NEXT: addi sp, sp, -16
1495 ; RV32-NEXT: .cfi_def_cfa_offset 16
1496 ; RV32-NEXT: sw a1, 12(sp)
1497 ; RV32-NEXT: sw a0, 8(sp)
1498 ; RV32-NEXT: addi a0, sp, 8
1499 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
1500 ; RV32-NEXT: vlse64.v v9, (a0), zero
1501 ; RV32-NEXT: vsetvli zero, a2, e64, m1, ta, ma
1502 ; RV32-NEXT: vssub.vv v8, v8, v9
1503 ; RV32-NEXT: addi sp, sp, 16
1506 ; RV64-LABEL: vssub_vx_nxv1i64_unmasked:
1508 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
1509 ; RV64-NEXT: vssub.vx v8, v8, a0
1511 %elt.head = insertelement <vscale x 1 x i64> poison, i64 %b, i32 0
1512 %vb = shufflevector <vscale x 1 x i64> %elt.head, <vscale x 1 x i64> poison, <vscale x 1 x i32> zeroinitializer
1513 %v = call <vscale x 1 x i64> @llvm.vp.ssub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> %vb, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1514 ret <vscale x 1 x i64> %v
1517 define <vscale x 1 x i64> @vssub_vi_nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1518 ; CHECK-LABEL: vssub_vi_nxv1i64:
1520 ; CHECK-NEXT: li a1, -1
1521 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1522 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1524 %v = call <vscale x 1 x i64> @llvm.vp.ssub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> splat (i64 -1), <vscale x 1 x i1> %m, i32 %evl)
1525 ret <vscale x 1 x i64> %v
1528 define <vscale x 1 x i64> @vssub_vi_nxv1i64_unmasked(<vscale x 1 x i64> %va, i32 zeroext %evl) {
1529 ; CHECK-LABEL: vssub_vi_nxv1i64_unmasked:
1531 ; CHECK-NEXT: li a1, -1
1532 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1533 ; CHECK-NEXT: vssub.vx v8, v8, a1
1535 %v = call <vscale x 1 x i64> @llvm.vp.ssub.sat.nxv1i64(<vscale x 1 x i64> %va, <vscale x 1 x i64> splat (i64 -1), <vscale x 1 x i1> splat (i1 true), i32 %evl)
1536 ret <vscale x 1 x i64> %v
1539 declare <vscale x 2 x i64> @llvm.vp.ssub.sat.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>, <vscale x 2 x i1>, i32)
1541 define <vscale x 2 x i64> @vssub_vv_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1542 ; CHECK-LABEL: vssub_vv_nxv2i64:
1544 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1545 ; CHECK-NEXT: vssub.vv v8, v8, v10, v0.t
1547 %v = call <vscale x 2 x i64> @llvm.vp.ssub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> %m, i32 %evl)
1548 ret <vscale x 2 x i64> %v
1551 define <vscale x 2 x i64> @vssub_vv_nxv2i64_unmasked(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, i32 zeroext %evl) {
1552 ; CHECK-LABEL: vssub_vv_nxv2i64_unmasked:
1554 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1555 ; CHECK-NEXT: vssub.vv v8, v8, v10
1557 %v = call <vscale x 2 x i64> @llvm.vp.ssub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %b, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1558 ret <vscale x 2 x i64> %v
1561 define <vscale x 2 x i64> @vssub_vx_nxv2i64(<vscale x 2 x i64> %va, i64 %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1562 ; RV32-LABEL: vssub_vx_nxv2i64:
1564 ; RV32-NEXT: addi sp, sp, -16
1565 ; RV32-NEXT: .cfi_def_cfa_offset 16
1566 ; RV32-NEXT: sw a1, 12(sp)
1567 ; RV32-NEXT: sw a0, 8(sp)
1568 ; RV32-NEXT: addi a0, sp, 8
1569 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1570 ; RV32-NEXT: vlse64.v v10, (a0), zero
1571 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1572 ; RV32-NEXT: vssub.vv v8, v8, v10, v0.t
1573 ; RV32-NEXT: addi sp, sp, 16
1576 ; RV64-LABEL: vssub_vx_nxv2i64:
1578 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1579 ; RV64-NEXT: vssub.vx v8, v8, a0, v0.t
1581 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1582 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1583 %v = call <vscale x 2 x i64> @llvm.vp.ssub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> %m, i32 %evl)
1584 ret <vscale x 2 x i64> %v
1587 define <vscale x 2 x i64> @vssub_vx_nxv2i64_unmasked(<vscale x 2 x i64> %va, i64 %b, i32 zeroext %evl) {
1588 ; RV32-LABEL: vssub_vx_nxv2i64_unmasked:
1590 ; RV32-NEXT: addi sp, sp, -16
1591 ; RV32-NEXT: .cfi_def_cfa_offset 16
1592 ; RV32-NEXT: sw a1, 12(sp)
1593 ; RV32-NEXT: sw a0, 8(sp)
1594 ; RV32-NEXT: addi a0, sp, 8
1595 ; RV32-NEXT: vsetvli a1, zero, e64, m2, ta, ma
1596 ; RV32-NEXT: vlse64.v v10, (a0), zero
1597 ; RV32-NEXT: vsetvli zero, a2, e64, m2, ta, ma
1598 ; RV32-NEXT: vssub.vv v8, v8, v10
1599 ; RV32-NEXT: addi sp, sp, 16
1602 ; RV64-LABEL: vssub_vx_nxv2i64_unmasked:
1604 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
1605 ; RV64-NEXT: vssub.vx v8, v8, a0
1607 %elt.head = insertelement <vscale x 2 x i64> poison, i64 %b, i32 0
1608 %vb = shufflevector <vscale x 2 x i64> %elt.head, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
1609 %v = call <vscale x 2 x i64> @llvm.vp.ssub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> %vb, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1610 ret <vscale x 2 x i64> %v
1613 define <vscale x 2 x i64> @vssub_vi_nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1614 ; CHECK-LABEL: vssub_vi_nxv2i64:
1616 ; CHECK-NEXT: li a1, -1
1617 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1618 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1620 %v = call <vscale x 2 x i64> @llvm.vp.ssub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> splat (i64 -1), <vscale x 2 x i1> %m, i32 %evl)
1621 ret <vscale x 2 x i64> %v
1624 define <vscale x 2 x i64> @vssub_vi_nxv2i64_unmasked(<vscale x 2 x i64> %va, i32 zeroext %evl) {
1625 ; CHECK-LABEL: vssub_vi_nxv2i64_unmasked:
1627 ; CHECK-NEXT: li a1, -1
1628 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1629 ; CHECK-NEXT: vssub.vx v8, v8, a1
1631 %v = call <vscale x 2 x i64> @llvm.vp.ssub.sat.nxv2i64(<vscale x 2 x i64> %va, <vscale x 2 x i64> splat (i64 -1), <vscale x 2 x i1> splat (i1 true), i32 %evl)
1632 ret <vscale x 2 x i64> %v
1635 declare <vscale x 4 x i64> @llvm.vp.ssub.sat.nxv4i64(<vscale x 4 x i64>, <vscale x 4 x i64>, <vscale x 4 x i1>, i32)
1637 define <vscale x 4 x i64> @vssub_vv_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1638 ; CHECK-LABEL: vssub_vv_nxv4i64:
1640 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1641 ; CHECK-NEXT: vssub.vv v8, v8, v12, v0.t
1643 %v = call <vscale x 4 x i64> @llvm.vp.ssub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> %m, i32 %evl)
1644 ret <vscale x 4 x i64> %v
1647 define <vscale x 4 x i64> @vssub_vv_nxv4i64_unmasked(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, i32 zeroext %evl) {
1648 ; CHECK-LABEL: vssub_vv_nxv4i64_unmasked:
1650 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1651 ; CHECK-NEXT: vssub.vv v8, v8, v12
1653 %v = call <vscale x 4 x i64> @llvm.vp.ssub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %b, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1654 ret <vscale x 4 x i64> %v
1657 define <vscale x 4 x i64> @vssub_vx_nxv4i64(<vscale x 4 x i64> %va, i64 %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1658 ; RV32-LABEL: vssub_vx_nxv4i64:
1660 ; RV32-NEXT: addi sp, sp, -16
1661 ; RV32-NEXT: .cfi_def_cfa_offset 16
1662 ; RV32-NEXT: sw a1, 12(sp)
1663 ; RV32-NEXT: sw a0, 8(sp)
1664 ; RV32-NEXT: addi a0, sp, 8
1665 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1666 ; RV32-NEXT: vlse64.v v12, (a0), zero
1667 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1668 ; RV32-NEXT: vssub.vv v8, v8, v12, v0.t
1669 ; RV32-NEXT: addi sp, sp, 16
1672 ; RV64-LABEL: vssub_vx_nxv4i64:
1674 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1675 ; RV64-NEXT: vssub.vx v8, v8, a0, v0.t
1677 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1678 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1679 %v = call <vscale x 4 x i64> @llvm.vp.ssub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> %m, i32 %evl)
1680 ret <vscale x 4 x i64> %v
1683 define <vscale x 4 x i64> @vssub_vx_nxv4i64_unmasked(<vscale x 4 x i64> %va, i64 %b, i32 zeroext %evl) {
1684 ; RV32-LABEL: vssub_vx_nxv4i64_unmasked:
1686 ; RV32-NEXT: addi sp, sp, -16
1687 ; RV32-NEXT: .cfi_def_cfa_offset 16
1688 ; RV32-NEXT: sw a1, 12(sp)
1689 ; RV32-NEXT: sw a0, 8(sp)
1690 ; RV32-NEXT: addi a0, sp, 8
1691 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1692 ; RV32-NEXT: vlse64.v v12, (a0), zero
1693 ; RV32-NEXT: vsetvli zero, a2, e64, m4, ta, ma
1694 ; RV32-NEXT: vssub.vv v8, v8, v12
1695 ; RV32-NEXT: addi sp, sp, 16
1698 ; RV64-LABEL: vssub_vx_nxv4i64_unmasked:
1700 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
1701 ; RV64-NEXT: vssub.vx v8, v8, a0
1703 %elt.head = insertelement <vscale x 4 x i64> poison, i64 %b, i32 0
1704 %vb = shufflevector <vscale x 4 x i64> %elt.head, <vscale x 4 x i64> poison, <vscale x 4 x i32> zeroinitializer
1705 %v = call <vscale x 4 x i64> @llvm.vp.ssub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> %vb, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1706 ret <vscale x 4 x i64> %v
1709 define <vscale x 4 x i64> @vssub_vi_nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1710 ; CHECK-LABEL: vssub_vi_nxv4i64:
1712 ; CHECK-NEXT: li a1, -1
1713 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1714 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1716 %v = call <vscale x 4 x i64> @llvm.vp.ssub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> splat (i64 -1), <vscale x 4 x i1> %m, i32 %evl)
1717 ret <vscale x 4 x i64> %v
1720 define <vscale x 4 x i64> @vssub_vi_nxv4i64_unmasked(<vscale x 4 x i64> %va, i32 zeroext %evl) {
1721 ; CHECK-LABEL: vssub_vi_nxv4i64_unmasked:
1723 ; CHECK-NEXT: li a1, -1
1724 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1725 ; CHECK-NEXT: vssub.vx v8, v8, a1
1727 %v = call <vscale x 4 x i64> @llvm.vp.ssub.sat.nxv4i64(<vscale x 4 x i64> %va, <vscale x 4 x i64> splat (i64 -1), <vscale x 4 x i1> splat (i1 true), i32 %evl)
1728 ret <vscale x 4 x i64> %v
1731 declare <vscale x 8 x i64> @llvm.vp.ssub.sat.nxv8i64(<vscale x 8 x i64>, <vscale x 8 x i64>, <vscale x 8 x i1>, i32)
1733 define <vscale x 8 x i64> @vssub_vv_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1734 ; CHECK-LABEL: vssub_vv_nxv8i64:
1736 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1737 ; CHECK-NEXT: vssub.vv v8, v8, v16, v0.t
1739 %v = call <vscale x 8 x i64> @llvm.vp.ssub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> %m, i32 %evl)
1740 ret <vscale x 8 x i64> %v
1743 define <vscale x 8 x i64> @vssub_vv_nxv8i64_unmasked(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, i32 zeroext %evl) {
1744 ; CHECK-LABEL: vssub_vv_nxv8i64_unmasked:
1746 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1747 ; CHECK-NEXT: vssub.vv v8, v8, v16
1749 %v = call <vscale x 8 x i64> @llvm.vp.ssub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %b, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1750 ret <vscale x 8 x i64> %v
1753 define <vscale x 8 x i64> @vssub_vx_nxv8i64(<vscale x 8 x i64> %va, i64 %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1754 ; RV32-LABEL: vssub_vx_nxv8i64:
1756 ; RV32-NEXT: addi sp, sp, -16
1757 ; RV32-NEXT: .cfi_def_cfa_offset 16
1758 ; RV32-NEXT: sw a1, 12(sp)
1759 ; RV32-NEXT: sw a0, 8(sp)
1760 ; RV32-NEXT: addi a0, sp, 8
1761 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1762 ; RV32-NEXT: vlse64.v v16, (a0), zero
1763 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1764 ; RV32-NEXT: vssub.vv v8, v8, v16, v0.t
1765 ; RV32-NEXT: addi sp, sp, 16
1768 ; RV64-LABEL: vssub_vx_nxv8i64:
1770 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1771 ; RV64-NEXT: vssub.vx v8, v8, a0, v0.t
1773 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1774 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1775 %v = call <vscale x 8 x i64> @llvm.vp.ssub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> %m, i32 %evl)
1776 ret <vscale x 8 x i64> %v
1779 define <vscale x 8 x i64> @vssub_vx_nxv8i64_unmasked(<vscale x 8 x i64> %va, i64 %b, i32 zeroext %evl) {
1780 ; RV32-LABEL: vssub_vx_nxv8i64_unmasked:
1782 ; RV32-NEXT: addi sp, sp, -16
1783 ; RV32-NEXT: .cfi_def_cfa_offset 16
1784 ; RV32-NEXT: sw a1, 12(sp)
1785 ; RV32-NEXT: sw a0, 8(sp)
1786 ; RV32-NEXT: addi a0, sp, 8
1787 ; RV32-NEXT: vsetvli a1, zero, e64, m8, ta, ma
1788 ; RV32-NEXT: vlse64.v v16, (a0), zero
1789 ; RV32-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1790 ; RV32-NEXT: vssub.vv v8, v8, v16
1791 ; RV32-NEXT: addi sp, sp, 16
1794 ; RV64-LABEL: vssub_vx_nxv8i64_unmasked:
1796 ; RV64-NEXT: vsetvli zero, a1, e64, m8, ta, ma
1797 ; RV64-NEXT: vssub.vx v8, v8, a0
1799 %elt.head = insertelement <vscale x 8 x i64> poison, i64 %b, i32 0
1800 %vb = shufflevector <vscale x 8 x i64> %elt.head, <vscale x 8 x i64> poison, <vscale x 8 x i32> zeroinitializer
1801 %v = call <vscale x 8 x i64> @llvm.vp.ssub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> %vb, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1802 ret <vscale x 8 x i64> %v
1805 define <vscale x 8 x i64> @vssub_vi_nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1806 ; CHECK-LABEL: vssub_vi_nxv8i64:
1808 ; CHECK-NEXT: li a1, -1
1809 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1810 ; CHECK-NEXT: vssub.vx v8, v8, a1, v0.t
1812 %v = call <vscale x 8 x i64> @llvm.vp.ssub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> splat (i64 -1), <vscale x 8 x i1> %m, i32 %evl)
1813 ret <vscale x 8 x i64> %v
1816 define <vscale x 8 x i64> @vssub_vi_nxv8i64_unmasked(<vscale x 8 x i64> %va, i32 zeroext %evl) {
1817 ; CHECK-LABEL: vssub_vi_nxv8i64_unmasked:
1819 ; CHECK-NEXT: li a1, -1
1820 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1821 ; CHECK-NEXT: vssub.vx v8, v8, a1
1823 %v = call <vscale x 8 x i64> @llvm.vp.ssub.sat.nxv8i64(<vscale x 8 x i64> %va, <vscale x 8 x i64> splat (i64 -1), <vscale x 8 x i1> splat (i1 true), i32 %evl)
1824 ret <vscale x 8 x i64> %v