1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-- | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc < %s -mtriple=aarch64-- -global-isel -global-isel-abort=2 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 ; CHECK-GI: warning: Instruction selection used fallback path for v2i8
6 ; CHECK-GI-NEXT: warning: Instruction selection used fallback path for v16i4
7 ; CHECK-GI-NEXT: warning: Instruction selection used fallback path for v16i1
8 ; CHECK-GI-NEXT: warning: Instruction selection used fallback path for v2i128
10 declare <1 x i8> @llvm.sadd.sat.v1i8(<1 x i8>, <1 x i8>)
11 declare <2 x i8> @llvm.sadd.sat.v2i8(<2 x i8>, <2 x i8>)
12 declare <4 x i8> @llvm.sadd.sat.v4i8(<4 x i8>, <4 x i8>)
13 declare <8 x i8> @llvm.sadd.sat.v8i8(<8 x i8>, <8 x i8>)
14 declare <12 x i8> @llvm.sadd.sat.v12i8(<12 x i8>, <12 x i8>)
15 declare <16 x i8> @llvm.sadd.sat.v16i8(<16 x i8>, <16 x i8>)
16 declare <32 x i8> @llvm.sadd.sat.v32i8(<32 x i8>, <32 x i8>)
17 declare <64 x i8> @llvm.sadd.sat.v64i8(<64 x i8>, <64 x i8>)
19 declare <1 x i16> @llvm.sadd.sat.v1i16(<1 x i16>, <1 x i16>)
20 declare <2 x i16> @llvm.sadd.sat.v2i16(<2 x i16>, <2 x i16>)
21 declare <4 x i16> @llvm.sadd.sat.v4i16(<4 x i16>, <4 x i16>)
22 declare <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16>, <8 x i16>)
23 declare <12 x i16> @llvm.sadd.sat.v12i16(<12 x i16>, <12 x i16>)
24 declare <16 x i16> @llvm.sadd.sat.v16i16(<16 x i16>, <16 x i16>)
25 declare <32 x i16> @llvm.sadd.sat.v32i16(<32 x i16>, <32 x i16>)
27 declare <16 x i1> @llvm.sadd.sat.v16i1(<16 x i1>, <16 x i1>)
28 declare <16 x i4> @llvm.sadd.sat.v16i4(<16 x i4>, <16 x i4>)
30 declare <2 x i32> @llvm.sadd.sat.v2i32(<2 x i32>, <2 x i32>)
31 declare <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32>, <4 x i32>)
32 declare <8 x i32> @llvm.sadd.sat.v8i32(<8 x i32>, <8 x i32>)
33 declare <16 x i32> @llvm.sadd.sat.v16i32(<16 x i32>, <16 x i32>)
34 declare <2 x i64> @llvm.sadd.sat.v2i64(<2 x i64>, <2 x i64>)
35 declare <4 x i64> @llvm.sadd.sat.v4i64(<4 x i64>, <4 x i64>)
36 declare <8 x i64> @llvm.sadd.sat.v8i64(<8 x i64>, <8 x i64>)
38 declare <4 x i24> @llvm.sadd.sat.v4i24(<4 x i24>, <4 x i24>)
39 declare <2 x i128> @llvm.sadd.sat.v2i128(<2 x i128>, <2 x i128>)
41 define <16 x i8> @v16i8(<16 x i8> %x, <16 x i8> %y) nounwind {
44 ; CHECK-NEXT: sqadd v0.16b, v0.16b, v1.16b
46 %z = call <16 x i8> @llvm.sadd.sat.v16i8(<16 x i8> %x, <16 x i8> %y)
50 define <32 x i8> @v32i8(<32 x i8> %x, <32 x i8> %y) nounwind {
51 ; CHECK-SD-LABEL: v32i8:
53 ; CHECK-SD-NEXT: sqadd v1.16b, v1.16b, v3.16b
54 ; CHECK-SD-NEXT: sqadd v0.16b, v0.16b, v2.16b
57 ; CHECK-GI-LABEL: v32i8:
59 ; CHECK-GI-NEXT: sqadd v0.16b, v0.16b, v2.16b
60 ; CHECK-GI-NEXT: sqadd v1.16b, v1.16b, v3.16b
62 %z = call <32 x i8> @llvm.sadd.sat.v32i8(<32 x i8> %x, <32 x i8> %y)
66 define <64 x i8> @v64i8(<64 x i8> %x, <64 x i8> %y) nounwind {
67 ; CHECK-SD-LABEL: v64i8:
69 ; CHECK-SD-NEXT: sqadd v2.16b, v2.16b, v6.16b
70 ; CHECK-SD-NEXT: sqadd v0.16b, v0.16b, v4.16b
71 ; CHECK-SD-NEXT: sqadd v1.16b, v1.16b, v5.16b
72 ; CHECK-SD-NEXT: sqadd v3.16b, v3.16b, v7.16b
75 ; CHECK-GI-LABEL: v64i8:
77 ; CHECK-GI-NEXT: sqadd v0.16b, v0.16b, v4.16b
78 ; CHECK-GI-NEXT: sqadd v1.16b, v1.16b, v5.16b
79 ; CHECK-GI-NEXT: sqadd v2.16b, v2.16b, v6.16b
80 ; CHECK-GI-NEXT: sqadd v3.16b, v3.16b, v7.16b
82 %z = call <64 x i8> @llvm.sadd.sat.v64i8(<64 x i8> %x, <64 x i8> %y)
86 define <8 x i16> @v8i16(<8 x i16> %x, <8 x i16> %y) nounwind {
89 ; CHECK-NEXT: sqadd v0.8h, v0.8h, v1.8h
91 %z = call <8 x i16> @llvm.sadd.sat.v8i16(<8 x i16> %x, <8 x i16> %y)
95 define <16 x i16> @v16i16(<16 x i16> %x, <16 x i16> %y) nounwind {
96 ; CHECK-SD-LABEL: v16i16:
98 ; CHECK-SD-NEXT: sqadd v1.8h, v1.8h, v3.8h
99 ; CHECK-SD-NEXT: sqadd v0.8h, v0.8h, v2.8h
102 ; CHECK-GI-LABEL: v16i16:
103 ; CHECK-GI: // %bb.0:
104 ; CHECK-GI-NEXT: sqadd v0.8h, v0.8h, v2.8h
105 ; CHECK-GI-NEXT: sqadd v1.8h, v1.8h, v3.8h
107 %z = call <16 x i16> @llvm.sadd.sat.v16i16(<16 x i16> %x, <16 x i16> %y)
111 define <32 x i16> @v32i16(<32 x i16> %x, <32 x i16> %y) nounwind {
112 ; CHECK-SD-LABEL: v32i16:
113 ; CHECK-SD: // %bb.0:
114 ; CHECK-SD-NEXT: sqadd v2.8h, v2.8h, v6.8h
115 ; CHECK-SD-NEXT: sqadd v0.8h, v0.8h, v4.8h
116 ; CHECK-SD-NEXT: sqadd v1.8h, v1.8h, v5.8h
117 ; CHECK-SD-NEXT: sqadd v3.8h, v3.8h, v7.8h
120 ; CHECK-GI-LABEL: v32i16:
121 ; CHECK-GI: // %bb.0:
122 ; CHECK-GI-NEXT: sqadd v0.8h, v0.8h, v4.8h
123 ; CHECK-GI-NEXT: sqadd v1.8h, v1.8h, v5.8h
124 ; CHECK-GI-NEXT: sqadd v2.8h, v2.8h, v6.8h
125 ; CHECK-GI-NEXT: sqadd v3.8h, v3.8h, v7.8h
127 %z = call <32 x i16> @llvm.sadd.sat.v32i16(<32 x i16> %x, <32 x i16> %y)
131 define void @v8i8(ptr %px, ptr %py, ptr %pz) nounwind {
134 ; CHECK-NEXT: ldr d0, [x0]
135 ; CHECK-NEXT: ldr d1, [x1]
136 ; CHECK-NEXT: sqadd v0.8b, v0.8b, v1.8b
137 ; CHECK-NEXT: str d0, [x2]
139 %x = load <8 x i8>, ptr %px
140 %y = load <8 x i8>, ptr %py
141 %z = call <8 x i8> @llvm.sadd.sat.v8i8(<8 x i8> %x, <8 x i8> %y)
142 store <8 x i8> %z, ptr %pz
146 define void @v4i8(ptr %px, ptr %py, ptr %pz) nounwind {
147 ; CHECK-SD-LABEL: v4i8:
148 ; CHECK-SD: // %bb.0:
149 ; CHECK-SD-NEXT: ldr s0, [x0]
150 ; CHECK-SD-NEXT: ldr s1, [x1]
151 ; CHECK-SD-NEXT: ushll v0.8h, v0.8b, #0
152 ; CHECK-SD-NEXT: ushll v1.8h, v1.8b, #0
153 ; CHECK-SD-NEXT: shl v1.4h, v1.4h, #8
154 ; CHECK-SD-NEXT: shl v0.4h, v0.4h, #8
155 ; CHECK-SD-NEXT: sqadd v0.4h, v0.4h, v1.4h
156 ; CHECK-SD-NEXT: ushr v0.4h, v0.4h, #8
157 ; CHECK-SD-NEXT: uzp1 v0.8b, v0.8b, v0.8b
158 ; CHECK-SD-NEXT: str s0, [x2]
161 ; CHECK-GI-LABEL: v4i8:
162 ; CHECK-GI: // %bb.0:
163 ; CHECK-GI-NEXT: ldr w8, [x0]
164 ; CHECK-GI-NEXT: ldr w9, [x1]
165 ; CHECK-GI-NEXT: fmov s0, w8
166 ; CHECK-GI-NEXT: fmov s1, w9
167 ; CHECK-GI-NEXT: mov b2, v0.b[1]
168 ; CHECK-GI-NEXT: mov b3, v1.b[1]
169 ; CHECK-GI-NEXT: mov b4, v0.b[2]
170 ; CHECK-GI-NEXT: mov b5, v0.b[3]
171 ; CHECK-GI-NEXT: mov b6, v1.b[3]
172 ; CHECK-GI-NEXT: mov v0.b[1], v2.b[0]
173 ; CHECK-GI-NEXT: mov b2, v1.b[2]
174 ; CHECK-GI-NEXT: mov v1.b[1], v3.b[0]
175 ; CHECK-GI-NEXT: mov v0.b[2], v4.b[0]
176 ; CHECK-GI-NEXT: mov v1.b[2], v2.b[0]
177 ; CHECK-GI-NEXT: mov v0.b[3], v5.b[0]
178 ; CHECK-GI-NEXT: mov v1.b[3], v6.b[0]
179 ; CHECK-GI-NEXT: sqadd v0.8b, v0.8b, v1.8b
180 ; CHECK-GI-NEXT: fmov w8, s0
181 ; CHECK-GI-NEXT: str w8, [x2]
183 %x = load <4 x i8>, ptr %px
184 %y = load <4 x i8>, ptr %py
185 %z = call <4 x i8> @llvm.sadd.sat.v4i8(<4 x i8> %x, <4 x i8> %y)
186 store <4 x i8> %z, ptr %pz
190 define void @v2i8(ptr %px, ptr %py, ptr %pz) nounwind {
193 ; CHECK-NEXT: ld1 { v0.b }[0], [x0]
194 ; CHECK-NEXT: ld1 { v1.b }[0], [x1]
195 ; CHECK-NEXT: add x8, x0, #1
196 ; CHECK-NEXT: add x9, x1, #1
197 ; CHECK-NEXT: ld1 { v0.b }[4], [x8]
198 ; CHECK-NEXT: ld1 { v1.b }[4], [x9]
199 ; CHECK-NEXT: shl v1.2s, v1.2s, #24
200 ; CHECK-NEXT: shl v0.2s, v0.2s, #24
201 ; CHECK-NEXT: sqadd v0.2s, v0.2s, v1.2s
202 ; CHECK-NEXT: ushr v0.2s, v0.2s, #24
203 ; CHECK-NEXT: mov w8, v0.s[1]
204 ; CHECK-NEXT: fmov w9, s0
205 ; CHECK-NEXT: strb w9, [x2]
206 ; CHECK-NEXT: strb w8, [x2, #1]
208 %x = load <2 x i8>, ptr %px
209 %y = load <2 x i8>, ptr %py
210 %z = call <2 x i8> @llvm.sadd.sat.v2i8(<2 x i8> %x, <2 x i8> %y)
211 store <2 x i8> %z, ptr %pz
215 define void @v4i16(ptr %px, ptr %py, ptr %pz) nounwind {
216 ; CHECK-LABEL: v4i16:
218 ; CHECK-NEXT: ldr d0, [x0]
219 ; CHECK-NEXT: ldr d1, [x1]
220 ; CHECK-NEXT: sqadd v0.4h, v0.4h, v1.4h
221 ; CHECK-NEXT: str d0, [x2]
223 %x = load <4 x i16>, ptr %px
224 %y = load <4 x i16>, ptr %py
225 %z = call <4 x i16> @llvm.sadd.sat.v4i16(<4 x i16> %x, <4 x i16> %y)
226 store <4 x i16> %z, ptr %pz
230 define void @v2i16(ptr %px, ptr %py, ptr %pz) nounwind {
231 ; CHECK-SD-LABEL: v2i16:
232 ; CHECK-SD: // %bb.0:
233 ; CHECK-SD-NEXT: ld1 { v0.h }[0], [x0]
234 ; CHECK-SD-NEXT: ld1 { v1.h }[0], [x1]
235 ; CHECK-SD-NEXT: add x8, x0, #2
236 ; CHECK-SD-NEXT: add x9, x1, #2
237 ; CHECK-SD-NEXT: ld1 { v0.h }[2], [x8]
238 ; CHECK-SD-NEXT: ld1 { v1.h }[2], [x9]
239 ; CHECK-SD-NEXT: shl v1.2s, v1.2s, #16
240 ; CHECK-SD-NEXT: shl v0.2s, v0.2s, #16
241 ; CHECK-SD-NEXT: sqadd v0.2s, v0.2s, v1.2s
242 ; CHECK-SD-NEXT: ushr v0.2s, v0.2s, #16
243 ; CHECK-SD-NEXT: mov w8, v0.s[1]
244 ; CHECK-SD-NEXT: fmov w9, s0
245 ; CHECK-SD-NEXT: strh w9, [x2]
246 ; CHECK-SD-NEXT: strh w8, [x2, #2]
249 ; CHECK-GI-LABEL: v2i16:
250 ; CHECK-GI: // %bb.0:
251 ; CHECK-GI-NEXT: ldr h0, [x0]
252 ; CHECK-GI-NEXT: ldr h1, [x0, #2]
253 ; CHECK-GI-NEXT: ldr h2, [x1]
254 ; CHECK-GI-NEXT: ldr h3, [x1, #2]
255 ; CHECK-GI-NEXT: mov v0.h[1], v1.h[0]
256 ; CHECK-GI-NEXT: mov v2.h[1], v3.h[0]
257 ; CHECK-GI-NEXT: sqadd v0.4h, v0.4h, v2.4h
258 ; CHECK-GI-NEXT: mov h1, v0.h[1]
259 ; CHECK-GI-NEXT: str h0, [x2]
260 ; CHECK-GI-NEXT: str h1, [x2, #2]
262 %x = load <2 x i16>, ptr %px
263 %y = load <2 x i16>, ptr %py
264 %z = call <2 x i16> @llvm.sadd.sat.v2i16(<2 x i16> %x, <2 x i16> %y)
265 store <2 x i16> %z, ptr %pz
269 define <12 x i8> @v12i8(<12 x i8> %x, <12 x i8> %y) nounwind {
270 ; CHECK-LABEL: v12i8:
272 ; CHECK-NEXT: sqadd v0.16b, v0.16b, v1.16b
274 %z = call <12 x i8> @llvm.sadd.sat.v12i8(<12 x i8> %x, <12 x i8> %y)
278 define void @v12i16(ptr %px, ptr %py, ptr %pz) nounwind {
279 ; CHECK-SD-LABEL: v12i16:
280 ; CHECK-SD: // %bb.0:
281 ; CHECK-SD-NEXT: ldp q0, q3, [x1]
282 ; CHECK-SD-NEXT: ldp q1, q2, [x0]
283 ; CHECK-SD-NEXT: sqadd v0.8h, v1.8h, v0.8h
284 ; CHECK-SD-NEXT: sqadd v1.8h, v2.8h, v3.8h
285 ; CHECK-SD-NEXT: str q0, [x2]
286 ; CHECK-SD-NEXT: str d1, [x2, #16]
289 ; CHECK-GI-LABEL: v12i16:
290 ; CHECK-GI: // %bb.0:
291 ; CHECK-GI-NEXT: ldr q0, [x0]
292 ; CHECK-GI-NEXT: ldr q1, [x1]
293 ; CHECK-GI-NEXT: ldr d2, [x0, #16]
294 ; CHECK-GI-NEXT: ldr d3, [x1, #16]
295 ; CHECK-GI-NEXT: sqadd v0.8h, v0.8h, v1.8h
296 ; CHECK-GI-NEXT: sqadd v1.4h, v2.4h, v3.4h
297 ; CHECK-GI-NEXT: str q0, [x2]
298 ; CHECK-GI-NEXT: str d1, [x2, #16]
300 %x = load <12 x i16>, ptr %px
301 %y = load <12 x i16>, ptr %py
302 %z = call <12 x i16> @llvm.sadd.sat.v12i16(<12 x i16> %x, <12 x i16> %y)
303 store <12 x i16> %z, ptr %pz
307 define void @v1i8(ptr %px, ptr %py, ptr %pz) nounwind {
308 ; CHECK-SD-LABEL: v1i8:
309 ; CHECK-SD: // %bb.0:
310 ; CHECK-SD-NEXT: ldr b0, [x0]
311 ; CHECK-SD-NEXT: ldr b1, [x1]
312 ; CHECK-SD-NEXT: sqadd v0.8b, v0.8b, v1.8b
313 ; CHECK-SD-NEXT: st1 { v0.b }[0], [x2]
316 ; CHECK-GI-LABEL: v1i8:
317 ; CHECK-GI: // %bb.0:
318 ; CHECK-GI-NEXT: ldrsb w8, [x0]
319 ; CHECK-GI-NEXT: ldrsb w9, [x1]
320 ; CHECK-GI-NEXT: add w8, w8, w9
321 ; CHECK-GI-NEXT: sxtb w9, w8
322 ; CHECK-GI-NEXT: asr w10, w9, #7
323 ; CHECK-GI-NEXT: cmp w8, w9
324 ; CHECK-GI-NEXT: sub w10, w10, #128
325 ; CHECK-GI-NEXT: csel w8, w10, w8, ne
326 ; CHECK-GI-NEXT: strb w8, [x2]
328 %x = load <1 x i8>, ptr %px
329 %y = load <1 x i8>, ptr %py
330 %z = call <1 x i8> @llvm.sadd.sat.v1i8(<1 x i8> %x, <1 x i8> %y)
331 store <1 x i8> %z, ptr %pz
335 define void @v1i16(ptr %px, ptr %py, ptr %pz) nounwind {
336 ; CHECK-SD-LABEL: v1i16:
337 ; CHECK-SD: // %bb.0:
338 ; CHECK-SD-NEXT: ldr h0, [x0]
339 ; CHECK-SD-NEXT: ldr h1, [x1]
340 ; CHECK-SD-NEXT: sqadd v0.4h, v0.4h, v1.4h
341 ; CHECK-SD-NEXT: str h0, [x2]
344 ; CHECK-GI-LABEL: v1i16:
345 ; CHECK-GI: // %bb.0:
346 ; CHECK-GI-NEXT: ldrsh w8, [x0]
347 ; CHECK-GI-NEXT: ldrsh w9, [x1]
348 ; CHECK-GI-NEXT: add w8, w8, w9
349 ; CHECK-GI-NEXT: sxth w9, w8
350 ; CHECK-GI-NEXT: asr w10, w9, #15
351 ; CHECK-GI-NEXT: cmp w8, w9
352 ; CHECK-GI-NEXT: sub w10, w10, #8, lsl #12 // =32768
353 ; CHECK-GI-NEXT: csel w8, w10, w8, ne
354 ; CHECK-GI-NEXT: strh w8, [x2]
356 %x = load <1 x i16>, ptr %px
357 %y = load <1 x i16>, ptr %py
358 %z = call <1 x i16> @llvm.sadd.sat.v1i16(<1 x i16> %x, <1 x i16> %y)
359 store <1 x i16> %z, ptr %pz
363 define <16 x i4> @v16i4(<16 x i4> %x, <16 x i4> %y) nounwind {
364 ; CHECK-LABEL: v16i4:
366 ; CHECK-NEXT: shl v1.16b, v1.16b, #4
367 ; CHECK-NEXT: shl v0.16b, v0.16b, #4
368 ; CHECK-NEXT: sqadd v0.16b, v0.16b, v1.16b
369 ; CHECK-NEXT: sshr v0.16b, v0.16b, #4
371 %z = call <16 x i4> @llvm.sadd.sat.v16i4(<16 x i4> %x, <16 x i4> %y)
375 define <16 x i1> @v16i1(<16 x i1> %x, <16 x i1> %y) nounwind {
376 ; CHECK-LABEL: v16i1:
378 ; CHECK-NEXT: orr v0.16b, v0.16b, v1.16b
380 %z = call <16 x i1> @llvm.sadd.sat.v16i1(<16 x i1> %x, <16 x i1> %y)
384 define <2 x i32> @v2i32(<2 x i32> %x, <2 x i32> %y) nounwind {
385 ; CHECK-LABEL: v2i32:
387 ; CHECK-NEXT: sqadd v0.2s, v0.2s, v1.2s
389 %z = call <2 x i32> @llvm.sadd.sat.v2i32(<2 x i32> %x, <2 x i32> %y)
393 define <4 x i32> @v4i32(<4 x i32> %x, <4 x i32> %y) nounwind {
394 ; CHECK-LABEL: v4i32:
396 ; CHECK-NEXT: sqadd v0.4s, v0.4s, v1.4s
398 %z = call <4 x i32> @llvm.sadd.sat.v4i32(<4 x i32> %x, <4 x i32> %y)
402 define <8 x i32> @v8i32(<8 x i32> %x, <8 x i32> %y) nounwind {
403 ; CHECK-SD-LABEL: v8i32:
404 ; CHECK-SD: // %bb.0:
405 ; CHECK-SD-NEXT: sqadd v1.4s, v1.4s, v3.4s
406 ; CHECK-SD-NEXT: sqadd v0.4s, v0.4s, v2.4s
409 ; CHECK-GI-LABEL: v8i32:
410 ; CHECK-GI: // %bb.0:
411 ; CHECK-GI-NEXT: sqadd v0.4s, v0.4s, v2.4s
412 ; CHECK-GI-NEXT: sqadd v1.4s, v1.4s, v3.4s
414 %z = call <8 x i32> @llvm.sadd.sat.v8i32(<8 x i32> %x, <8 x i32> %y)
418 define <16 x i32> @v16i32(<16 x i32> %x, <16 x i32> %y) nounwind {
419 ; CHECK-SD-LABEL: v16i32:
420 ; CHECK-SD: // %bb.0:
421 ; CHECK-SD-NEXT: sqadd v2.4s, v2.4s, v6.4s
422 ; CHECK-SD-NEXT: sqadd v0.4s, v0.4s, v4.4s
423 ; CHECK-SD-NEXT: sqadd v1.4s, v1.4s, v5.4s
424 ; CHECK-SD-NEXT: sqadd v3.4s, v3.4s, v7.4s
427 ; CHECK-GI-LABEL: v16i32:
428 ; CHECK-GI: // %bb.0:
429 ; CHECK-GI-NEXT: sqadd v0.4s, v0.4s, v4.4s
430 ; CHECK-GI-NEXT: sqadd v1.4s, v1.4s, v5.4s
431 ; CHECK-GI-NEXT: sqadd v2.4s, v2.4s, v6.4s
432 ; CHECK-GI-NEXT: sqadd v3.4s, v3.4s, v7.4s
434 %z = call <16 x i32> @llvm.sadd.sat.v16i32(<16 x i32> %x, <16 x i32> %y)
438 define <2 x i64> @v2i64(<2 x i64> %x, <2 x i64> %y) nounwind {
439 ; CHECK-LABEL: v2i64:
441 ; CHECK-NEXT: sqadd v0.2d, v0.2d, v1.2d
443 %z = call <2 x i64> @llvm.sadd.sat.v2i64(<2 x i64> %x, <2 x i64> %y)
447 define <4 x i64> @v4i64(<4 x i64> %x, <4 x i64> %y) nounwind {
448 ; CHECK-SD-LABEL: v4i64:
449 ; CHECK-SD: // %bb.0:
450 ; CHECK-SD-NEXT: sqadd v1.2d, v1.2d, v3.2d
451 ; CHECK-SD-NEXT: sqadd v0.2d, v0.2d, v2.2d
454 ; CHECK-GI-LABEL: v4i64:
455 ; CHECK-GI: // %bb.0:
456 ; CHECK-GI-NEXT: sqadd v0.2d, v0.2d, v2.2d
457 ; CHECK-GI-NEXT: sqadd v1.2d, v1.2d, v3.2d
459 %z = call <4 x i64> @llvm.sadd.sat.v4i64(<4 x i64> %x, <4 x i64> %y)
463 define <8 x i64> @v8i64(<8 x i64> %x, <8 x i64> %y) nounwind {
464 ; CHECK-SD-LABEL: v8i64:
465 ; CHECK-SD: // %bb.0:
466 ; CHECK-SD-NEXT: sqadd v2.2d, v2.2d, v6.2d
467 ; CHECK-SD-NEXT: sqadd v0.2d, v0.2d, v4.2d
468 ; CHECK-SD-NEXT: sqadd v1.2d, v1.2d, v5.2d
469 ; CHECK-SD-NEXT: sqadd v3.2d, v3.2d, v7.2d
472 ; CHECK-GI-LABEL: v8i64:
473 ; CHECK-GI: // %bb.0:
474 ; CHECK-GI-NEXT: sqadd v0.2d, v0.2d, v4.2d
475 ; CHECK-GI-NEXT: sqadd v1.2d, v1.2d, v5.2d
476 ; CHECK-GI-NEXT: sqadd v2.2d, v2.2d, v6.2d
477 ; CHECK-GI-NEXT: sqadd v3.2d, v3.2d, v7.2d
479 %z = call <8 x i64> @llvm.sadd.sat.v8i64(<8 x i64> %x, <8 x i64> %y)
483 define <2 x i128> @v2i128(<2 x i128> %x, <2 x i128> %y) nounwind {
484 ; CHECK-LABEL: v2i128:
486 ; CHECK-NEXT: adds x8, x2, x6
487 ; CHECK-NEXT: adcs x9, x3, x7
488 ; CHECK-NEXT: asr x10, x9, #63
489 ; CHECK-NEXT: eor x11, x10, #0x8000000000000000
490 ; CHECK-NEXT: csel x2, x10, x8, vs
491 ; CHECK-NEXT: csel x3, x11, x9, vs
492 ; CHECK-NEXT: adds x8, x0, x4
493 ; CHECK-NEXT: adcs x9, x1, x5
494 ; CHECK-NEXT: asr x10, x9, #63
495 ; CHECK-NEXT: csel x8, x10, x8, vs
496 ; CHECK-NEXT: eor x11, x10, #0x8000000000000000
497 ; CHECK-NEXT: fmov d0, x8
498 ; CHECK-NEXT: csel x1, x11, x9, vs
499 ; CHECK-NEXT: mov v0.d[1], x1
500 ; CHECK-NEXT: fmov x0, d0
502 %z = call <2 x i128> @llvm.sadd.sat.v2i128(<2 x i128> %x, <2 x i128> %y)