1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon -global-isel | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 define <8 x i16> @test_sshll_v8i8(<8 x i8> %a) {
6 ; CHECK-LABEL: test_sshll_v8i8:
8 ; CHECK-NEXT: sshll v0.8h, v0.8b, #3
10 %1 = sext <8 x i8> %a to <8 x i16>
11 %tmp = shl <8 x i16> %1, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
15 define <8 x i16> @test_sshll_v8i8_big(<8 x i8> %a) {
16 ; CHECK-SD-LABEL: test_sshll_v8i8_big:
18 ; CHECK-SD-NEXT: ushll v0.8h, v0.8b, #0
19 ; CHECK-SD-NEXT: shl v0.8h, v0.8h, #9
22 ; CHECK-GI-LABEL: test_sshll_v8i8_big:
24 ; CHECK-GI-NEXT: sshll v0.8h, v0.8b, #0
25 ; CHECK-GI-NEXT: shl v0.8h, v0.8h, #9
27 %1 = sext <8 x i8> %a to <8 x i16>
28 %tmp = shl <8 x i16> %1, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
32 define <4 x i32> @test_sshll_v4i16(<4 x i16> %a) {
33 ; CHECK-LABEL: test_sshll_v4i16:
35 ; CHECK-NEXT: sshll v0.4s, v0.4h, #9
37 %1 = sext <4 x i16> %a to <4 x i32>
38 %tmp = shl <4 x i32> %1, <i32 9, i32 9, i32 9, i32 9>
42 define <4 x i32> @test_sshll_v4i16_big(<4 x i16> %a) {
43 ; CHECK-SD-LABEL: test_sshll_v4i16_big:
45 ; CHECK-SD-NEXT: ushll v0.4s, v0.4h, #0
46 ; CHECK-SD-NEXT: shl v0.4s, v0.4s, #19
49 ; CHECK-GI-LABEL: test_sshll_v4i16_big:
51 ; CHECK-GI-NEXT: sshll v0.4s, v0.4h, #0
52 ; CHECK-GI-NEXT: shl v0.4s, v0.4s, #19
54 %1 = sext <4 x i16> %a to <4 x i32>
55 %tmp = shl <4 x i32> %1, <i32 19, i32 19, i32 19, i32 19>
59 define <2 x i64> @test_sshll_v2i32(<2 x i32> %a) {
60 ; CHECK-LABEL: test_sshll_v2i32:
62 ; CHECK-NEXT: sshll v0.2d, v0.2s, #19
64 %1 = sext <2 x i32> %a to <2 x i64>
65 %tmp = shl <2 x i64> %1, <i64 19, i64 19>
69 define <2 x i64> @test_sshll_v2i32_big(<2 x i32> %a) {
70 ; CHECK-SD-LABEL: test_sshll_v2i32_big:
72 ; CHECK-SD-NEXT: ushll v0.2d, v0.2s, #0
73 ; CHECK-SD-NEXT: shl v0.2d, v0.2d, #36
76 ; CHECK-GI-LABEL: test_sshll_v2i32_big:
78 ; CHECK-GI-NEXT: sshll v0.2d, v0.2s, #0
79 ; CHECK-GI-NEXT: shl v0.2d, v0.2d, #36
81 %1 = sext <2 x i32> %a to <2 x i64>
82 %tmp = shl <2 x i64> %1, <i64 36, i64 36>
86 define <8 x i16> @test_ushll_v8i8(<8 x i8> %a) {
87 ; CHECK-LABEL: test_ushll_v8i8:
89 ; CHECK-NEXT: ushll v0.8h, v0.8b, #3
91 %1 = zext <8 x i8> %a to <8 x i16>
92 %tmp = shl <8 x i16> %1, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
96 define <8 x i16> @test_ushll_v8i8_big(<8 x i8> %a) {
97 ; CHECK-LABEL: test_ushll_v8i8_big:
99 ; CHECK-NEXT: ushll v0.8h, v0.8b, #0
100 ; CHECK-NEXT: shl v0.8h, v0.8h, #9
102 %1 = zext <8 x i8> %a to <8 x i16>
103 %tmp = shl <8 x i16> %1, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
107 define <4 x i32> @test_ushll_v4i16(<4 x i16> %a) {
108 ; CHECK-LABEL: test_ushll_v4i16:
110 ; CHECK-NEXT: ushll v0.4s, v0.4h, #9
112 %1 = zext <4 x i16> %a to <4 x i32>
113 %tmp = shl <4 x i32> %1, <i32 9, i32 9, i32 9, i32 9>
117 define <4 x i32> @test_ushll_v4i16_big(<4 x i16> %a) {
118 ; CHECK-LABEL: test_ushll_v4i16_big:
120 ; CHECK-NEXT: ushll v0.4s, v0.4h, #0
121 ; CHECK-NEXT: shl v0.4s, v0.4s, #19
123 %1 = zext <4 x i16> %a to <4 x i32>
124 %tmp = shl <4 x i32> %1, <i32 19, i32 19, i32 19, i32 19>
128 define <2 x i64> @test_ushll_v2i32(<2 x i32> %a) {
129 ; CHECK-LABEL: test_ushll_v2i32:
131 ; CHECK-NEXT: ushll v0.2d, v0.2s, #19
133 %1 = zext <2 x i32> %a to <2 x i64>
134 %tmp = shl <2 x i64> %1, <i64 19, i64 19>
138 define <2 x i64> @test_ushll_v2i32_big(<2 x i32> %a) {
139 ; CHECK-LABEL: test_ushll_v2i32_big:
141 ; CHECK-NEXT: ushll v0.2d, v0.2s, #0
142 ; CHECK-NEXT: shl v0.2d, v0.2d, #36
144 %1 = zext <2 x i32> %a to <2 x i64>
145 %tmp = shl <2 x i64> %1, <i64 36, i64 36>
149 define <8 x i16> @test_sshll2_v16i8(<16 x i8> %a) {
150 ; CHECK-SD-LABEL: test_sshll2_v16i8:
151 ; CHECK-SD: // %bb.0:
152 ; CHECK-SD-NEXT: sshll2 v0.8h, v0.16b, #3
155 ; CHECK-GI-LABEL: test_sshll2_v16i8:
156 ; CHECK-GI: // %bb.0:
157 ; CHECK-GI-NEXT: mov d0, v0.d[1]
158 ; CHECK-GI-NEXT: sshll v0.8h, v0.8b, #3
160 %1 = shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
161 %2 = sext <8 x i8> %1 to <8 x i16>
162 %tmp = shl <8 x i16> %2, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
166 define <8 x i16> @test_sshll2_v16i8_big(<16 x i8> %a) {
167 ; CHECK-SD-LABEL: test_sshll2_v16i8_big:
168 ; CHECK-SD: // %bb.0:
169 ; CHECK-SD-NEXT: ushll2 v0.8h, v0.16b, #0
170 ; CHECK-SD-NEXT: shl v0.8h, v0.8h, #9
173 ; CHECK-GI-LABEL: test_sshll2_v16i8_big:
174 ; CHECK-GI: // %bb.0:
175 ; CHECK-GI-NEXT: sshll2 v0.8h, v0.16b, #0
176 ; CHECK-GI-NEXT: shl v0.8h, v0.8h, #9
178 %1 = shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
179 %2 = sext <8 x i8> %1 to <8 x i16>
180 %tmp = shl <8 x i16> %2, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
184 define <4 x i32> @test_sshll2_v8i16(<8 x i16> %a) {
185 ; CHECK-SD-LABEL: test_sshll2_v8i16:
186 ; CHECK-SD: // %bb.0:
187 ; CHECK-SD-NEXT: sshll2 v0.4s, v0.8h, #9
190 ; CHECK-GI-LABEL: test_sshll2_v8i16:
191 ; CHECK-GI: // %bb.0:
192 ; CHECK-GI-NEXT: mov d0, v0.d[1]
193 ; CHECK-GI-NEXT: sshll v0.4s, v0.4h, #9
195 %1 = shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
196 %2 = sext <4 x i16> %1 to <4 x i32>
197 %tmp = shl <4 x i32> %2, <i32 9, i32 9, i32 9, i32 9>
201 define <4 x i32> @test_sshll2_v8i16_big(<8 x i16> %a) {
202 ; CHECK-SD-LABEL: test_sshll2_v8i16_big:
203 ; CHECK-SD: // %bb.0:
204 ; CHECK-SD-NEXT: ushll2 v0.4s, v0.8h, #0
205 ; CHECK-SD-NEXT: shl v0.4s, v0.4s, #19
208 ; CHECK-GI-LABEL: test_sshll2_v8i16_big:
209 ; CHECK-GI: // %bb.0:
210 ; CHECK-GI-NEXT: sshll2 v0.4s, v0.8h, #0
211 ; CHECK-GI-NEXT: shl v0.4s, v0.4s, #19
213 %1 = shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
214 %2 = sext <4 x i16> %1 to <4 x i32>
215 %tmp = shl <4 x i32> %2, <i32 19, i32 19, i32 19, i32 19>
219 define <2 x i64> @test_sshll2_v4i32(<4 x i32> %a) {
220 ; CHECK-SD-LABEL: test_sshll2_v4i32:
221 ; CHECK-SD: // %bb.0:
222 ; CHECK-SD-NEXT: sshll2 v0.2d, v0.4s, #19
225 ; CHECK-GI-LABEL: test_sshll2_v4i32:
226 ; CHECK-GI: // %bb.0:
227 ; CHECK-GI-NEXT: mov d0, v0.d[1]
228 ; CHECK-GI-NEXT: sshll v0.2d, v0.2s, #19
230 %1 = shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 2, i32 3>
231 %2 = sext <2 x i32> %1 to <2 x i64>
232 %tmp = shl <2 x i64> %2, <i64 19, i64 19>
236 define <2 x i64> @test_sshll2_v4i32_big(<4 x i32> %a) {
237 ; CHECK-SD-LABEL: test_sshll2_v4i32_big:
238 ; CHECK-SD: // %bb.0:
239 ; CHECK-SD-NEXT: ushll2 v0.2d, v0.4s, #0
240 ; CHECK-SD-NEXT: shl v0.2d, v0.2d, #36
243 ; CHECK-GI-LABEL: test_sshll2_v4i32_big:
244 ; CHECK-GI: // %bb.0:
245 ; CHECK-GI-NEXT: sshll2 v0.2d, v0.4s, #0
246 ; CHECK-GI-NEXT: shl v0.2d, v0.2d, #36
248 %1 = shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 2, i32 3>
249 %2 = sext <2 x i32> %1 to <2 x i64>
250 %tmp = shl <2 x i64> %2, <i64 36, i64 36>
254 define <8 x i16> @test_ushll2_v16i8(<16 x i8> %a) {
255 ; CHECK-SD-LABEL: test_ushll2_v16i8:
256 ; CHECK-SD: // %bb.0:
257 ; CHECK-SD-NEXT: ushll2 v0.8h, v0.16b, #3
260 ; CHECK-GI-LABEL: test_ushll2_v16i8:
261 ; CHECK-GI: // %bb.0:
262 ; CHECK-GI-NEXT: mov d0, v0.d[1]
263 ; CHECK-GI-NEXT: ushll v0.8h, v0.8b, #3
265 %1 = shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
266 %2 = zext <8 x i8> %1 to <8 x i16>
267 %tmp = shl <8 x i16> %2, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
271 define <8 x i16> @test_ushll2_v16i8_big(<16 x i8> %a) {
272 ; CHECK-LABEL: test_ushll2_v16i8_big:
274 ; CHECK-NEXT: ushll2 v0.8h, v0.16b, #0
275 ; CHECK-NEXT: shl v0.8h, v0.8h, #9
277 %1 = shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
278 %2 = zext <8 x i8> %1 to <8 x i16>
279 %tmp = shl <8 x i16> %2, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
283 define <4 x i32> @test_ushll2_v8i16(<8 x i16> %a) {
284 ; CHECK-SD-LABEL: test_ushll2_v8i16:
285 ; CHECK-SD: // %bb.0:
286 ; CHECK-SD-NEXT: ushll2 v0.4s, v0.8h, #9
289 ; CHECK-GI-LABEL: test_ushll2_v8i16:
290 ; CHECK-GI: // %bb.0:
291 ; CHECK-GI-NEXT: mov d0, v0.d[1]
292 ; CHECK-GI-NEXT: ushll v0.4s, v0.4h, #9
294 %1 = shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
295 %2 = zext <4 x i16> %1 to <4 x i32>
296 %tmp = shl <4 x i32> %2, <i32 9, i32 9, i32 9, i32 9>
300 define <4 x i32> @test_ushll2_v8i16_big(<8 x i16> %a) {
301 ; CHECK-LABEL: test_ushll2_v8i16_big:
303 ; CHECK-NEXT: ushll2 v0.4s, v0.8h, #0
304 ; CHECK-NEXT: shl v0.4s, v0.4s, #19
306 %1 = shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
307 %2 = zext <4 x i16> %1 to <4 x i32>
308 %tmp = shl <4 x i32> %2, <i32 19, i32 19, i32 19, i32 19>
312 define <2 x i64> @test_ushll2_v4i32(<4 x i32> %a) {
313 ; CHECK-SD-LABEL: test_ushll2_v4i32:
314 ; CHECK-SD: // %bb.0:
315 ; CHECK-SD-NEXT: ushll2 v0.2d, v0.4s, #19
318 ; CHECK-GI-LABEL: test_ushll2_v4i32:
319 ; CHECK-GI: // %bb.0:
320 ; CHECK-GI-NEXT: mov d0, v0.d[1]
321 ; CHECK-GI-NEXT: ushll v0.2d, v0.2s, #19
323 %1 = shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 2, i32 3>
324 %2 = zext <2 x i32> %1 to <2 x i64>
325 %tmp = shl <2 x i64> %2, <i64 19, i64 19>
329 define <2 x i64> @test_ushll2_v4i32_big(<4 x i32> %a) {
330 ; CHECK-LABEL: test_ushll2_v4i32_big:
332 ; CHECK-NEXT: ushll2 v0.2d, v0.4s, #0
333 ; CHECK-NEXT: shl v0.2d, v0.2d, #36
335 %1 = shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 2, i32 3>
336 %2 = zext <2 x i32> %1 to <2 x i64>
337 %tmp = shl <2 x i64> %2, <i64 36, i64 36>
341 define <8 x i16> @test_sshll_shl0_v8i8(<8 x i8> %a) {
342 ; CHECK-LABEL: test_sshll_shl0_v8i8:
344 ; CHECK-NEXT: sshll v0.8h, v0.8b, #0
346 %tmp = sext <8 x i8> %a to <8 x i16>
350 define <4 x i32> @test_sshll_shl0_v4i16(<4 x i16> %a) {
351 ; CHECK-LABEL: test_sshll_shl0_v4i16:
353 ; CHECK-NEXT: sshll v0.4s, v0.4h, #0
355 %tmp = sext <4 x i16> %a to <4 x i32>
359 define <2 x i64> @test_sshll_shl0_v2i32(<2 x i32> %a) {
360 ; CHECK-LABEL: test_sshll_shl0_v2i32:
362 ; CHECK-NEXT: sshll v0.2d, v0.2s, #0
364 %tmp = sext <2 x i32> %a to <2 x i64>
368 define <8 x i16> @test_ushll_shl0_v8i8(<8 x i8> %a) {
369 ; CHECK-LABEL: test_ushll_shl0_v8i8:
371 ; CHECK-NEXT: ushll v0.8h, v0.8b, #0
373 %tmp = zext <8 x i8> %a to <8 x i16>
377 define <4 x i32> @test_ushll_shl0_v4i16(<4 x i16> %a) {
378 ; CHECK-LABEL: test_ushll_shl0_v4i16:
380 ; CHECK-NEXT: ushll v0.4s, v0.4h, #0
382 %tmp = zext <4 x i16> %a to <4 x i32>
386 define <2 x i64> @test_ushll_shl0_v2i32(<2 x i32> %a) {
387 ; CHECK-LABEL: test_ushll_shl0_v2i32:
389 ; CHECK-NEXT: ushll v0.2d, v0.2s, #0
391 %tmp = zext <2 x i32> %a to <2 x i64>
395 define <8 x i16> @test_sshll2_shl0_v16i8(<16 x i8> %a) {
396 ; CHECK-LABEL: test_sshll2_shl0_v16i8:
398 ; CHECK-NEXT: sshll2 v0.8h, v0.16b, #0
400 %1 = shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
401 %tmp = sext <8 x i8> %1 to <8 x i16>
405 define <4 x i32> @test_sshll2_shl0_v8i16(<8 x i16> %a) {
406 ; CHECK-LABEL: test_sshll2_shl0_v8i16:
408 ; CHECK-NEXT: sshll2 v0.4s, v0.8h, #0
410 %1 = shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
411 %tmp = sext <4 x i16> %1 to <4 x i32>
415 define <2 x i64> @test_sshll2_shl0_v4i32(<4 x i32> %a) {
416 ; CHECK-LABEL: test_sshll2_shl0_v4i32:
418 ; CHECK-NEXT: sshll2 v0.2d, v0.4s, #0
420 %1 = shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 2, i32 3>
421 %tmp = sext <2 x i32> %1 to <2 x i64>
425 define <8 x i16> @test_ushll2_shl0_v16i8(<16 x i8> %a) {
426 ; CHECK-LABEL: test_ushll2_shl0_v16i8:
428 ; CHECK-NEXT: ushll2 v0.8h, v0.16b, #0
430 %1 = shufflevector <16 x i8> %a, <16 x i8> undef, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
431 %tmp = zext <8 x i8> %1 to <8 x i16>
435 define <4 x i32> @test_ushll2_shl0_v8i16(<8 x i16> %a) {
436 ; CHECK-LABEL: test_ushll2_shl0_v8i16:
438 ; CHECK-NEXT: ushll2 v0.4s, v0.8h, #0
440 %1 = shufflevector <8 x i16> %a, <8 x i16> undef, <4 x i32> <i32 4, i32 5, i32 6, i32 7>
441 %tmp = zext <4 x i16> %1 to <4 x i32>
445 define <2 x i64> @test_ushll2_shl0_v4i32(<4 x i32> %a) {
446 ; CHECK-LABEL: test_ushll2_shl0_v4i32:
448 ; CHECK-NEXT: ushll2 v0.2d, v0.4s, #0
450 %1 = shufflevector <4 x i32> %a, <4 x i32> undef, <2 x i32> <i32 2, i32 3>
451 %tmp = zext <2 x i32> %1 to <2 x i64>
455 define <8 x i16> @test_ushll_cmp(<8 x i8> %a, <8 x i8> %b) #0 {
456 ; CHECK-SD-LABEL: test_ushll_cmp:
457 ; CHECK-SD: // %bb.0:
458 ; CHECK-SD-NEXT: cmeq v0.8b, v0.8b, v1.8b
459 ; CHECK-SD-NEXT: ushll v0.8h, v0.8b, #0
462 ; CHECK-GI-LABEL: test_ushll_cmp:
463 ; CHECK-GI: // %bb.0:
464 ; CHECK-GI-NEXT: cmeq v0.8b, v0.8b, v1.8b
465 ; CHECK-GI-NEXT: movi v1.2d, #0xff00ff00ff00ff
466 ; CHECK-GI-NEXT: ushll v0.8h, v0.8b, #0
467 ; CHECK-GI-NEXT: shl v0.8h, v0.8h, #15
468 ; CHECK-GI-NEXT: sshr v0.8h, v0.8h, #15
469 ; CHECK-GI-NEXT: and v0.16b, v0.16b, v1.16b
471 %cmp.i = icmp eq <8 x i8> %a, %b
472 %vcgtz.i.i = sext <8 x i1> %cmp.i to <8 x i8>
473 %vmovl.i.i.i = zext <8 x i8> %vcgtz.i.i to <8 x i16>
474 ret <8 x i16> %vmovl.i.i.i