1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
4 ; SVE Arith Vector Immediate Unpredicated CodeGen
8 define <vscale x 16 x i8> @add_i8_low(<vscale x 16 x i8> %a) {
9 ; CHECK-LABEL: add_i8_low
10 ; CHECK: add z0.b, z0.b, #30
12 %elt = insertelement <vscale x 16 x i8> undef, i8 30, i32 0
13 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
14 %res = add <vscale x 16 x i8> %a, %splat
15 ret <vscale x 16 x i8> %res
18 define <vscale x 8 x i16> @add_i16_low(<vscale x 8 x i16> %a) {
19 ; CHECK-LABEL: add_i16_low
20 ; CHECK: add z0.h, z0.h, #30
22 %elt = insertelement <vscale x 8 x i16> undef, i16 30, i32 0
23 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
24 %res = add <vscale x 8 x i16> %a, %splat
25 ret <vscale x 8 x i16> %res
28 define <vscale x 8 x i16> @add_i16_high(<vscale x 8 x i16> %a) {
29 ; CHECK-LABEL: add_i16_high
30 ; CHECK: add z0.h, z0.h, #1024
32 %elt = insertelement <vscale x 8 x i16> undef, i16 1024, i32 0
33 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
34 %res = add <vscale x 8 x i16> %a, %splat
35 ret <vscale x 8 x i16> %res
38 define <vscale x 4 x i32> @add_i32_low(<vscale x 4 x i32> %a) {
39 ; CHECK-LABEL: add_i32_low
40 ; CHECK: add z0.s, z0.s, #30
42 %elt = insertelement <vscale x 4 x i32> undef, i32 30, i32 0
43 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
44 %res = add <vscale x 4 x i32> %a, %splat
45 ret <vscale x 4 x i32> %res
48 define <vscale x 4 x i32> @add_i32_high(<vscale x 4 x i32> %a) {
49 ; CHECK-LABEL: add_i32_high
50 ; CHECK: add z0.s, z0.s, #1024
52 %elt = insertelement <vscale x 4 x i32> undef, i32 1024, i32 0
53 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
54 %res = add <vscale x 4 x i32> %a, %splat
55 ret <vscale x 4 x i32> %res
58 define <vscale x 2 x i64> @add_i64_low(<vscale x 2 x i64> %a) {
59 ; CHECK-LABEL: add_i64_low
60 ; CHECK: add z0.d, z0.d, #30
62 %elt = insertelement <vscale x 2 x i64> undef, i64 30, i32 0
63 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
64 %res = add <vscale x 2 x i64> %a, %splat
65 ret <vscale x 2 x i64> %res
68 define <vscale x 2 x i64> @add_i64_high(<vscale x 2 x i64> %a) {
69 ; CHECK-LABEL: add_i64_high
70 ; CHECK: add z0.d, z0.d, #1024
72 %elt = insertelement <vscale x 2 x i64> undef, i64 1024, i32 0
73 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
74 %res = add <vscale x 2 x i64> %a, %splat
75 ret <vscale x 2 x i64> %res
78 define <vscale x 16 x i8> @add_i8_signedness(<vscale x 16 x i8> %a) {
79 ; CHECK-LABEL: add_i8_signedness
80 ; CHECK: add z0.b, z0.b, #255
82 %elt = insertelement <vscale x 16 x i8> undef, i8 255, i32 0
83 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
84 %res = add <vscale x 16 x i8> %a, %splat
85 ret <vscale x 16 x i8> %res
88 define <vscale x 8 x i16> @add_i16_signedness(<vscale x 8 x i16> %a) {
89 ; CHECK-LABEL: add_i16_signedness
90 ; CHECK: add z0.h, z0.h, #65280
92 %elt = insertelement <vscale x 8 x i16> undef, i16 65280, i32 0
93 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
94 %res = add <vscale x 8 x i16> %a, %splat
95 ret <vscale x 8 x i16> %res
99 define <vscale x 16 x i8> @subr_i8_low(<vscale x 16 x i8> %a) {
100 ; CHECK-LABEL: subr_i8_low
101 ; CHECK: subr z0.b, z0.b, #30
103 %elt = insertelement <vscale x 16 x i8> undef, i8 30, i32 0
104 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
105 %res = sub <vscale x 16 x i8> %splat, %a
106 ret <vscale x 16 x i8> %res
109 define <vscale x 8 x i16> @subr_i16_low(<vscale x 8 x i16> %a) {
110 ; CHECK-LABEL: subr_i16_low
111 ; CHECK: subr z0.h, z0.h, #30
113 %elt = insertelement <vscale x 8 x i16> undef, i16 30, i32 0
114 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
115 %res = sub <vscale x 8 x i16> %splat, %a
116 ret <vscale x 8 x i16> %res
119 define <vscale x 8 x i16> @subr_i16_high(<vscale x 8 x i16> %a) {
120 ; CHECK-LABEL: subr_i16_high
121 ; CHECK: subr z0.h, z0.h, #1024
123 %elt = insertelement <vscale x 8 x i16> undef, i16 1024, i32 0
124 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
125 %res = sub <vscale x 8 x i16> %splat, %a
126 ret <vscale x 8 x i16> %res
129 define <vscale x 4 x i32> @subr_i32_low(<vscale x 4 x i32> %a) {
130 ; CHECK-LABEL: subr_i32_low
131 ; CHECK: subr z0.s, z0.s, #30
133 %elt = insertelement <vscale x 4 x i32> undef, i32 30, i32 0
134 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
135 %res = sub <vscale x 4 x i32> %splat, %a
136 ret <vscale x 4 x i32> %res
139 define <vscale x 4 x i32> @subr_i32_high(<vscale x 4 x i32> %a) {
140 ; CHECK-LABEL: subr_i32_high
141 ; CHECK: subr z0.s, z0.s, #1024
143 %elt = insertelement <vscale x 4 x i32> undef, i32 1024, i32 0
144 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
145 %res = sub <vscale x 4 x i32> %splat, %a
146 ret <vscale x 4 x i32> %res
149 define <vscale x 2 x i64> @subr_i64_low(<vscale x 2 x i64> %a) {
150 ; CHECK-LABEL: subr_i64_low
151 ; CHECK: subr z0.d, z0.d, #30
153 %elt = insertelement <vscale x 2 x i64> undef, i64 30, i32 0
154 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
155 %res = sub <vscale x 2 x i64> %splat, %a
156 ret <vscale x 2 x i64> %res
159 define <vscale x 2 x i64> @subr_i64_high(<vscale x 2 x i64> %a) {
160 ; CHECK-LABEL: subr_i64_high
161 ; CHECK: subr z0.d, z0.d, #1024
163 %elt = insertelement <vscale x 2 x i64> undef, i64 1024, i32 0
164 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
165 %res = sub <vscale x 2 x i64> %splat, %a
166 ret <vscale x 2 x i64> %res
170 define <vscale x 16 x i8> @sub_i8_low(<vscale x 16 x i8> %a) {
171 ; CHECK-LABEL: sub_i8_low
172 ; CHECK: sub z0.b, z0.b, #30
174 %elt = insertelement <vscale x 16 x i8> undef, i8 30, i32 0
175 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
176 %res = sub <vscale x 16 x i8> %a, %splat
177 ret <vscale x 16 x i8> %res
180 define <vscale x 8 x i16> @sub_i16_low(<vscale x 8 x i16> %a) {
181 ; CHECK-LABEL: sub_i16_low
182 ; CHECK: sub z0.h, z0.h, #30
184 %elt = insertelement <vscale x 8 x i16> undef, i16 30, i32 0
185 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
186 %res = sub <vscale x 8 x i16> %a, %splat
187 ret <vscale x 8 x i16> %res
190 define <vscale x 8 x i16> @sub_i16_high(<vscale x 8 x i16> %a) {
191 ; CHECK-LABEL: sub_i16_high
192 ; CHECK: sub z0.h, z0.h, #1024
194 %elt = insertelement <vscale x 8 x i16> undef, i16 1024, i32 0
195 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
196 %res = sub <vscale x 8 x i16> %a, %splat
197 ret <vscale x 8 x i16> %res
200 define <vscale x 4 x i32> @sub_i32_low(<vscale x 4 x i32> %a) {
201 ; CHECK-LABEL: sub_i32_low
202 ; CHECK: sub z0.s, z0.s, #30
204 %elt = insertelement <vscale x 4 x i32> undef, i32 30, i32 0
205 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
206 %res = sub <vscale x 4 x i32> %a, %splat
207 ret <vscale x 4 x i32> %res
210 define <vscale x 4 x i32> @sub_i32_high(<vscale x 4 x i32> %a) {
211 ; CHECK-LABEL: sub_i32_high
212 ; CHECK: sub z0.s, z0.s, #1024
214 %elt = insertelement <vscale x 4 x i32> undef, i32 1024, i32 0
215 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
216 %res = sub <vscale x 4 x i32> %a, %splat
217 ret <vscale x 4 x i32> %res
220 define <vscale x 2 x i64> @sub_i64_low(<vscale x 2 x i64> %a) {
221 ; CHECK-LABEL: sub_i64_low
222 ; CHECK: sub z0.d, z0.d, #30
224 %elt = insertelement <vscale x 2 x i64> undef, i64 30, i32 0
225 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
226 %res = sub <vscale x 2 x i64> %a, %splat
227 ret <vscale x 2 x i64> %res
230 define <vscale x 2 x i64> @sub_i64_high(<vscale x 2 x i64> %a) {
231 ; CHECK-LABEL: sub_i64_high
232 ; CHECK: sub z0.d, z0.d, #1024
234 %elt = insertelement <vscale x 2 x i64> undef, i64 1024, i32 0
235 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
236 %res = sub <vscale x 2 x i64> %a, %splat
237 ret <vscale x 2 x i64> %res
241 define <vscale x 16 x i8> @sqadd_i8_low(<vscale x 16 x i8> %a) {
242 ; CHECK-LABEL: sqadd_i8_low
243 ; CHECK: sqadd z0.b, z0.b, #30
245 %elt = insertelement <vscale x 16 x i8> undef, i8 30, i32 0
246 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
247 %res = call <vscale x 16 x i8> @llvm.sadd.sat.nxv16i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %splat)
248 ret <vscale x 16 x i8> %res
251 define <vscale x 8 x i16> @sqadd_i16_low(<vscale x 8 x i16> %a) {
252 ; CHECK-LABEL: sqadd_i16_low
253 ; CHECK: sqadd z0.h, z0.h, #30
255 %elt = insertelement <vscale x 8 x i16> undef, i16 30, i32 0
256 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
257 %res = call <vscale x 8 x i16> @llvm.sadd.sat.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %splat)
258 ret <vscale x 8 x i16> %res
261 define <vscale x 8 x i16> @sqadd_i16_high(<vscale x 8 x i16> %a) {
262 ; CHECK-LABEL: sqadd_i16_high
263 ; CHECK: sqadd z0.h, z0.h, #1024
265 %elt = insertelement <vscale x 8 x i16> undef, i16 1024, i32 0
266 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
267 %res = call <vscale x 8 x i16> @llvm.sadd.sat.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %splat)
268 ret <vscale x 8 x i16> %res
271 define <vscale x 4 x i32> @sqadd_i32_low(<vscale x 4 x i32> %a) {
272 ; CHECK-LABEL: sqadd_i32_low
273 ; CHECK: sqadd z0.s, z0.s, #30
275 %elt = insertelement <vscale x 4 x i32> undef, i32 30, i32 0
276 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
277 %res = call <vscale x 4 x i32> @llvm.sadd.sat.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %splat)
278 ret <vscale x 4 x i32> %res
281 define <vscale x 4 x i32> @sqadd_i32_high(<vscale x 4 x i32> %a) {
282 ; CHECK-LABEL: sqadd_i32_high
283 ; CHECK: sqadd z0.s, z0.s, #1024
285 %elt = insertelement <vscale x 4 x i32> undef, i32 1024, i32 0
286 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
287 %res = call <vscale x 4 x i32> @llvm.sadd.sat.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %splat)
288 ret <vscale x 4 x i32> %res
291 define <vscale x 2 x i64> @sqadd_i64_low(<vscale x 2 x i64> %a) {
292 ; CHECK-LABEL: sqadd_i64_low
293 ; CHECK: sqadd z0.d, z0.d, #30
295 %elt = insertelement <vscale x 2 x i64> undef, i64 30, i32 0
296 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
297 %res = call <vscale x 2 x i64> @llvm.sadd.sat.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %splat)
298 ret <vscale x 2 x i64> %res
301 define <vscale x 2 x i64> @sqadd_i64_high(<vscale x 2 x i64> %a) {
302 ; CHECK-LABEL: sqadd_i64_high
303 ; CHECK: sqadd z0.d, z0.d, #1024
305 %elt = insertelement <vscale x 2 x i64> undef, i64 1024, i32 0
306 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
307 %res = call <vscale x 2 x i64> @llvm.sadd.sat.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %splat)
308 ret <vscale x 2 x i64> %res
312 define <vscale x 16 x i8> @uqadd_i8_low(<vscale x 16 x i8> %a) {
313 ; CHECK-LABEL: uqadd_i8_low
314 ; CHECK: uqadd z0.b, z0.b, #30
316 %elt = insertelement <vscale x 16 x i8> undef, i8 30, i32 0
317 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
318 %res = call <vscale x 16 x i8> @llvm.uadd.sat.nxv16i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %splat)
319 ret <vscale x 16 x i8> %res
322 define <vscale x 8 x i16> @uqadd_i16_low(<vscale x 8 x i16> %a) {
323 ; CHECK-LABEL: uqadd_i16_low
324 ; CHECK: uqadd z0.h, z0.h, #30
326 %elt = insertelement <vscale x 8 x i16> undef, i16 30, i32 0
327 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
328 %res = call <vscale x 8 x i16> @llvm.uadd.sat.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %splat)
329 ret <vscale x 8 x i16> %res
332 define <vscale x 8 x i16> @uqadd_i16_high(<vscale x 8 x i16> %a) {
333 ; CHECK-LABEL: uqadd_i16_high
334 ; CHECK: uqadd z0.h, z0.h, #1024
336 %elt = insertelement <vscale x 8 x i16> undef, i16 1024, i32 0
337 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
338 %res = call <vscale x 8 x i16> @llvm.uadd.sat.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %splat)
339 ret <vscale x 8 x i16> %res
342 define <vscale x 4 x i32> @uqadd_i32_low(<vscale x 4 x i32> %a) {
343 ; CHECK-LABEL: uqadd_i32_low
344 ; CHECK: uqadd z0.s, z0.s, #30
346 %elt = insertelement <vscale x 4 x i32> undef, i32 30, i32 0
347 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
348 %res = call <vscale x 4 x i32> @llvm.uadd.sat.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %splat)
349 ret <vscale x 4 x i32> %res
352 define <vscale x 4 x i32> @uqadd_i32_high(<vscale x 4 x i32> %a) {
353 ; CHECK-LABEL: uqadd_i32_high
354 ; CHECK: uqadd z0.s, z0.s, #1024
356 %elt = insertelement <vscale x 4 x i32> undef, i32 1024, i32 0
357 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
358 %res = call <vscale x 4 x i32> @llvm.uadd.sat.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %splat)
359 ret <vscale x 4 x i32> %res
362 define <vscale x 2 x i64> @uqadd_i64_low(<vscale x 2 x i64> %a) {
363 ; CHECK-LABEL: uqadd_i64_low
364 ; CHECK: uqadd z0.d, z0.d, #30
366 %elt = insertelement <vscale x 2 x i64> undef, i64 30, i32 0
367 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
368 %res = call <vscale x 2 x i64> @llvm.uadd.sat.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %splat)
369 ret <vscale x 2 x i64> %res
372 define <vscale x 2 x i64> @uqadd_i64_high(<vscale x 2 x i64> %a) {
373 ; CHECK-LABEL: uqadd_i64_high
374 ; CHECK: uqadd z0.d, z0.d, #1024
376 %elt = insertelement <vscale x 2 x i64> undef, i64 1024, i32 0
377 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
378 %res = call <vscale x 2 x i64> @llvm.uadd.sat.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %splat)
379 ret <vscale x 2 x i64> %res
383 define <vscale x 16 x i8> @sqsub_i8_low(<vscale x 16 x i8> %a) {
384 ; CHECK-LABEL: sqsub_i8_low
385 ; CHECK: sqsub z0.b, z0.b, #30
387 %elt = insertelement <vscale x 16 x i8> undef, i8 30, i32 0
388 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
389 %res = call <vscale x 16 x i8> @llvm.ssub.sat.nxv16i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %splat)
390 ret <vscale x 16 x i8> %res
393 define <vscale x 8 x i16> @sqsub_i16_low(<vscale x 8 x i16> %a) {
394 ; CHECK-LABEL: sqsub_i16_low
395 ; CHECK: sqsub z0.h, z0.h, #30
397 %elt = insertelement <vscale x 8 x i16> undef, i16 30, i32 0
398 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
399 %res = call <vscale x 8 x i16> @llvm.ssub.sat.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %splat)
400 ret <vscale x 8 x i16> %res
403 define <vscale x 8 x i16> @sqsub_i16_high(<vscale x 8 x i16> %a) {
404 ; CHECK-LABEL: sqsub_i16_high
405 ; CHECK: sqsub z0.h, z0.h, #1024
407 %elt = insertelement <vscale x 8 x i16> undef, i16 1024, i32 0
408 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
409 %res = call <vscale x 8 x i16> @llvm.ssub.sat.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %splat)
410 ret <vscale x 8 x i16> %res
413 define <vscale x 4 x i32> @sqsub_i32_low(<vscale x 4 x i32> %a) {
414 ; CHECK-LABEL: sqsub_i32_low
415 ; CHECK: sqsub z0.s, z0.s, #30
417 %elt = insertelement <vscale x 4 x i32> undef, i32 30, i32 0
418 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
419 %res = call <vscale x 4 x i32> @llvm.ssub.sat.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %splat)
420 ret <vscale x 4 x i32> %res
423 define <vscale x 4 x i32> @sqsub_i32_high(<vscale x 4 x i32> %a) {
424 ; CHECK-LABEL: sqsub_i32_high
425 ; CHECK: sqsub z0.s, z0.s, #1024
427 %elt = insertelement <vscale x 4 x i32> undef, i32 1024, i32 0
428 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
429 %res = call <vscale x 4 x i32> @llvm.ssub.sat.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %splat)
430 ret <vscale x 4 x i32> %res
433 define <vscale x 2 x i64> @sqsub_i64_low(<vscale x 2 x i64> %a) {
434 ; CHECK-LABEL: sqsub_i64_low
435 ; CHECK: sqsub z0.d, z0.d, #30
437 %elt = insertelement <vscale x 2 x i64> undef, i64 30, i32 0
438 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
439 %res = call <vscale x 2 x i64> @llvm.ssub.sat.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %splat)
440 ret <vscale x 2 x i64> %res
443 define <vscale x 2 x i64> @sqsub_i64_high(<vscale x 2 x i64> %a) {
444 ; CHECK-LABEL: sqsub_i64_high
445 ; CHECK: sqsub z0.d, z0.d, #1024
447 %elt = insertelement <vscale x 2 x i64> undef, i64 1024, i32 0
448 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
449 %res = call <vscale x 2 x i64> @llvm.ssub.sat.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %splat)
450 ret <vscale x 2 x i64> %res
454 define <vscale x 16 x i8> @uqsub_i8_low(<vscale x 16 x i8> %a) {
455 ; CHECK-LABEL: uqsub_i8_low
456 ; CHECK: uqsub z0.b, z0.b, #30
458 %elt = insertelement <vscale x 16 x i8> undef, i8 30, i32 0
459 %splat = shufflevector <vscale x 16 x i8> %elt, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
460 %res = call <vscale x 16 x i8> @llvm.usub.sat.nxv16i8(<vscale x 16 x i8> %a, <vscale x 16 x i8> %splat)
461 ret <vscale x 16 x i8> %res
464 define <vscale x 8 x i16> @uqsub_i16_low(<vscale x 8 x i16> %a) {
465 ; CHECK-LABEL: uqsub_i16_low
466 ; CHECK: uqsub z0.h, z0.h, #30
468 %elt = insertelement <vscale x 8 x i16> undef, i16 30, i32 0
469 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
470 %res = call <vscale x 8 x i16> @llvm.usub.sat.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %splat)
471 ret <vscale x 8 x i16> %res
474 define <vscale x 8 x i16> @uqsub_i16_high(<vscale x 8 x i16> %a) {
475 ; CHECK-LABEL: uqsub_i16_high
476 ; CHECK: uqsub z0.h, z0.h, #1024
478 %elt = insertelement <vscale x 8 x i16> undef, i16 1024, i32 0
479 %splat = shufflevector <vscale x 8 x i16> %elt, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
480 %res = call <vscale x 8 x i16> @llvm.usub.sat.nxv8i16(<vscale x 8 x i16> %a, <vscale x 8 x i16> %splat)
481 ret <vscale x 8 x i16> %res
484 define <vscale x 4 x i32> @uqsub_i32_low(<vscale x 4 x i32> %a) {
485 ; CHECK-LABEL: uqsub_i32_low
486 ; CHECK: uqsub z0.s, z0.s, #30
488 %elt = insertelement <vscale x 4 x i32> undef, i32 30, i32 0
489 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
490 %res = call <vscale x 4 x i32> @llvm.usub.sat.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %splat)
491 ret <vscale x 4 x i32> %res
494 define <vscale x 4 x i32> @uqsub_i32_high(<vscale x 4 x i32> %a) {
495 ; CHECK-LABEL: uqsub_i32_high
496 ; CHECK: uqsub z0.s, z0.s, #1024
498 %elt = insertelement <vscale x 4 x i32> undef, i32 1024, i32 0
499 %splat = shufflevector <vscale x 4 x i32> %elt, <vscale x 4 x i32> undef, <vscale x 4 x i32> zeroinitializer
500 %res = call <vscale x 4 x i32> @llvm.usub.sat.nxv4i32(<vscale x 4 x i32> %a, <vscale x 4 x i32> %splat)
501 ret <vscale x 4 x i32> %res
504 define <vscale x 2 x i64> @uqsub_i64_low(<vscale x 2 x i64> %a) {
505 ; CHECK-LABEL: uqsub_i64_low
506 ; CHECK: uqsub z0.d, z0.d, #30
508 %elt = insertelement <vscale x 2 x i64> undef, i64 30, i32 0
509 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
510 %res = call <vscale x 2 x i64> @llvm.usub.sat.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %splat)
511 ret <vscale x 2 x i64> %res
514 define <vscale x 2 x i64> @uqsub_i64_high(<vscale x 2 x i64> %a) {
515 ; CHECK-LABEL: uqsub_i64_high
516 ; CHECK: uqsub z0.d, z0.d, #1024
518 %elt = insertelement <vscale x 2 x i64> undef, i64 1024, i32 0
519 %splat = shufflevector <vscale x 2 x i64> %elt, <vscale x 2 x i64> undef, <vscale x 2 x i32> zeroinitializer
520 %res = call <vscale x 2 x i64> @llvm.usub.sat.nxv2i64(<vscale x 2 x i64> %a, <vscale x 2 x i64> %splat)
521 ret <vscale x 2 x i64> %res
524 declare <vscale x 16 x i8> @llvm.sadd.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
525 declare <vscale x 8 x i16> @llvm.sadd.sat.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
526 declare <vscale x 4 x i32> @llvm.sadd.sat.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
527 declare <vscale x 2 x i64> @llvm.sadd.sat.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
528 declare <vscale x 16 x i8> @llvm.uadd.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
529 declare <vscale x 8 x i16> @llvm.uadd.sat.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
530 declare <vscale x 4 x i32> @llvm.uadd.sat.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
531 declare <vscale x 2 x i64> @llvm.uadd.sat.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
532 declare <vscale x 16 x i8> @llvm.ssub.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
533 declare <vscale x 8 x i16> @llvm.ssub.sat.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
534 declare <vscale x 4 x i32> @llvm.ssub.sat.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
535 declare <vscale x 2 x i64> @llvm.ssub.sat.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)
536 declare <vscale x 16 x i8> @llvm.usub.sat.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i8>)
537 declare <vscale x 8 x i16> @llvm.usub.sat.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i16>)
538 declare <vscale x 4 x i32> @llvm.usub.sat.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i32>)
539 declare <vscale x 2 x i64> @llvm.usub.sat.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i64>)