1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
3 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme -force-streaming < %s | FileCheck %s
5 ; Since SQDEC{B|H|W|D|P} and SQINC{B|H|W|D|P} have identical semantics, the tests for
6 ; * @llvm.aarch64.sve.sqinc{b|h|w|d|p}, and
7 ; * @llvm.aarch64.sve.sqdec{b|h|w|d|p}
8 ; should also be identical (with the instruction name being adjusted). When
9 ; updating this file remember to make similar changes in the file testing the
16 define <vscale x 8 x i16> @sqdech(<vscale x 8 x i16> %a) {
17 ; CHECK-LABEL: sqdech:
19 ; CHECK-NEXT: sqdech z0.h, pow2
21 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.sqdech.nxv8i16(<vscale x 8 x i16> %a,
23 ret <vscale x 8 x i16> %out
30 define <vscale x 4 x i32> @sqdecw(<vscale x 4 x i32> %a) {
31 ; CHECK-LABEL: sqdecw:
33 ; CHECK-NEXT: sqdecw z0.s, vl1, mul #2
35 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.sqdecw.nxv4i32(<vscale x 4 x i32> %a,
37 ret <vscale x 4 x i32> %out
44 define <vscale x 2 x i64> @sqdecd(<vscale x 2 x i64> %a) {
45 ; CHECK-LABEL: sqdecd:
47 ; CHECK-NEXT: sqdecd z0.d, vl2, mul #3
49 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.sqdecd.nxv2i64(<vscale x 2 x i64> %a,
51 ret <vscale x 2 x i64> %out
58 define <vscale x 8 x i16> @sqdecp_b16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %b) {
59 ; CHECK-LABEL: sqdecp_b16:
61 ; CHECK-NEXT: sqdecp z0.h, p0.h
63 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.sqdecp.nxv8i16(<vscale x 8 x i16> %a,
65 ret <vscale x 8 x i16> %out
68 define <vscale x 4 x i32> @sqdecp_b32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %b) {
69 ; CHECK-LABEL: sqdecp_b32:
71 ; CHECK-NEXT: sqdecp z0.s, p0.s
73 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.sqdecp.nxv4i32(<vscale x 4 x i32> %a,
75 ret <vscale x 4 x i32> %out
78 define <vscale x 2 x i64> @sqdecp_b64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %b) {
79 ; CHECK-LABEL: sqdecp_b64:
81 ; CHECK-NEXT: sqdecp z0.d, p0.d
83 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.sqdecp.nxv2i64(<vscale x 2 x i64> %a,
85 ret <vscale x 2 x i64> %out
92 define i32 @sqdecb_n32_i32(i32 %a) {
93 ; CHECK-LABEL: sqdecb_n32_i32:
95 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
96 ; CHECK-NEXT: sqdecb x0, w0, vl3, mul #4
97 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
99 %out = call i32 @llvm.aarch64.sve.sqdecb.n32(i32 %a, i32 3, i32 4)
103 define i64 @sqdecb_n32_i64(i32 %a) {
104 ; CHECK-LABEL: sqdecb_n32_i64:
106 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
107 ; CHECK-NEXT: sqdecb x0, w0, vl3, mul #4
109 %out = call i32 @llvm.aarch64.sve.sqdecb.n32(i32 %a, i32 3, i32 4)
110 %out_sext = sext i32 %out to i64
115 define i64 @sqdecb_n64(i64 %a) {
116 ; CHECK-LABEL: sqdecb_n64:
118 ; CHECK-NEXT: sqdecb x0, vl4, mul #5
120 %out = call i64 @llvm.aarch64.sve.sqdecb.n64(i64 %a, i32 4, i32 5)
128 define i32 @sqdech_n32_i32(i32 %a) {
129 ; CHECK-LABEL: sqdech_n32_i32:
131 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
132 ; CHECK-NEXT: sqdech x0, w0, vl5, mul #6
133 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
135 %out = call i32 @llvm.aarch64.sve.sqdech.n32(i32 %a, i32 5, i32 6)
139 define i64 @sqdech_n32_i64(i32 %a) {
140 ; CHECK-LABEL: sqdech_n32_i64:
142 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
143 ; CHECK-NEXT: sqdech x0, w0, vl3, mul #4
145 %out = call i32 @llvm.aarch64.sve.sqdech.n32(i32 %a, i32 3, i32 4)
146 %out_sext = sext i32 %out to i64
151 define i64 @sqdech_n64(i64 %a) {
152 ; CHECK-LABEL: sqdech_n64:
154 ; CHECK-NEXT: sqdech x0, vl6, mul #7
156 %out = call i64 @llvm.aarch64.sve.sqdech.n64(i64 %a, i32 6, i32 7)
164 define i32 @sqdecw_n32_i32(i32 %a) {
165 ; CHECK-LABEL: sqdecw_n32_i32:
167 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
168 ; CHECK-NEXT: sqdecw x0, w0, vl7, mul #8
169 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
171 %out = call i32 @llvm.aarch64.sve.sqdecw.n32(i32 %a, i32 7, i32 8)
175 define i64 @sqdecw_n32_i64(i32 %a) {
176 ; CHECK-LABEL: sqdecw_n32_i64:
178 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
179 ; CHECK-NEXT: sqdecw x0, w0, vl3, mul #4
181 %out = call i32 @llvm.aarch64.sve.sqdecw.n32(i32 %a, i32 3, i32 4)
182 %out_sext = sext i32 %out to i64
187 define i64 @sqdecw_n64(i64 %a) {
188 ; CHECK-LABEL: sqdecw_n64:
190 ; CHECK-NEXT: sqdecw x0, vl8, mul #9
192 %out = call i64 @llvm.aarch64.sve.sqdecw.n64(i64 %a, i32 8, i32 9)
200 define i32 @sqdecd_n32_i32(i32 %a) {
201 ; CHECK-LABEL: sqdecd_n32_i32:
203 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
204 ; CHECK-NEXT: sqdecd x0, w0, vl16, mul #10
205 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
207 %out = call i32 @llvm.aarch64.sve.sqdecd.n32(i32 %a, i32 9, i32 10)
211 define i64 @sqdecd_n32_i64(i32 %a) {
212 ; CHECK-LABEL: sqdecd_n32_i64:
214 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
215 ; CHECK-NEXT: sqdecd x0, w0, vl3, mul #4
217 %out = call i32 @llvm.aarch64.sve.sqdecd.n32(i32 %a, i32 3, i32 4)
218 %out_sext = sext i32 %out to i64
223 define i64 @sqdecd_n64(i64 %a) {
224 ; CHECK-LABEL: sqdecd_n64:
226 ; CHECK-NEXT: sqdecd x0, vl32, mul #11
228 %out = call i64 @llvm.aarch64.sve.sqdecd.n64(i64 %a, i32 10, i32 11)
236 define i32 @sqdecp_n32_b8_i32(i32 %a, <vscale x 16 x i1> %b) {
237 ; CHECK-LABEL: sqdecp_n32_b8_i32:
239 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
240 ; CHECK-NEXT: sqdecp x0, p0.b, w0
241 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
243 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv16i1(i32 %a, <vscale x 16 x i1> %b)
247 define i64 @sqdecp_n32_b8_i64(i32 %a, <vscale x 16 x i1> %b) {
248 ; CHECK-LABEL: sqdecp_n32_b8_i64:
250 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
251 ; CHECK-NEXT: sqdecp x0, p0.b, w0
253 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv16i1(i32 %a, <vscale x 16 x i1> %b)
254 %out_sext = sext i32 %out to i64
259 define i32 @sqdecp_n32_b16_i32(i32 %a, <vscale x 8 x i1> %b) {
260 ; CHECK-LABEL: sqdecp_n32_b16_i32:
262 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
263 ; CHECK-NEXT: sqdecp x0, p0.h, w0
264 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
266 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv8i1(i32 %a, <vscale x 8 x i1> %b)
270 define i64 @sqdecp_n32_b16_i64(i32 %a, <vscale x 8 x i1> %b) {
271 ; CHECK-LABEL: sqdecp_n32_b16_i64:
273 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
274 ; CHECK-NEXT: sqdecp x0, p0.h, w0
276 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv8i1(i32 %a, <vscale x 8 x i1> %b)
277 %out_sext = sext i32 %out to i64
282 define i32 @sqdecp_n32_b32_i32(i32 %a, <vscale x 4 x i1> %b) {
283 ; CHECK-LABEL: sqdecp_n32_b32_i32:
285 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
286 ; CHECK-NEXT: sqdecp x0, p0.s, w0
287 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
289 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv4i1(i32 %a, <vscale x 4 x i1> %b)
293 define i64 @sqdecp_n32_b32_i64(i32 %a, <vscale x 4 x i1> %b) {
294 ; CHECK-LABEL: sqdecp_n32_b32_i64:
296 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
297 ; CHECK-NEXT: sqdecp x0, p0.s, w0
299 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv4i1(i32 %a, <vscale x 4 x i1> %b)
300 %out_sext = sext i32 %out to i64
305 define i32 @sqdecp_n32_b64_i32(i32 %a, <vscale x 2 x i1> %b) {
306 ; CHECK-LABEL: sqdecp_n32_b64_i32:
308 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
309 ; CHECK-NEXT: sqdecp x0, p0.d, w0
310 ; CHECK-NEXT: // kill: def $w0 killed $w0 killed $x0
312 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv2i1(i32 %a, <vscale x 2 x i1> %b)
316 define i64 @sqdecp_n32_b64_i64(i32 %a, <vscale x 2 x i1> %b) {
317 ; CHECK-LABEL: sqdecp_n32_b64_i64:
319 ; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
320 ; CHECK-NEXT: sqdecp x0, p0.d, w0
322 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv2i1(i32 %a, <vscale x 2 x i1> %b)
323 %out_sext = sext i32 %out to i64
328 define i64 @sqdecp_n64_b8(i64 %a, <vscale x 16 x i1> %b) {
329 ; CHECK-LABEL: sqdecp_n64_b8:
331 ; CHECK-NEXT: sqdecp x0, p0.b
333 %out = call i64 @llvm.aarch64.sve.sqdecp.n64.nxv16i1(i64 %a, <vscale x 16 x i1> %b)
337 define i64 @sqdecp_n64_b16(i64 %a, <vscale x 8 x i1> %b) {
338 ; CHECK-LABEL: sqdecp_n64_b16:
340 ; CHECK-NEXT: sqdecp x0, p0.h
342 %out = call i64 @llvm.aarch64.sve.sqdecp.n64.nxv8i1(i64 %a, <vscale x 8 x i1> %b)
346 define i64 @sqdecp_n64_b32(i64 %a, <vscale x 4 x i1> %b) {
347 ; CHECK-LABEL: sqdecp_n64_b32:
349 ; CHECK-NEXT: sqdecp x0, p0.s
351 %out = call i64 @llvm.aarch64.sve.sqdecp.n64.nxv4i1(i64 %a, <vscale x 4 x i1> %b)
355 define i64 @sqdecp_n64_b64(i64 %a, <vscale x 2 x i1> %b) {
356 ; CHECK-LABEL: sqdecp_n64_b64:
358 ; CHECK-NEXT: sqdecp x0, p0.d
360 %out = call i64 @llvm.aarch64.sve.sqdecp.n64.nxv2i1(i64 %a, <vscale x 2 x i1> %b)
364 ; sqdec{h|w|d}(vector, pattern, multiplier)
365 declare <vscale x 8 x i16> @llvm.aarch64.sve.sqdech.nxv8i16(<vscale x 8 x i16>, i32, i32)
366 declare <vscale x 4 x i32> @llvm.aarch64.sve.sqdecw.nxv4i32(<vscale x 4 x i32>, i32, i32)
367 declare <vscale x 2 x i64> @llvm.aarch64.sve.sqdecd.nxv2i64(<vscale x 2 x i64>, i32, i32)
369 ; sqdec{b|h|w|d}(scalar, pattern, multiplier)
370 declare i32 @llvm.aarch64.sve.sqdecb.n32(i32, i32, i32)
371 declare i64 @llvm.aarch64.sve.sqdecb.n64(i64, i32, i32)
372 declare i32 @llvm.aarch64.sve.sqdech.n32(i32, i32, i32)
373 declare i64 @llvm.aarch64.sve.sqdech.n64(i64, i32, i32)
374 declare i32 @llvm.aarch64.sve.sqdecw.n32(i32, i32, i32)
375 declare i64 @llvm.aarch64.sve.sqdecw.n64(i64, i32, i32)
376 declare i32 @llvm.aarch64.sve.sqdecd.n32(i32, i32, i32)
377 declare i64 @llvm.aarch64.sve.sqdecd.n64(i64, i32, i32)
379 ; sqdecp(scalar, predicate)
380 declare i32 @llvm.aarch64.sve.sqdecp.n32.nxv16i1(i32, <vscale x 16 x i1>)
381 declare i32 @llvm.aarch64.sve.sqdecp.n32.nxv8i1(i32, <vscale x 8 x i1>)
382 declare i32 @llvm.aarch64.sve.sqdecp.n32.nxv4i1(i32, <vscale x 4 x i1>)
383 declare i32 @llvm.aarch64.sve.sqdecp.n32.nxv2i1(i32, <vscale x 2 x i1>)
385 declare i64 @llvm.aarch64.sve.sqdecp.n64.nxv16i1(i64, <vscale x 16 x i1>)
386 declare i64 @llvm.aarch64.sve.sqdecp.n64.nxv8i1(i64, <vscale x 8 x i1>)
387 declare i64 @llvm.aarch64.sve.sqdecp.n64.nxv4i1(i64, <vscale x 4 x i1>)
388 declare i64 @llvm.aarch64.sve.sqdecp.n64.nxv2i1(i64, <vscale x 2 x i1>)
390 ; sqdecp(vector, predicate)
391 declare <vscale x 8 x i16> @llvm.aarch64.sve.sqdecp.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>)
392 declare <vscale x 4 x i32> @llvm.aarch64.sve.sqdecp.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>)
393 declare <vscale x 2 x i64> @llvm.aarch64.sve.sqdecp.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>)