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
7 define <vscale x 16 x i8> @smax_i8_pos(<vscale x 16 x i8> %a) {
8 ; CHECK-LABEL: smax_i8_pos:
10 ; CHECK-NEXT: smax z0.b, z0.b, #27
12 %cmp = icmp sgt <vscale x 16 x i8> %a, splat(i8 27)
13 %res = select <vscale x 16 x i1> %cmp, <vscale x 16 x i8> %a, <vscale x 16 x i8> splat(i8 27)
14 ret <vscale x 16 x i8> %res
17 define <vscale x 16 x i8> @smax_i8_neg(<vscale x 16 x i8> %a) {
18 ; CHECK-LABEL: smax_i8_neg:
20 ; CHECK-NEXT: smax z0.b, z0.b, #-58
22 %cmp = icmp sgt <vscale x 16 x i8> %a, splat(i8 -58)
23 %res = select <vscale x 16 x i1> %cmp, <vscale x 16 x i8> %a, <vscale x 16 x i8> splat(i8 -58)
24 ret <vscale x 16 x i8> %res
27 define <vscale x 8 x i16> @smax_i16_pos(<vscale x 8 x i16> %a) {
28 ; CHECK-LABEL: smax_i16_pos:
30 ; CHECK-NEXT: smax z0.h, z0.h, #27
32 %cmp = icmp sgt <vscale x 8 x i16> %a, splat(i16 27)
33 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 27)
34 ret <vscale x 8 x i16> %res
37 define <vscale x 8 x i16> @smax_i16_neg(<vscale x 8 x i16> %a) {
38 ; CHECK-LABEL: smax_i16_neg:
40 ; CHECK-NEXT: smax z0.h, z0.h, #-58
42 %cmp = icmp sgt <vscale x 8 x i16> %a, splat(i16 -58)
43 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 -58)
44 ret <vscale x 8 x i16> %res
47 define <vscale x 8 x i16> @smax_i16_out_of_range(<vscale x 8 x i16> %a) {
48 ; CHECK-LABEL: smax_i16_out_of_range:
50 ; CHECK-NEXT: dupm z1.b, #0x1
51 ; CHECK-NEXT: ptrue p0.h
52 ; CHECK-NEXT: smax z0.h, p0/m, z0.h, z1.h
54 %cmp = icmp sgt <vscale x 8 x i16> %a, splat(i16 257)
55 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 257)
56 ret <vscale x 8 x i16> %res
59 define <vscale x 4 x i32> @smax_i32_pos(<vscale x 4 x i32> %a) {
60 ; CHECK-LABEL: smax_i32_pos:
62 ; CHECK-NEXT: smax z0.s, z0.s, #27
64 %cmp = icmp sgt <vscale x 4 x i32> %a, splat(i32 27)
65 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 27)
66 ret <vscale x 4 x i32> %res
69 define <vscale x 4 x i32> @smax_i32_neg(<vscale x 4 x i32> %a) {
70 ; CHECK-LABEL: smax_i32_neg:
72 ; CHECK-NEXT: smax z0.s, z0.s, #-58
74 %cmp = icmp sgt <vscale x 4 x i32> %a, splat(i32 -58)
75 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 -58)
76 ret <vscale x 4 x i32> %res
79 define <vscale x 4 x i32> @smax_i32_out_of_range(<vscale x 4 x i32> %a) {
80 ; CHECK-LABEL: smax_i32_out_of_range:
82 ; CHECK-NEXT: mov z1.s, #-129 // =0xffffffffffffff7f
83 ; CHECK-NEXT: ptrue p0.s
84 ; CHECK-NEXT: smax z0.s, p0/m, z0.s, z1.s
86 %cmp = icmp sgt <vscale x 4 x i32> %a, splat(i32 -129)
87 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 -129)
88 ret <vscale x 4 x i32> %res
91 define <vscale x 2 x i64> @smax_i64_pos(<vscale x 2 x i64> %a) {
92 ; CHECK-LABEL: smax_i64_pos:
94 ; CHECK-NEXT: smax z0.d, z0.d, #27
96 %cmp = icmp sgt <vscale x 2 x i64> %a, splat(i64 27)
97 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 27)
98 ret <vscale x 2 x i64> %res
101 define <vscale x 2 x i64> @smax_i64_neg(<vscale x 2 x i64> %a) {
102 ; CHECK-LABEL: smax_i64_neg:
104 ; CHECK-NEXT: smax z0.d, z0.d, #-58
106 %cmp = icmp sgt <vscale x 2 x i64> %a, splat(i64 -58)
107 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 -58)
108 ret <vscale x 2 x i64> %res
111 define <vscale x 2 x i64> @smax_i64_out_of_range(<vscale x 2 x i64> %a) {
112 ; CHECK-LABEL: smax_i64_out_of_range:
114 ; CHECK-NEXT: mov z1.d, #65535 // =0xffff
115 ; CHECK-NEXT: ptrue p0.d
116 ; CHECK-NEXT: smax z0.d, p0/m, z0.d, z1.d
118 %cmp = icmp sgt <vscale x 2 x i64> %a, splat(i64 65535)
119 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 65535)
120 ret <vscale x 2 x i64> %res
126 define <vscale x 16 x i8> @smin_i8_pos(<vscale x 16 x i8> %a) {
127 ; CHECK-LABEL: smin_i8_pos:
129 ; CHECK-NEXT: smin z0.b, z0.b, #27
131 %cmp = icmp slt <vscale x 16 x i8> %a, splat(i8 27)
132 %res = select <vscale x 16 x i1> %cmp, <vscale x 16 x i8> %a, <vscale x 16 x i8> splat(i8 27)
133 ret <vscale x 16 x i8> %res
136 define <vscale x 16 x i8> @smin_i8_neg(<vscale x 16 x i8> %a) {
137 ; CHECK-LABEL: smin_i8_neg:
139 ; CHECK-NEXT: smin z0.b, z0.b, #-58
141 %cmp = icmp slt <vscale x 16 x i8> %a, splat(i8 -58)
142 %res = select <vscale x 16 x i1> %cmp, <vscale x 16 x i8> %a, <vscale x 16 x i8> splat(i8 -58)
143 ret <vscale x 16 x i8> %res
146 define <vscale x 8 x i16> @smin_i16_pos(<vscale x 8 x i16> %a) {
147 ; CHECK-LABEL: smin_i16_pos:
149 ; CHECK-NEXT: smin z0.h, z0.h, #27
151 %cmp = icmp slt <vscale x 8 x i16> %a, splat(i16 27)
152 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 27)
153 ret <vscale x 8 x i16> %res
156 define <vscale x 8 x i16> @smin_i16_neg(<vscale x 8 x i16> %a) {
157 ; CHECK-LABEL: smin_i16_neg:
159 ; CHECK-NEXT: smin z0.h, z0.h, #-58
161 %cmp = icmp slt <vscale x 8 x i16> %a, splat(i16 -58)
162 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 -58)
163 ret <vscale x 8 x i16> %res
166 define <vscale x 8 x i16> @smin_i16_out_of_range(<vscale x 8 x i16> %a) {
167 ; CHECK-LABEL: smin_i16_out_of_range:
169 ; CHECK-NEXT: dupm z1.b, #0x1
170 ; CHECK-NEXT: ptrue p0.h
171 ; CHECK-NEXT: smin z0.h, p0/m, z0.h, z1.h
173 %cmp = icmp slt <vscale x 8 x i16> %a, splat(i16 257)
174 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 257)
175 ret <vscale x 8 x i16> %res
178 define <vscale x 4 x i32> @smin_i32_pos(<vscale x 4 x i32> %a) {
179 ; CHECK-LABEL: smin_i32_pos:
181 ; CHECK-NEXT: smin z0.s, z0.s, #27
183 %cmp = icmp slt <vscale x 4 x i32> %a, splat(i32 27)
184 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 27)
185 ret <vscale x 4 x i32> %res
188 define <vscale x 4 x i32> @smin_i32_neg(<vscale x 4 x i32> %a) {
189 ; CHECK-LABEL: smin_i32_neg:
191 ; CHECK-NEXT: smin z0.s, z0.s, #-58
193 %cmp = icmp slt <vscale x 4 x i32> %a, splat(i32 -58)
194 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 -58)
195 ret <vscale x 4 x i32> %res
198 define <vscale x 4 x i32> @smin_i32_out_of_range(<vscale x 4 x i32> %a) {
199 ; CHECK-LABEL: smin_i32_out_of_range:
201 ; CHECK-NEXT: mov z1.s, #-129 // =0xffffffffffffff7f
202 ; CHECK-NEXT: ptrue p0.s
203 ; CHECK-NEXT: smin z0.s, p0/m, z0.s, z1.s
205 %cmp = icmp slt <vscale x 4 x i32> %a, splat(i32 -129)
206 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 -129)
207 ret <vscale x 4 x i32> %res
210 define <vscale x 2 x i64> @smin_i64_pos(<vscale x 2 x i64> %a) {
211 ; CHECK-LABEL: smin_i64_pos:
213 ; CHECK-NEXT: smin z0.d, z0.d, #27
215 %cmp = icmp slt <vscale x 2 x i64> %a, splat(i64 27)
216 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 27)
217 ret <vscale x 2 x i64> %res
220 define <vscale x 2 x i64> @smin_i64_neg(<vscale x 2 x i64> %a) {
221 ; CHECK-LABEL: smin_i64_neg:
223 ; CHECK-NEXT: smin z0.d, z0.d, #-58
225 %cmp = icmp slt <vscale x 2 x i64> %a, splat(i64 -58)
226 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 -58)
227 ret <vscale x 2 x i64> %res
230 define <vscale x 2 x i64> @smin_i64_out_of_range(<vscale x 2 x i64> %a) {
231 ; CHECK-LABEL: smin_i64_out_of_range:
233 ; CHECK-NEXT: mov z1.d, #65535 // =0xffff
234 ; CHECK-NEXT: ptrue p0.d
235 ; CHECK-NEXT: smin z0.d, p0/m, z0.d, z1.d
237 %cmp = icmp slt <vscale x 2 x i64> %a, splat(i64 65535)
238 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 65535)
239 ret <vscale x 2 x i64> %res
245 define <vscale x 16 x i8> @umax_i8_pos(<vscale x 16 x i8> %a) {
246 ; CHECK-LABEL: umax_i8_pos:
248 ; CHECK-NEXT: umax z0.b, z0.b, #27
250 %cmp = icmp ugt <vscale x 16 x i8> %a, splat(i8 27)
251 %res = select <vscale x 16 x i1> %cmp, <vscale x 16 x i8> %a, <vscale x 16 x i8> splat(i8 27)
252 ret <vscale x 16 x i8> %res
255 define <vscale x 16 x i8> @umax_i8_large(<vscale x 16 x i8> %a) {
256 ; CHECK-LABEL: umax_i8_large:
258 ; CHECK-NEXT: umax z0.b, z0.b, #129
260 %cmp = icmp ugt <vscale x 16 x i8> %a, splat(i8 129)
261 %res = select <vscale x 16 x i1> %cmp, <vscale x 16 x i8> %a, <vscale x 16 x i8> splat(i8 129)
262 ret <vscale x 16 x i8> %res
265 define <vscale x 8 x i16> @umax_i16_pos(<vscale x 8 x i16> %a) {
266 ; CHECK-LABEL: umax_i16_pos:
268 ; CHECK-NEXT: umax z0.h, z0.h, #27
270 %cmp = icmp ugt <vscale x 8 x i16> %a, splat(i16 27)
271 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 27)
272 ret <vscale x 8 x i16> %res
275 define <vscale x 8 x i16> @umax_i16_out_of_range(<vscale x 8 x i16> %a) {
276 ; CHECK-LABEL: umax_i16_out_of_range:
278 ; CHECK-NEXT: dupm z1.b, #0x1
279 ; CHECK-NEXT: ptrue p0.h
280 ; CHECK-NEXT: umax z0.h, p0/m, z0.h, z1.h
282 %cmp = icmp ugt <vscale x 8 x i16> %a, splat(i16 257)
283 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 257)
284 ret <vscale x 8 x i16> %res
287 define <vscale x 4 x i32> @umax_i32_pos(<vscale x 4 x i32> %a) {
288 ; CHECK-LABEL: umax_i32_pos:
290 ; CHECK-NEXT: umax z0.s, z0.s, #27
292 %cmp = icmp ugt <vscale x 4 x i32> %a, splat(i32 27)
293 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 27)
294 ret <vscale x 4 x i32> %res
297 define <vscale x 4 x i32> @umax_i32_out_of_range(<vscale x 4 x i32> %a) {
298 ; CHECK-LABEL: umax_i32_out_of_range:
300 ; CHECK-NEXT: mov w8, #257 // =0x101
301 ; CHECK-NEXT: ptrue p0.s
302 ; CHECK-NEXT: mov z1.s, w8
303 ; CHECK-NEXT: umax z0.s, p0/m, z0.s, z1.s
305 %cmp = icmp ugt <vscale x 4 x i32> %a, splat(i32 257)
306 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 257)
307 ret <vscale x 4 x i32> %res
310 define <vscale x 2 x i64> @umax_i64_pos(<vscale x 2 x i64> %a) {
311 ; CHECK-LABEL: umax_i64_pos:
313 ; CHECK-NEXT: umax z0.d, z0.d, #27
315 %cmp = icmp ugt <vscale x 2 x i64> %a, splat(i64 27)
316 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 27)
317 ret <vscale x 2 x i64> %res
320 define <vscale x 2 x i64> @umax_i64_out_of_range(<vscale x 2 x i64> %a) {
321 ; CHECK-LABEL: umax_i64_out_of_range:
323 ; CHECK-NEXT: mov z1.d, #65535 // =0xffff
324 ; CHECK-NEXT: ptrue p0.d
325 ; CHECK-NEXT: umax z0.d, p0/m, z0.d, z1.d
327 %cmp = icmp ugt <vscale x 2 x i64> %a, splat(i64 65535)
328 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 65535)
329 ret <vscale x 2 x i64> %res
335 define <vscale x 16 x i8> @umin_i8_pos(<vscale x 16 x i8> %a) {
336 ; CHECK-LABEL: umin_i8_pos:
338 ; CHECK-NEXT: umin z0.b, z0.b, #27
340 %cmp = icmp ult <vscale x 16 x i8> %a, splat(i8 27)
341 %res = select <vscale x 16 x i1> %cmp, <vscale x 16 x i8> %a, <vscale x 16 x i8> splat(i8 27)
342 ret <vscale x 16 x i8> %res
345 define <vscale x 16 x i8> @umin_i8_large(<vscale x 16 x i8> %a) {
346 ; CHECK-LABEL: umin_i8_large:
348 ; CHECK-NEXT: umin z0.b, z0.b, #129
350 %cmp = icmp ult <vscale x 16 x i8> %a, splat(i8 129)
351 %res = select <vscale x 16 x i1> %cmp, <vscale x 16 x i8> %a, <vscale x 16 x i8> splat(i8 129)
352 ret <vscale x 16 x i8> %res
355 define <vscale x 8 x i16> @umin_i16_pos(<vscale x 8 x i16> %a) {
356 ; CHECK-LABEL: umin_i16_pos:
358 ; CHECK-NEXT: umin z0.h, z0.h, #27
360 %cmp = icmp ult <vscale x 8 x i16> %a, splat(i16 27)
361 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 27)
362 ret <vscale x 8 x i16> %res
365 define <vscale x 8 x i16> @umin_i16_out_of_range(<vscale x 8 x i16> %a) {
366 ; CHECK-LABEL: umin_i16_out_of_range:
368 ; CHECK-NEXT: dupm z1.b, #0x1
369 ; CHECK-NEXT: ptrue p0.h
370 ; CHECK-NEXT: umin z0.h, p0/m, z0.h, z1.h
372 %cmp = icmp ult <vscale x 8 x i16> %a, splat(i16 257)
373 %res = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %a, <vscale x 8 x i16> splat(i16 257)
374 ret <vscale x 8 x i16> %res
377 define <vscale x 4 x i32> @umin_i32_pos(<vscale x 4 x i32> %a) {
378 ; CHECK-LABEL: umin_i32_pos:
380 ; CHECK-NEXT: umin z0.s, z0.s, #27
382 %cmp = icmp ult <vscale x 4 x i32> %a, splat(i32 27)
383 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 27)
384 ret <vscale x 4 x i32> %res
387 define <vscale x 4 x i32> @umin_i32_out_of_range(<vscale x 4 x i32> %a) {
388 ; CHECK-LABEL: umin_i32_out_of_range:
390 ; CHECK-NEXT: mov w8, #257 // =0x101
391 ; CHECK-NEXT: ptrue p0.s
392 ; CHECK-NEXT: mov z1.s, w8
393 ; CHECK-NEXT: umin z0.s, p0/m, z0.s, z1.s
395 %cmp = icmp ult <vscale x 4 x i32> %a, splat(i32 257)
396 %res = select <vscale x 4 x i1> %cmp, <vscale x 4 x i32> %a, <vscale x 4 x i32> splat(i32 257)
397 ret <vscale x 4 x i32> %res
400 define <vscale x 2 x i64> @umin_i64_pos(<vscale x 2 x i64> %a) {
401 ; CHECK-LABEL: umin_i64_pos:
403 ; CHECK-NEXT: umin z0.d, z0.d, #27
405 %cmp = icmp ult <vscale x 2 x i64> %a, splat(i64 27)
406 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 27)
407 ret <vscale x 2 x i64> %res
410 define <vscale x 2 x i64> @umin_i64_out_of_range(<vscale x 2 x i64> %a) {
411 ; CHECK-LABEL: umin_i64_out_of_range:
413 ; CHECK-NEXT: mov z1.d, #65535 // =0xffff
414 ; CHECK-NEXT: ptrue p0.d
415 ; CHECK-NEXT: umin z0.d, p0/m, z0.d, z1.d
417 %cmp = icmp ult <vscale x 2 x i64> %a, splat(i64 65535)
418 %res = select <vscale x 2 x i1> %cmp, <vscale x 2 x i64> %a, <vscale x 2 x i64> splat(i64 65535)
419 ret <vscale x 2 x i64> %res
425 define <vscale x 16 x i8> @mul_i8_neg(<vscale x 16 x i8> %a) {
426 ; CHECK-LABEL: mul_i8_neg:
428 ; CHECK-NEXT: mul z0.b, z0.b, #-17
430 %res = mul <vscale x 16 x i8> %a, splat(i8 -17)
431 ret <vscale x 16 x i8> %res
434 define <vscale x 16 x i8> @mul_i8_pos(<vscale x 16 x i8> %a) {
435 ; CHECK-LABEL: mul_i8_pos:
437 ; CHECK-NEXT: mul z0.b, z0.b, #105
439 %res = mul <vscale x 16 x i8> %a, splat(i8 105)
440 ret <vscale x 16 x i8> %res
443 define <vscale x 8 x i16> @mul_i16_neg(<vscale x 8 x i16> %a) {
444 ; CHECK-LABEL: mul_i16_neg:
446 ; CHECK-NEXT: mul z0.h, z0.h, #-17
448 %res = mul <vscale x 8 x i16> %a, splat(i16 -17)
449 ret <vscale x 8 x i16> %res
452 define <vscale x 8 x i16> @mul_i16_pos(<vscale x 8 x i16> %a) {
453 ; CHECK-LABEL: mul_i16_pos:
455 ; CHECK-NEXT: mul z0.h, z0.h, #105
457 %res = mul <vscale x 8 x i16> %a, splat(i16 105)
458 ret <vscale x 8 x i16> %res
461 define <vscale x 4 x i32> @mul_i32_neg(<vscale x 4 x i32> %a) {
462 ; CHECK-LABEL: mul_i32_neg:
464 ; CHECK-NEXT: mul z0.s, z0.s, #-17
466 %res = mul <vscale x 4 x i32> %a, splat(i32 -17)
467 ret <vscale x 4 x i32> %res
470 define <vscale x 4 x i32> @mul_i32_pos(<vscale x 4 x i32> %a) {
471 ; CHECK-LABEL: mul_i32_pos:
473 ; CHECK-NEXT: mul z0.s, z0.s, #105
475 %res = mul <vscale x 4 x i32> %a, splat(i32 105)
476 ret <vscale x 4 x i32> %res
479 define <vscale x 2 x i64> @mul_i64_neg(<vscale x 2 x i64> %a) {
480 ; CHECK-LABEL: mul_i64_neg:
482 ; CHECK-NEXT: mul z0.d, z0.d, #-17
484 %res = mul <vscale x 2 x i64> %a, splat(i64 -17)
485 ret <vscale x 2 x i64> %res
488 define <vscale x 2 x i64> @mul_i64_pos(<vscale x 2 x i64> %a) {
489 ; CHECK-LABEL: mul_i64_pos:
491 ; CHECK-NEXT: mul z0.d, z0.d, #105
493 %res = mul <vscale x 2 x i64> %a, splat(i64 105)
494 ret <vscale x 2 x i64> %res
497 define <vscale x 8 x i16> @mul_i16_range(<vscale x 8 x i16> %a) {
498 ; CHECK-LABEL: mul_i16_range:
500 ; CHECK-NEXT: mov z1.h, #255 // =0xff
501 ; CHECK-NEXT: ptrue p0.h
502 ; CHECK-NEXT: mul z0.h, p0/m, z0.h, z1.h
504 %res = mul <vscale x 8 x i16> %a, splat(i16 255)
505 ret <vscale x 8 x i16> %res
508 define <vscale x 4 x i32> @mul_i32_range(<vscale x 4 x i32> %a) {
509 ; CHECK-LABEL: mul_i32_range:
511 ; CHECK-NEXT: mov z1.s, #255 // =0xff
512 ; CHECK-NEXT: ptrue p0.s
513 ; CHECK-NEXT: mul z0.s, p0/m, z0.s, z1.s
515 %res = mul <vscale x 4 x i32> %a, splat(i32 255)
516 ret <vscale x 4 x i32> %res
519 define <vscale x 2 x i64> @mul_i64_range(<vscale x 2 x i64> %a) {
520 ; CHECK-LABEL: mul_i64_range:
522 ; CHECK-NEXT: mov z1.d, #255 // =0xff
523 ; CHECK-NEXT: ptrue p0.d
524 ; CHECK-NEXT: mul z0.d, p0/m, z0.d, z1.d
526 %res = mul <vscale x 2 x i64> %a, splat(i64 255)
527 ret <vscale x 2 x i64> %res
532 define <vscale x 16 x i8> @asr_i8(<vscale x 16 x i8> %a){
533 ; CHECK-LABEL: asr_i8:
535 ; CHECK-NEXT: asr z0.b, z0.b, #7
537 %lshr = ashr <vscale x 16 x i8> %a, splat(i8 7)
538 ret <vscale x 16 x i8> %lshr
541 define <vscale x 8 x i16> @asr_i16(<vscale x 8 x i16> %a){
542 ; CHECK-LABEL: asr_i16:
544 ; CHECK-NEXT: asr z0.h, z0.h, #15
546 %ashr = ashr <vscale x 8 x i16> %a, splat(i16 15)
547 ret <vscale x 8 x i16> %ashr
550 define <vscale x 4 x i32> @asr_i32(<vscale x 4 x i32> %a){
551 ; CHECK-LABEL: asr_i32:
553 ; CHECK-NEXT: asr z0.s, z0.s, #31
555 %ashr = ashr <vscale x 4 x i32> %a, splat(i32 31)
556 ret <vscale x 4 x i32> %ashr
559 define <vscale x 2 x i64> @asr_i64(<vscale x 2 x i64> %a){
560 ; CHECK-LABEL: asr_i64:
562 ; CHECK-NEXT: asr z0.d, z0.d, #63
564 %ashr = ashr <vscale x 2 x i64> %a, splat(i64 63)
565 ret <vscale x 2 x i64> %ashr
570 define <vscale x 16 x i8> @lsl_i8(<vscale x 16 x i8> %a){
571 ; CHECK-LABEL: lsl_i8:
573 ; CHECK-NEXT: lsl z0.b, z0.b, #7
575 %shl = shl <vscale x 16 x i8> %a, splat(i8 7)
576 ret <vscale x 16 x i8> %shl
579 define <vscale x 8 x i16> @lsl_i16(<vscale x 8 x i16> %a){
580 ; CHECK-LABEL: lsl_i16:
582 ; CHECK-NEXT: lsl z0.h, z0.h, #15
584 %shl = shl <vscale x 8 x i16> %a, splat(i16 15)
585 ret <vscale x 8 x i16> %shl
588 define <vscale x 4 x i32> @lsl_i32(<vscale x 4 x i32> %a){
589 ; CHECK-LABEL: lsl_i32:
591 ; CHECK-NEXT: lsl z0.s, z0.s, #31
593 %shl = shl <vscale x 4 x i32> %a, splat(i32 31)
594 ret <vscale x 4 x i32> %shl
597 define <vscale x 2 x i64> @lsl_i64(<vscale x 2 x i64> %a){
598 ; CHECK-LABEL: lsl_i64:
600 ; CHECK-NEXT: lsl z0.d, z0.d, #63
602 %shl = shl <vscale x 2 x i64> %a, splat(i64 63)
603 ret <vscale x 2 x i64> %shl
608 define <vscale x 16 x i8> @lsr_i8(<vscale x 16 x i8> %a){
609 ; CHECK-LABEL: lsr_i8:
611 ; CHECK-NEXT: lsr z0.b, z0.b, #7
613 %lshr = lshr <vscale x 16 x i8> %a, splat(i8 7)
614 ret <vscale x 16 x i8> %lshr
617 define <vscale x 8 x i16> @lsr_i16(<vscale x 8 x i16> %a){
618 ; CHECK-LABEL: lsr_i16:
620 ; CHECK-NEXT: lsr z0.h, z0.h, #15
622 %lshr = lshr <vscale x 8 x i16> %a, splat(i16 15)
623 ret <vscale x 8 x i16> %lshr
626 define <vscale x 4 x i32> @lsr_i32(<vscale x 4 x i32> %a){
627 ; CHECK-LABEL: lsr_i32:
629 ; CHECK-NEXT: lsr z0.s, z0.s, #31
631 %lshr = lshr <vscale x 4 x i32> %a, splat(i32 31)
632 ret <vscale x 4 x i32> %lshr
635 define <vscale x 2 x i64> @lsr_i64(<vscale x 2 x i64> %a){
636 ; CHECK-LABEL: lsr_i64:
638 ; CHECK-NEXT: lsr z0.d, z0.d, #63
640 %lshr = lshr <vscale x 2 x i64> %a, splat(i64 63)
641 ret <vscale x 2 x i64> %lshr
644 define <vscale x 4 x i32> @sdiv_const(<vscale x 4 x i32> %a) #0 {
645 ; CHECK-LABEL: sdiv_const:
646 ; CHECK: // %bb.0: // %entry
647 ; CHECK-NEXT: mov z1.s, #3 // =0x3
648 ; CHECK-NEXT: ptrue p0.s
649 ; CHECK-NEXT: sdiv z0.s, p0/m, z0.s, z1.s
652 %div = sdiv <vscale x 4 x i32> %a, splat (i32 3)
653 ret <vscale x 4 x i32> %div
656 define <vscale x 4 x i32> @udiv_const(<vscale x 4 x i32> %a) #0 {
657 ; CHECK-LABEL: udiv_const:
658 ; CHECK: // %bb.0: // %entry
659 ; CHECK-NEXT: mov z1.s, #3 // =0x3
660 ; CHECK-NEXT: ptrue p0.s
661 ; CHECK-NEXT: udiv z0.s, p0/m, z0.s, z1.s
664 %div = udiv <vscale x 4 x i32> %a, splat (i32 3)
665 ret <vscale x 4 x i32> %div
671 define <vscale x 8 x i16> @uqsub(<vscale x 8 x i16> %a) {
672 ; CHECK-LABEL: uqsub:
674 ; CHECK-NEXT: uqsub z0.h, z0.h, #32768 // =0x8000
676 %cmp = icmp slt <vscale x 8 x i16> %a, zeroinitializer
677 %sub = xor <vscale x 8 x i16> %a, splat (i16 -32768)
678 %sel = select <vscale x 8 x i1> %cmp, <vscale x 8 x i16> %sub, <vscale x 8 x i16> zeroinitializer
679 ret <vscale x 8 x i16> %sel
682 attributes #0 = { minsize }