1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve -asm-verbose=0 < %s | FileCheck %s
3 ; Since SQDEC{B|H|W|D|P} and SQINC{B|H|W|D|P} have identical semantics, the tests for
4 ; * @llvm.aarch64.sve.sqinc{b|h|w|d|p}, and
5 ; * @llvm.aarch64.sve.sqdec{b|h|w|d|p}
6 ; should also be identical (with the instruction name being adjusted). When
7 ; updating this file remember to make similar changes in the file testing the
14 define <vscale x 8 x i16> @sqdech(<vscale x 8 x i16> %a) {
15 ; CHECK-LABEL: sqdech:
16 ; CHECK: sqdech z0.h, pow2
18 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.sqdech.nxv8i16(<vscale x 8 x i16> %a,
20 ret <vscale x 8 x i16> %out
27 define <vscale x 4 x i32> @sqdecw(<vscale x 4 x i32> %a) {
28 ; CHECK-LABEL: sqdecw:
29 ; CHECK: sqdecw z0.s, vl1, mul #2
31 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.sqdecw.nxv4i32(<vscale x 4 x i32> %a,
33 ret <vscale x 4 x i32> %out
40 define <vscale x 2 x i64> @sqdecd(<vscale x 2 x i64> %a) {
41 ; CHECK-LABEL: sqdecd:
42 ; CHECK: sqdecd z0.d, vl2, mul #3
44 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.sqdecd.nxv2i64(<vscale x 2 x i64> %a,
46 ret <vscale x 2 x i64> %out
53 define <vscale x 8 x i16> @sqdecp_b16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %b) {
54 ; CHECK-LABEL: sqdecp_b16:
55 ; CHECK: sqdecp z0.h, p0
57 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.sqdecp.nxv8i16(<vscale x 8 x i16> %a,
59 ret <vscale x 8 x i16> %out
62 define <vscale x 4 x i32> @sqdecp_b32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %b) {
63 ; CHECK-LABEL: sqdecp_b32:
64 ; CHECK: sqdecp z0.s, p0
66 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.sqdecp.nxv4i32(<vscale x 4 x i32> %a,
68 ret <vscale x 4 x i32> %out
71 define <vscale x 2 x i64> @sqdecp_b64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %b) {
72 ; CHECK-LABEL: sqdecp_b64:
73 ; CHECK: sqdecp z0.d, p0
75 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.sqdecp.nxv2i64(<vscale x 2 x i64> %a,
77 ret <vscale x 2 x i64> %out
84 define i32 @sqdecb_n32_i32(i32 %a) {
85 ; CHECK-LABEL: sqdecb_n32_i32:
86 ; CHECK: sqdecb x0, w0, vl3, mul #4
88 %out = call i32 @llvm.aarch64.sve.sqdecb.n32(i32 %a, i32 3, i32 4)
92 define i64 @sqdecb_n32_i64(i32 %a) {
93 ; CHECK-LABEL: sqdecb_n32_i64:
94 ; CHECK: sqdecb x0, w0, vl3, mul #4
96 %out = call i32 @llvm.aarch64.sve.sqdecb.n32(i32 %a, i32 3, i32 4)
97 %out_sext = sext i32 %out to i64
102 define i64 @sqdecb_n64(i64 %a) {
103 ; CHECK-LABEL: sqdecb_n64:
104 ; CHECK: sqdecb x0, vl4, mul #5
106 %out = call i64 @llvm.aarch64.sve.sqdecb.n64(i64 %a, i32 4, i32 5)
114 define i32 @sqdech_n32_i32(i32 %a) {
115 ; CHECK-LABEL: sqdech_n32_i32:
116 ; CHECK: sqdech x0, w0, vl5, mul #6
118 %out = call i32 @llvm.aarch64.sve.sqdech.n32(i32 %a, i32 5, i32 6)
122 define i64 @sqdech_n32_i64(i32 %a) {
123 ; CHECK-LABEL: sqdech_n32_i64:
124 ; CHECK: sqdech x0, w0, vl3, mul #4
126 %out = call i32 @llvm.aarch64.sve.sqdech.n32(i32 %a, i32 3, i32 4)
127 %out_sext = sext i32 %out to i64
132 define i64 @sqdech_n64(i64 %a) {
133 ; CHECK-LABEL: sqdech_n64:
134 ; CHECK: sqdech x0, vl6, mul #7
136 %out = call i64 @llvm.aarch64.sve.sqdech.n64(i64 %a, i32 6, i32 7)
144 define i32 @sqdecw_n32_i32(i32 %a) {
145 ; CHECK-LABEL: sqdecw_n32_i32:
146 ; CHECK: sqdecw x0, w0, vl7, mul #8
148 %out = call i32 @llvm.aarch64.sve.sqdecw.n32(i32 %a, i32 7, i32 8)
152 define i64 @sqdecw_n32_i64(i32 %a) {
153 ; CHECK-LABEL: sqdecw_n32_i64:
154 ; CHECK: sqdecw x0, w0, vl3, mul #4
156 %out = call i32 @llvm.aarch64.sve.sqdecw.n32(i32 %a, i32 3, i32 4)
157 %out_sext = sext i32 %out to i64
162 define i64 @sqdecw_n64(i64 %a) {
163 ; CHECK-LABEL: sqdecw_n64:
164 ; CHECK: sqdecw x0, vl8, mul #9
166 %out = call i64 @llvm.aarch64.sve.sqdecw.n64(i64 %a, i32 8, i32 9)
174 define i32 @sqdecd_n32_i32(i32 %a) {
175 ; CHECK-LABEL: sqdecd_n32_i32:
176 ; CHECK: sqdecd x0, w0, vl16, mul #10
178 %out = call i32 @llvm.aarch64.sve.sqdecd.n32(i32 %a, i32 9, i32 10)
182 define i64 @sqdecd_n32_i64(i32 %a) {
183 ; CHECK-LABEL: sqdecd_n32_i64:
184 ; CHECK: sqdecd x0, w0, vl3, mul #4
186 %out = call i32 @llvm.aarch64.sve.sqdecd.n32(i32 %a, i32 3, i32 4)
187 %out_sext = sext i32 %out to i64
192 define i64 @sqdecd_n64(i64 %a) {
193 ; CHECK-LABEL: sqdecd_n64:
194 ; CHECK: sqdecd x0, vl32, mul #11
196 %out = call i64 @llvm.aarch64.sve.sqdecd.n64(i64 %a, i32 10, i32 11)
204 define i32 @sqdecp_n32_b8_i32(i32 %a, <vscale x 16 x i1> %b) {
205 ; CHECK-LABEL: sqdecp_n32_b8_i32:
206 ; CHECK: sqdecp x0, p0.b, w0
208 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv16i1(i32 %a, <vscale x 16 x i1> %b)
212 define i64 @sqdecp_n32_b8_i64(i32 %a, <vscale x 16 x i1> %b) {
213 ; CHECK-LABEL: sqdecp_n32_b8_i64:
214 ; CHECK: sqdecp x0, p0.b, w0
216 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv16i1(i32 %a, <vscale x 16 x i1> %b)
217 %out_sext = sext i32 %out to i64
222 define i32 @sqdecp_n32_b16_i32(i32 %a, <vscale x 8 x i1> %b) {
223 ; CHECK-LABEL: sqdecp_n32_b16_i32:
224 ; CHECK: sqdecp x0, p0.h, w0
226 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv8i1(i32 %a, <vscale x 8 x i1> %b)
230 define i64 @sqdecp_n32_b16_i64(i32 %a, <vscale x 8 x i1> %b) {
231 ; CHECK-LABEL: sqdecp_n32_b16_i64:
232 ; CHECK: sqdecp x0, p0.h, w0
234 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv8i1(i32 %a, <vscale x 8 x i1> %b)
235 %out_sext = sext i32 %out to i64
240 define i32 @sqdecp_n32_b32_i32(i32 %a, <vscale x 4 x i1> %b) {
241 ; CHECK-LABEL: sqdecp_n32_b32_i32:
242 ; CHECK: sqdecp x0, p0.s, w0
244 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv4i1(i32 %a, <vscale x 4 x i1> %b)
248 define i64 @sqdecp_n32_b32_i64(i32 %a, <vscale x 4 x i1> %b) {
249 ; CHECK-LABEL: sqdecp_n32_b32_i64:
250 ; CHECK: sqdecp x0, p0.s, w0
252 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv4i1(i32 %a, <vscale x 4 x i1> %b)
253 %out_sext = sext i32 %out to i64
258 define i32 @sqdecp_n32_b64_i32(i32 %a, <vscale x 2 x i1> %b) {
259 ; CHECK-LABEL: sqdecp_n32_b64_i32:
260 ; CHECK: sqdecp x0, p0.d, w0
262 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv2i1(i32 %a, <vscale x 2 x i1> %b)
266 define i64 @sqdecp_n32_b64_i64(i32 %a, <vscale x 2 x i1> %b) {
267 ; CHECK-LABEL: sqdecp_n32_b64_i64:
268 ; CHECK: sqdecp x0, p0.d, w0
270 %out = call i32 @llvm.aarch64.sve.sqdecp.n32.nxv2i1(i32 %a, <vscale x 2 x i1> %b)
271 %out_sext = sext i32 %out to i64
276 define i64 @sqdecp_n64_b8(i64 %a, <vscale x 16 x i1> %b) {
277 ; CHECK-LABEL: sqdecp_n64_b8:
278 ; CHECK: sqdecp x0, p0.b
280 %out = call i64 @llvm.aarch64.sve.sqdecp.n64.nxv16i1(i64 %a, <vscale x 16 x i1> %b)
284 define i64 @sqdecp_n64_b16(i64 %a, <vscale x 8 x i1> %b) {
285 ; CHECK-LABEL: sqdecp_n64_b16:
286 ; CHECK: sqdecp x0, p0.h
288 %out = call i64 @llvm.aarch64.sve.sqdecp.n64.nxv8i1(i64 %a, <vscale x 8 x i1> %b)
292 define i64 @sqdecp_n64_b32(i64 %a, <vscale x 4 x i1> %b) {
293 ; CHECK-LABEL: sqdecp_n64_b32:
294 ; CHECK: sqdecp x0, p0.s
296 %out = call i64 @llvm.aarch64.sve.sqdecp.n64.nxv4i1(i64 %a, <vscale x 4 x i1> %b)
300 define i64 @sqdecp_n64_b64(i64 %a, <vscale x 2 x i1> %b) {
301 ; CHECK-LABEL: sqdecp_n64_b64:
302 ; CHECK: sqdecp x0, p0.d
304 %out = call i64 @llvm.aarch64.sve.sqdecp.n64.nxv2i1(i64 %a, <vscale x 2 x i1> %b)
308 ; sqdec{h|w|d}(vector, pattern, multiplier)
309 declare <vscale x 8 x i16> @llvm.aarch64.sve.sqdech.nxv8i16(<vscale x 8 x i16>, i32, i32)
310 declare <vscale x 4 x i32> @llvm.aarch64.sve.sqdecw.nxv4i32(<vscale x 4 x i32>, i32, i32)
311 declare <vscale x 2 x i64> @llvm.aarch64.sve.sqdecd.nxv2i64(<vscale x 2 x i64>, i32, i32)
313 ; sqdec{b|h|w|d}(scalar, pattern, multiplier)
314 declare i32 @llvm.aarch64.sve.sqdecb.n32(i32, i32, i32)
315 declare i64 @llvm.aarch64.sve.sqdecb.n64(i64, i32, i32)
316 declare i32 @llvm.aarch64.sve.sqdech.n32(i32, i32, i32)
317 declare i64 @llvm.aarch64.sve.sqdech.n64(i64, i32, i32)
318 declare i32 @llvm.aarch64.sve.sqdecw.n32(i32, i32, i32)
319 declare i64 @llvm.aarch64.sve.sqdecw.n64(i64, i32, i32)
320 declare i32 @llvm.aarch64.sve.sqdecd.n32(i32, i32, i32)
321 declare i64 @llvm.aarch64.sve.sqdecd.n64(i64, i32, i32)
323 ; sqdecp(scalar, predicate)
324 declare i32 @llvm.aarch64.sve.sqdecp.n32.nxv16i1(i32, <vscale x 16 x i1>)
325 declare i32 @llvm.aarch64.sve.sqdecp.n32.nxv8i1(i32, <vscale x 8 x i1>)
326 declare i32 @llvm.aarch64.sve.sqdecp.n32.nxv4i1(i32, <vscale x 4 x i1>)
327 declare i32 @llvm.aarch64.sve.sqdecp.n32.nxv2i1(i32, <vscale x 2 x i1>)
329 declare i64 @llvm.aarch64.sve.sqdecp.n64.nxv16i1(i64, <vscale x 16 x i1>)
330 declare i64 @llvm.aarch64.sve.sqdecp.n64.nxv8i1(i64, <vscale x 8 x i1>)
331 declare i64 @llvm.aarch64.sve.sqdecp.n64.nxv4i1(i64, <vscale x 4 x i1>)
332 declare i64 @llvm.aarch64.sve.sqdecp.n64.nxv2i1(i64, <vscale x 2 x i1>)
334 ; sqdecp(vector, predicate)
335 declare <vscale x 8 x i16> @llvm.aarch64.sve.sqdecp.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>)
336 declare <vscale x 4 x i32> @llvm.aarch64.sve.sqdecp.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>)
337 declare <vscale x 2 x i64> @llvm.aarch64.sve.sqdecp.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>)