1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-none-linux-gnu -mattr=+neon,+sve | FileCheck %s
4 define <2 x i64> @shr64x2(<2 x i64> %a, i64 %b) {
5 ; CHECK-LABEL: shr64x2:
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: dup v1.2d, x0
8 ; CHECK-NEXT: sshl v0.2d, v0.2d, v1.2d
11 %sub = sub nsw i64 0, %b
12 %splat.splatinsert = insertelement <2 x i64> poison, i64 %sub, i32 0
13 %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
14 %shr = ashr <2 x i64> %a, %splat.splat
18 define <4 x i32> @shr32x4(<4 x i32> %a, i32 %b) {
19 ; CHECK-LABEL: shr32x4:
20 ; CHECK: // %bb.0: // %entry
21 ; CHECK-NEXT: dup v1.4s, w0
22 ; CHECK-NEXT: sshl v0.4s, v0.4s, v1.4s
25 %sub = sub nsw i32 0, %b
26 %splat.splatinsert = insertelement <4 x i32> poison, i32 %sub, i32 0
27 %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
28 %shr = ashr <4 x i32> %a, %splat.splat
32 define <4 x i32> @shr32x4undef(<4 x i32> %a, i32 %b) {
33 ; CHECK-LABEL: shr32x4undef:
34 ; CHECK: // %bb.0: // %entry
35 ; CHECK-NEXT: dup v1.4s, w0
36 ; CHECK-NEXT: sshl v0.4s, v0.4s, v1.4s
39 %sub = sub nsw i32 0, %b
40 %splat.splatinsert = insertelement <4 x i32> poison, i32 %sub, i32 0
41 %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> poison, <4 x i32> <i32 undef, i32 0, i32 0, i32 0>
42 %shr = ashr <4 x i32> %a, %splat.splat
46 define <8 x i16> @shr16x8(<8 x i16> %a, i16 %b) {
47 ; CHECK-LABEL: shr16x8:
48 ; CHECK: // %bb.0: // %entry
49 ; CHECK-NEXT: dup v1.8h, w0
50 ; CHECK-NEXT: sshl v0.8h, v0.8h, v1.8h
54 %0 = insertelement <8 x i16> undef, i16 %sub, i32 0
55 %sh_prom = shufflevector <8 x i16> %0, <8 x i16> undef, <8 x i32> zeroinitializer
56 %shr = ashr <8 x i16> %a, %sh_prom
60 define <16 x i8> @shr8x16(<16 x i8> %a, i8 %b) {
61 ; CHECK-LABEL: shr8x16:
62 ; CHECK: // %bb.0: // %entry
63 ; CHECK-NEXT: dup v1.16b, w0
64 ; CHECK-NEXT: sshl v0.16b, v0.16b, v1.16b
68 %0 = insertelement <16 x i8> undef, i8 %sub, i32 0
69 %sh_prom = shufflevector <16 x i8> %0, <16 x i8> undef, <16 x i32> zeroinitializer
70 %shr = ashr <16 x i8> %a, %sh_prom
74 define <1 x i64> @shr64x1(<1 x i64> %a, i64 %b) {
75 ; CHECK-LABEL: shr64x1:
76 ; CHECK: // %bb.0: // %entry
77 ; CHECK-NEXT: fmov d1, x0
78 ; CHECK-NEXT: sshl d0, d0, d1
81 %sub = sub nsw i64 0, %b
82 %splat.splatinsert = insertelement <1 x i64> poison, i64 %sub, i32 0
83 %shr = ashr <1 x i64> %a, %splat.splatinsert
87 define <2 x i32> @shr32x2(<2 x i32> %a, i32 %b) {
88 ; CHECK-LABEL: shr32x2:
89 ; CHECK: // %bb.0: // %entry
90 ; CHECK-NEXT: dup v1.2s, w0
91 ; CHECK-NEXT: sshl v0.2s, v0.2s, v1.2s
94 %sub = sub nsw i32 0, %b
95 %splat.splatinsert = insertelement <2 x i32> poison, i32 %sub, i32 0
96 %splat.splat = shufflevector <2 x i32> %splat.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
97 %shr = ashr <2 x i32> %a, %splat.splat
101 define <4 x i16> @shr16x4(<4 x i16> %a, i16 %b) {
102 ; CHECK-LABEL: shr16x4:
103 ; CHECK: // %bb.0: // %entry
104 ; CHECK-NEXT: dup v1.4h, w0
105 ; CHECK-NEXT: sshl v0.4h, v0.4h, v1.4h
109 %0 = insertelement <4 x i16> undef, i16 %sub, i32 0
110 %sh_prom = shufflevector <4 x i16> %0, <4 x i16> undef, <4 x i32> zeroinitializer
111 %shr = ashr <4 x i16> %a, %sh_prom
115 define <8 x i8> @shr8x8(<8 x i8> %a, i8 %b) {
116 ; CHECK-LABEL: shr8x8:
117 ; CHECK: // %bb.0: // %entry
118 ; CHECK-NEXT: dup v1.8b, w0
119 ; CHECK-NEXT: sshl v0.8b, v0.8b, v1.8b
123 %0 = insertelement <8 x i8> undef, i8 %sub, i32 0
124 %sh_prom = shufflevector <8 x i8> %0, <8 x i8> undef, <8 x i32> zeroinitializer
125 %shr = ashr <8 x i8> %a, %sh_prom
129 define <2 x i64> @lshr64x2(<2 x i64> %a, i64 %b) {
130 ; CHECK-LABEL: lshr64x2:
131 ; CHECK: // %bb.0: // %entry
132 ; CHECK-NEXT: dup v1.2d, x0
133 ; CHECK-NEXT: ushl v0.2d, v0.2d, v1.2d
136 %sub = sub nsw i64 0, %b
137 %splat.splatinsert = insertelement <2 x i64> poison, i64 %sub, i32 0
138 %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
139 %shr = lshr <2 x i64> %a, %splat.splat
143 define <4 x i32> @lshr32x4(<4 x i32> %a, i32 %b) {
144 ; CHECK-LABEL: lshr32x4:
145 ; CHECK: // %bb.0: // %entry
146 ; CHECK-NEXT: dup v1.4s, w0
147 ; CHECK-NEXT: ushl v0.4s, v0.4s, v1.4s
150 %sub = sub nsw i32 0, %b
151 %splat.splatinsert = insertelement <4 x i32> poison, i32 %sub, i32 0
152 %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
153 %shr = lshr <4 x i32> %a, %splat.splat
157 define <4 x i32> @lshr32x4undef(<4 x i32> %a, i32 %b) {
158 ; CHECK-LABEL: lshr32x4undef:
159 ; CHECK: // %bb.0: // %entry
160 ; CHECK-NEXT: dup v1.4s, w0
161 ; CHECK-NEXT: ushl v0.4s, v0.4s, v1.4s
164 %sub = sub nsw i32 0, %b
165 %splat.splatinsert = insertelement <4 x i32> poison, i32 %sub, i32 0
166 %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> poison, <4 x i32> <i32 undef, i32 0, i32 0, i32 0>
167 %shr = lshr <4 x i32> %a, %splat.splat
171 define <8 x i16> @lshr16x8(<8 x i16> %a, i16 %b) {
172 ; CHECK-LABEL: lshr16x8:
173 ; CHECK: // %bb.0: // %entry
174 ; CHECK-NEXT: dup v1.8h, w0
175 ; CHECK-NEXT: ushl v0.8h, v0.8h, v1.8h
179 %0 = insertelement <8 x i16> undef, i16 %sub, i32 0
180 %sh_prom = shufflevector <8 x i16> %0, <8 x i16> undef, <8 x i32> zeroinitializer
181 %shr = lshr <8 x i16> %a, %sh_prom
185 define <16 x i8> @lshr8x16(<16 x i8> %a, i8 %b) {
186 ; CHECK-LABEL: lshr8x16:
187 ; CHECK: // %bb.0: // %entry
188 ; CHECK-NEXT: dup v1.16b, w0
189 ; CHECK-NEXT: ushl v0.16b, v0.16b, v1.16b
193 %0 = insertelement <16 x i8> undef, i8 %sub, i32 0
194 %sh_prom = shufflevector <16 x i8> %0, <16 x i8> undef, <16 x i32> zeroinitializer
195 %shr = lshr <16 x i8> %a, %sh_prom
199 define <1 x i64> @lshr64x1(<1 x i64> %a, i64 %b) {
200 ; CHECK-LABEL: lshr64x1:
201 ; CHECK: // %bb.0: // %entry
202 ; CHECK-NEXT: fmov d1, x0
203 ; CHECK-NEXT: ushl d0, d0, d1
206 %sub = sub nsw i64 0, %b
207 %splat.splatinsert = insertelement <1 x i64> poison, i64 %sub, i32 0
208 %shr = lshr <1 x i64> %a, %splat.splatinsert
212 define <2 x i32> @lshr32x2(<2 x i32> %a, i32 %b) {
213 ; CHECK-LABEL: lshr32x2:
214 ; CHECK: // %bb.0: // %entry
215 ; CHECK-NEXT: dup v1.2s, w0
216 ; CHECK-NEXT: ushl v0.2s, v0.2s, v1.2s
219 %sub = sub nsw i32 0, %b
220 %splat.splatinsert = insertelement <2 x i32> poison, i32 %sub, i32 0
221 %splat.splat = shufflevector <2 x i32> %splat.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
222 %shr = lshr <2 x i32> %a, %splat.splat
226 define <4 x i16> @lshr16x4(<4 x i16> %a, i16 %b) {
227 ; CHECK-LABEL: lshr16x4:
228 ; CHECK: // %bb.0: // %entry
229 ; CHECK-NEXT: dup v1.4h, w0
230 ; CHECK-NEXT: ushl v0.4h, v0.4h, v1.4h
234 %0 = insertelement <4 x i16> undef, i16 %sub, i32 0
235 %sh_prom = shufflevector <4 x i16> %0, <4 x i16> undef, <4 x i32> zeroinitializer
236 %shr = lshr <4 x i16> %a, %sh_prom
240 define <8 x i8> @lshr8x8(<8 x i8> %a, i8 %b) {
241 ; CHECK-LABEL: lshr8x8:
242 ; CHECK: // %bb.0: // %entry
243 ; CHECK-NEXT: dup v1.8b, w0
244 ; CHECK-NEXT: ushl v0.8b, v0.8b, v1.8b
248 %0 = insertelement <8 x i8> undef, i8 %sub, i32 0
249 %sh_prom = shufflevector <8 x i8> %0, <8 x i8> undef, <8 x i32> zeroinitializer
250 %shr = lshr <8 x i8> %a, %sh_prom
254 define <2 x i64> @shl64x2(<2 x i64> %a, i64 %b) {
255 ; CHECK-LABEL: shl64x2:
256 ; CHECK: // %bb.0: // %entry
257 ; CHECK-NEXT: neg x8, x0
258 ; CHECK-NEXT: dup v1.2d, x8
259 ; CHECK-NEXT: ushl v0.2d, v0.2d, v1.2d
262 %sub = sub nsw i64 0, %b
263 %splat.splatinsert = insertelement <2 x i64> poison, i64 %sub, i32 0
264 %splat.splat = shufflevector <2 x i64> %splat.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
265 %shl = shl <2 x i64> %a, %splat.splat
269 define <4 x i32> @shl32x4(<4 x i32> %a, i32 %b) {
270 ; CHECK-LABEL: shl32x4:
271 ; CHECK: // %bb.0: // %entry
272 ; CHECK-NEXT: neg w8, w0
273 ; CHECK-NEXT: dup v1.4s, w8
274 ; CHECK-NEXT: ushl v0.4s, v0.4s, v1.4s
277 %sub = sub nsw i32 0, %b
278 %splat.splatinsert = insertelement <4 x i32> poison, i32 %sub, i32 0
279 %splat.splat = shufflevector <4 x i32> %splat.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
280 %shl = shl <4 x i32> %a, %splat.splat
284 define <8 x i16> @shl16x8(<8 x i16> %a, i16 %b) {
285 ; CHECK-LABEL: shl16x8:
286 ; CHECK: // %bb.0: // %entry
287 ; CHECK-NEXT: neg w8, w0
288 ; CHECK-NEXT: dup v1.8h, w8
289 ; CHECK-NEXT: ushl v0.8h, v0.8h, v1.8h
293 %0 = insertelement <8 x i16> undef, i16 %sub, i32 0
294 %sh_prom = shufflevector <8 x i16> %0, <8 x i16> undef, <8 x i32> zeroinitializer
295 %shl = shl <8 x i16> %a, %sh_prom
299 define <16 x i8> @shl8x16(<16 x i8> %a, i8 %b) {
300 ; CHECK-LABEL: shl8x16:
301 ; CHECK: // %bb.0: // %entry
302 ; CHECK-NEXT: neg w8, w0
303 ; CHECK-NEXT: dup v1.16b, w8
304 ; CHECK-NEXT: ushl v0.16b, v0.16b, v1.16b
308 %0 = insertelement <16 x i8> undef, i8 %sub, i32 0
309 %sh_prom = shufflevector <16 x i8> %0, <16 x i8> undef, <16 x i32> zeroinitializer
310 %shl = shl <16 x i8> %a, %sh_prom
314 define <1 x i64> @shl64x1(<1 x i64> %a, i64 %b) {
315 ; CHECK-LABEL: shl64x1:
316 ; CHECK: // %bb.0: // %entry
317 ; CHECK-NEXT: neg x8, x0
318 ; CHECK-NEXT: fmov d1, x8
319 ; CHECK-NEXT: ushl d0, d0, d1
322 %sub = sub nsw i64 0, %b
323 %splat.splatinsert = insertelement <1 x i64> poison, i64 %sub, i32 0
324 %shl = shl <1 x i64> %a, %splat.splatinsert
328 define <2 x i32> @shl32x2(<2 x i32> %a, i32 %b) {
329 ; CHECK-LABEL: shl32x2:
330 ; CHECK: // %bb.0: // %entry
331 ; CHECK-NEXT: neg w8, w0
332 ; CHECK-NEXT: dup v1.2s, w8
333 ; CHECK-NEXT: ushl v0.2s, v0.2s, v1.2s
336 %sub = sub nsw i32 0, %b
337 %splat.splatinsert = insertelement <2 x i32> poison, i32 %sub, i32 0
338 %splat.splat = shufflevector <2 x i32> %splat.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
339 %shl = shl <2 x i32> %a, %splat.splat
343 define <4 x i16> @shl16x4(<4 x i16> %a, i16 %b) {
344 ; CHECK-LABEL: shl16x4:
345 ; CHECK: // %bb.0: // %entry
346 ; CHECK-NEXT: neg w8, w0
347 ; CHECK-NEXT: dup v1.4h, w8
348 ; CHECK-NEXT: ushl v0.4h, v0.4h, v1.4h
352 %0 = insertelement <4 x i16> undef, i16 %sub, i32 0
353 %sh_prom = shufflevector <4 x i16> %0, <4 x i16> undef, <4 x i32> zeroinitializer
354 %shl = shl <4 x i16> %a, %sh_prom
358 define <8 x i8> @shl8x8(<8 x i8> %a, i8 %b) {
359 ; CHECK-LABEL: shl8x8:
360 ; CHECK: // %bb.0: // %entry
361 ; CHECK-NEXT: neg w8, w0
362 ; CHECK-NEXT: dup v1.8b, w8
363 ; CHECK-NEXT: ushl v0.8b, v0.8b, v1.8b
367 %0 = insertelement <8 x i8> undef, i8 %sub, i32 0
368 %sh_prom = shufflevector <8 x i8> %0, <8 x i8> undef, <8 x i32> zeroinitializer
369 %shl = shl <8 x i8> %a, %sh_prom
375 define <vscale x 2 x i64> @shrn64x2(<vscale x 2 x i64> %a, i64 %b) {
376 ; CHECK-LABEL: shrn64x2:
377 ; CHECK: // %bb.0: // %entry
378 ; CHECK-NEXT: neg x8, x0
379 ; CHECK-NEXT: ptrue p0.d
380 ; CHECK-NEXT: mov z1.d, x8
381 ; CHECK-NEXT: asr z0.d, p0/m, z0.d, z1.d
384 %sub = sub nsw i64 0, %b
385 %splat.splatinsert = insertelement <vscale x 2 x i64> poison, i64 %sub, i32 0
386 %splat.splat = shufflevector <vscale x 2 x i64> %splat.splatinsert, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
387 %shr = ashr <vscale x 2 x i64> %a, %splat.splat
388 ret <vscale x 2 x i64> %shr
391 define <vscale x 4 x i32> @shrn32x4(<vscale x 4 x i32> %a, i32 %b) {
392 ; CHECK-LABEL: shrn32x4:
393 ; CHECK: // %bb.0: // %entry
394 ; CHECK-NEXT: neg w8, w0
395 ; CHECK-NEXT: ptrue p0.s
396 ; CHECK-NEXT: mov z1.s, w8
397 ; CHECK-NEXT: asr z0.s, p0/m, z0.s, z1.s
400 %sub = sub nsw i32 0, %b
401 %splat.splatinsert = insertelement <vscale x 4 x i32> poison, i32 %sub, i32 0
402 %splat.splat = shufflevector <vscale x 4 x i32> %splat.splatinsert, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
403 %shr = ashr <vscale x 4 x i32> %a, %splat.splat
404 ret <vscale x 4 x i32> %shr
407 define <vscale x 8 x i16> @shrn16x8(<vscale x 8 x i16> %a, i16 %b) {
408 ; CHECK-LABEL: shrn16x8:
409 ; CHECK: // %bb.0: // %entry
410 ; CHECK-NEXT: neg w8, w0
411 ; CHECK-NEXT: ptrue p0.h
412 ; CHECK-NEXT: mov z1.h, w8
413 ; CHECK-NEXT: asr z0.h, p0/m, z0.h, z1.h
417 %0 = insertelement <vscale x 8 x i16> undef, i16 %sub, i32 0
418 %sh_prom = shufflevector <vscale x 8 x i16> %0, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
419 %shr = ashr <vscale x 8 x i16> %a, %sh_prom
420 ret <vscale x 8 x i16> %shr
423 define <vscale x 16 x i8> @shrn8x16(<vscale x 16 x i8> %a, i8 %b) {
424 ; CHECK-LABEL: shrn8x16:
425 ; CHECK: // %bb.0: // %entry
426 ; CHECK-NEXT: neg w8, w0
427 ; CHECK-NEXT: ptrue p0.b
428 ; CHECK-NEXT: mov z1.b, w8
429 ; CHECK-NEXT: asr z0.b, p0/m, z0.b, z1.b
433 %0 = insertelement <vscale x 16 x i8> undef, i8 %sub, i32 0
434 %sh_prom = shufflevector <vscale x 16 x i8> %0, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
435 %shr = ashr <vscale x 16 x i8> %a, %sh_prom
436 ret <vscale x 16 x i8> %shr
439 define <vscale x 2 x i64> @lshrn64x2(<vscale x 2 x i64> %a, i64 %b) {
440 ; CHECK-LABEL: lshrn64x2:
441 ; CHECK: // %bb.0: // %entry
442 ; CHECK-NEXT: neg x8, x0
443 ; CHECK-NEXT: ptrue p0.d
444 ; CHECK-NEXT: mov z1.d, x8
445 ; CHECK-NEXT: lsr z0.d, p0/m, z0.d, z1.d
448 %sub = sub nsw i64 0, %b
449 %splat.splatinsert = insertelement <vscale x 2 x i64> poison, i64 %sub, i32 0
450 %splat.splat = shufflevector <vscale x 2 x i64> %splat.splatinsert, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
451 %shr = lshr <vscale x 2 x i64> %a, %splat.splat
452 ret <vscale x 2 x i64> %shr
455 define <vscale x 4 x i32> @lshrn32x4(<vscale x 4 x i32> %a, i32 %b) {
456 ; CHECK-LABEL: lshrn32x4:
457 ; CHECK: // %bb.0: // %entry
458 ; CHECK-NEXT: neg w8, w0
459 ; CHECK-NEXT: ptrue p0.s
460 ; CHECK-NEXT: mov z1.s, w8
461 ; CHECK-NEXT: lsr z0.s, p0/m, z0.s, z1.s
464 %sub = sub nsw i32 0, %b
465 %splat.splatinsert = insertelement <vscale x 4 x i32> poison, i32 %sub, i32 0
466 %splat.splat = shufflevector <vscale x 4 x i32> %splat.splatinsert, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
467 %shr = lshr <vscale x 4 x i32> %a, %splat.splat
468 ret <vscale x 4 x i32> %shr
471 define <vscale x 8 x i16> @lshrn16x8(<vscale x 8 x i16> %a, i16 %b) {
472 ; CHECK-LABEL: lshrn16x8:
473 ; CHECK: // %bb.0: // %entry
474 ; CHECK-NEXT: neg w8, w0
475 ; CHECK-NEXT: ptrue p0.h
476 ; CHECK-NEXT: mov z1.h, w8
477 ; CHECK-NEXT: lsr z0.h, p0/m, z0.h, z1.h
481 %0 = insertelement <vscale x 8 x i16> undef, i16 %sub, i32 0
482 %sh_prom = shufflevector <vscale x 8 x i16> %0, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
483 %shr = lshr <vscale x 8 x i16> %a, %sh_prom
484 ret <vscale x 8 x i16> %shr
487 define <vscale x 16 x i8> @lshrn8x16(<vscale x 16 x i8> %a, i8 %b) {
488 ; CHECK-LABEL: lshrn8x16:
489 ; CHECK: // %bb.0: // %entry
490 ; CHECK-NEXT: neg w8, w0
491 ; CHECK-NEXT: ptrue p0.b
492 ; CHECK-NEXT: mov z1.b, w8
493 ; CHECK-NEXT: lsr z0.b, p0/m, z0.b, z1.b
497 %0 = insertelement <vscale x 16 x i8> undef, i8 %sub, i32 0
498 %sh_prom = shufflevector <vscale x 16 x i8> %0, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
499 %shr = lshr <vscale x 16 x i8> %a, %sh_prom
500 ret <vscale x 16 x i8> %shr
503 define <vscale x 2 x i64> @shln64x2(<vscale x 2 x i64> %a, i64 %b) {
504 ; CHECK-LABEL: shln64x2:
505 ; CHECK: // %bb.0: // %entry
506 ; CHECK-NEXT: neg x8, x0
507 ; CHECK-NEXT: ptrue p0.d
508 ; CHECK-NEXT: mov z1.d, x8
509 ; CHECK-NEXT: lsl z0.d, p0/m, z0.d, z1.d
512 %sub = sub nsw i64 0, %b
513 %splat.splatinsert = insertelement <vscale x 2 x i64> poison, i64 %sub, i32 0
514 %splat.splat = shufflevector <vscale x 2 x i64> %splat.splatinsert, <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer
515 %shl = shl <vscale x 2 x i64> %a, %splat.splat
516 ret <vscale x 2 x i64> %shl
519 define <vscale x 4 x i32> @shln32x4(<vscale x 4 x i32> %a, i32 %b) {
520 ; CHECK-LABEL: shln32x4:
521 ; CHECK: // %bb.0: // %entry
522 ; CHECK-NEXT: neg w8, w0
523 ; CHECK-NEXT: ptrue p0.s
524 ; CHECK-NEXT: mov z1.s, w8
525 ; CHECK-NEXT: lsl z0.s, p0/m, z0.s, z1.s
528 %sub = sub nsw i32 0, %b
529 %splat.splatinsert = insertelement <vscale x 4 x i32> poison, i32 %sub, i32 0
530 %splat.splat = shufflevector <vscale x 4 x i32> %splat.splatinsert, <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
531 %shl = shl <vscale x 4 x i32> %a, %splat.splat
532 ret <vscale x 4 x i32> %shl
535 define <vscale x 8 x i16> @shln16x8(<vscale x 8 x i16> %a, i16 %b) {
536 ; CHECK-LABEL: shln16x8:
537 ; CHECK: // %bb.0: // %entry
538 ; CHECK-NEXT: neg w8, w0
539 ; CHECK-NEXT: ptrue p0.h
540 ; CHECK-NEXT: mov z1.h, w8
541 ; CHECK-NEXT: lsl z0.h, p0/m, z0.h, z1.h
545 %0 = insertelement <vscale x 8 x i16> undef, i16 %sub, i32 0
546 %sh_prom = shufflevector <vscale x 8 x i16> %0, <vscale x 8 x i16> undef, <vscale x 8 x i32> zeroinitializer
547 %shl = shl <vscale x 8 x i16> %a, %sh_prom
548 ret <vscale x 8 x i16> %shl
551 define <vscale x 16 x i8> @shln8x16(<vscale x 16 x i8> %a, i8 %b) {
552 ; CHECK-LABEL: shln8x16:
553 ; CHECK: // %bb.0: // %entry
554 ; CHECK-NEXT: neg w8, w0
555 ; CHECK-NEXT: ptrue p0.b
556 ; CHECK-NEXT: mov z1.b, w8
557 ; CHECK-NEXT: lsl z0.b, p0/m, z0.b, z1.b
561 %0 = insertelement <vscale x 16 x i8> undef, i8 %sub, i32 0
562 %sh_prom = shufflevector <vscale x 16 x i8> %0, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
563 %shl = shl <vscale x 16 x i8> %a, %sh_prom
564 ret <vscale x 16 x i8> %shl
567 define <vscale x 16 x i8> @subsub(<vscale x 16 x i8> %a, i8 %b) {
568 ; CHECK-LABEL: subsub:
569 ; CHECK: // %bb.0: // %entry
570 ; CHECK-NEXT: mov z0.b, w0
574 %0 = insertelement <vscale x 16 x i8> undef, i8 %sub, i32 0
575 %sh_prom = shufflevector <vscale x 16 x i8> %0, <vscale x 16 x i8> undef, <vscale x 16 x i32> zeroinitializer
576 %sub2 = sub <vscale x 16 x i8> zeroinitializer, %sh_prom
577 ret <vscale x 16 x i8> %sub2