1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 define void @anyext_s64_from_s32() { ret void }
8 define void @anyext_s32_from_s8() { ret void }
9 define void @anyext_v8s16_from_v8s8() { ret void }
10 define void @anyext_v4s32_from_v4s16() { ret void }
11 define void @anyext_v2s64_from_v2s32() { ret void }
13 define void @zext_s64_from_s32() { ret void }
14 define void @zext_s32_from_s16() { ret void }
15 define void @zext_s32_from_s8() { ret void }
16 define void @zext_s16_from_s8() { ret void }
17 define void @zext_v8s16_from_v8s8() { ret void }
18 define void @zext_v4s32_from_v4s16() { ret void }
19 define void @zext_v2s64_from_v2s32() { ret void }
21 define void @sext_s64_from_s32() { ret void }
22 define void @sext_s32_from_s16() { ret void }
23 define void @sext_s32_from_s8() { ret void }
24 define void @sext_s16_from_s8() { ret void }
25 define void @sext_v8s16_from_v8s8() { ret void }
26 define void @sext_v4s32_from_v4s16() { ret void }
27 define void @sext_v2s64_from_v2s32() { ret void }
31 name: anyext_s64_from_s32
36 - { id: 0, class: gpr }
37 - { id: 1, class: gpr }
43 ; CHECK-LABEL: name: anyext_s64_from_s32
44 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
45 ; CHECK: [[DEF:%[0-9]+]]:gpr64all = IMPLICIT_DEF
46 ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:gpr64all = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.sub_32
47 ; CHECK: $x0 = COPY [[INSERT_SUBREG]]
54 name: anyext_s32_from_s8
59 - { id: 0, class: gpr }
60 - { id: 1, class: gpr }
66 ; CHECK-LABEL: name: anyext_s32_from_s8
67 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
68 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[COPY]]
69 ; CHECK: $w0 = COPY [[COPY1]]
70 %2:gpr(s32) = COPY $w0
77 name: anyext_v8s16_from_v8s8
81 tracksRegLiveness: true
83 - { id: 0, class: fpr }
84 - { id: 1, class: fpr }
85 machineFunctionInfo: {}
90 ; CHECK-LABEL: name: anyext_v8s16_from_v8s8
92 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
93 ; CHECK: [[USHLLv8i8_shift:%[0-9]+]]:fpr128 = USHLLv8i8_shift [[COPY]], 0
94 ; CHECK: $q0 = COPY [[USHLLv8i8_shift]]
95 ; CHECK: RET_ReallyLR implicit $q0
96 %0:fpr(<8 x s8>) = COPY $d0
97 %1:fpr(<8 x s16>) = G_ANYEXT %0(<8 x s8>)
98 $q0 = COPY %1(<8 x s16>)
99 RET_ReallyLR implicit $q0
103 name: anyext_v4s32_from_v4s16
106 regBankSelected: true
107 tracksRegLiveness: true
109 - { id: 0, class: fpr }
110 - { id: 1, class: fpr }
111 machineFunctionInfo: {}
116 ; CHECK-LABEL: name: anyext_v4s32_from_v4s16
117 ; CHECK: liveins: $d0
118 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
119 ; CHECK: [[USHLLv4i16_shift:%[0-9]+]]:fpr128 = USHLLv4i16_shift [[COPY]], 0
120 ; CHECK: $q0 = COPY [[USHLLv4i16_shift]]
121 ; CHECK: RET_ReallyLR implicit $q0
122 %0:fpr(<4 x s16>) = COPY $d0
123 %1:fpr(<4 x s32>) = G_ANYEXT %0(<4 x s16>)
124 $q0 = COPY %1(<4 x s32>)
125 RET_ReallyLR implicit $q0
129 name: anyext_v2s64_from_v2s32
132 regBankSelected: true
133 tracksRegLiveness: true
135 - { id: 0, class: fpr }
136 - { id: 1, class: fpr }
137 machineFunctionInfo: {}
142 ; CHECK-LABEL: name: anyext_v2s64_from_v2s32
143 ; CHECK: liveins: $d0
144 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
145 ; CHECK: [[USHLLv2i32_shift:%[0-9]+]]:fpr128 = USHLLv2i32_shift [[COPY]], 0
146 ; CHECK: $q0 = COPY [[USHLLv2i32_shift]]
147 ; CHECK: RET_ReallyLR implicit $q0
148 %0:fpr(<2 x s32>) = COPY $d0
149 %1:fpr(<2 x s64>) = G_ANYEXT %0(<2 x s32>)
150 $q0 = COPY %1(<2 x s64>)
151 RET_ReallyLR implicit $q0
155 name: zext_s64_from_s32
157 regBankSelected: true
160 - { id: 0, class: gpr }
161 - { id: 1, class: gpr }
167 ; CHECK-LABEL: name: zext_s64_from_s32
168 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
169 ; CHECK: [[ORRWrs:%[0-9]+]]:gpr32 = ORRWrs $wzr, [[COPY]], 0
170 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64 = SUBREG_TO_REG 0, [[ORRWrs]], %subreg.sub_32
171 ; CHECK: $x0 = COPY [[SUBREG_TO_REG]]
178 name: zext_s32_from_s16
180 regBankSelected: true
183 - { id: 0, class: gpr }
184 - { id: 1, class: gpr }
190 ; CHECK-LABEL: name: zext_s32_from_s16
191 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
192 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 0, 15
193 ; CHECK: $w0 = COPY [[UBFMWri]]
194 %2:gpr(s32) = COPY $w0
201 name: zext_s32_from_s8
203 regBankSelected: true
206 - { id: 0, class: gpr }
207 - { id: 1, class: gpr }
213 ; CHECK-LABEL: name: zext_s32_from_s8
214 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
215 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 0, 15
216 ; CHECK: $w0 = COPY [[UBFMWri]]
217 %2:gpr(s32) = COPY $w0
224 name: zext_s16_from_s8
226 regBankSelected: true
229 - { id: 0, class: gpr }
230 - { id: 1, class: gpr }
236 ; CHECK-LABEL: name: zext_s16_from_s8
237 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
238 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 0, 7
239 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[UBFMWri]]
240 ; CHECK: $w0 = COPY [[COPY1]]
241 %2:gpr(s32) = COPY $w0
244 %3:gpr(s32) = G_ANYEXT %1
249 name: zext_v8s16_from_v8s8
252 regBankSelected: true
253 tracksRegLiveness: true
255 - { id: 0, class: fpr }
256 - { id: 1, class: fpr }
257 machineFunctionInfo: {}
262 ; CHECK-LABEL: name: zext_v8s16_from_v8s8
263 ; CHECK: liveins: $d0
264 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
265 ; CHECK: [[USHLLv8i8_shift:%[0-9]+]]:fpr128 = USHLLv8i8_shift [[COPY]], 0
266 ; CHECK: $q0 = COPY [[USHLLv8i8_shift]]
267 ; CHECK: RET_ReallyLR implicit $q0
268 %0:fpr(<8 x s8>) = COPY $d0
269 %1:fpr(<8 x s16>) = G_ZEXT %0(<8 x s8>)
270 $q0 = COPY %1(<8 x s16>)
271 RET_ReallyLR implicit $q0
276 name: zext_v4s32_from_v4s16
279 regBankSelected: true
280 tracksRegLiveness: true
282 - { id: 0, class: fpr }
283 - { id: 1, class: fpr }
284 machineFunctionInfo: {}
289 ; CHECK-LABEL: name: zext_v4s32_from_v4s16
290 ; CHECK: liveins: $d0
291 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
292 ; CHECK: [[USHLLv4i16_shift:%[0-9]+]]:fpr128 = USHLLv4i16_shift [[COPY]], 0
293 ; CHECK: $q0 = COPY [[USHLLv4i16_shift]]
294 ; CHECK: RET_ReallyLR implicit $q0
295 %0:fpr(<4 x s16>) = COPY $d0
296 %1:fpr(<4 x s32>) = G_ZEXT %0(<4 x s16>)
297 $q0 = COPY %1(<4 x s32>)
298 RET_ReallyLR implicit $q0
302 name: zext_v2s64_from_v2s32
305 regBankSelected: true
306 tracksRegLiveness: true
308 - { id: 0, class: fpr }
309 - { id: 1, class: fpr }
310 machineFunctionInfo: {}
315 ; CHECK-LABEL: name: zext_v2s64_from_v2s32
316 ; CHECK: liveins: $d0
317 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
318 ; CHECK: [[USHLLv2i32_shift:%[0-9]+]]:fpr128 = USHLLv2i32_shift [[COPY]], 0
319 ; CHECK: $q0 = COPY [[USHLLv2i32_shift]]
320 ; CHECK: RET_ReallyLR implicit $q0
321 %0:fpr(<2 x s32>) = COPY $d0
322 %1:fpr(<2 x s64>) = G_ZEXT %0(<2 x s32>)
323 $q0 = COPY %1(<2 x s64>)
324 RET_ReallyLR implicit $q0
328 name: sext_s64_from_s32
330 regBankSelected: true
333 - { id: 0, class: gpr }
334 - { id: 1, class: gpr }
340 ; CHECK-LABEL: name: sext_s64_from_s32
341 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
342 ; CHECK: [[DEF:%[0-9]+]]:gpr64all = IMPLICIT_DEF
343 ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:gpr64 = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.sub_32
344 ; CHECK: [[SBFMXri:%[0-9]+]]:gpr64 = SBFMXri [[INSERT_SUBREG]], 0, 31
345 ; CHECK: $x0 = COPY [[SBFMXri]]
352 name: sext_s32_from_s16
354 regBankSelected: true
357 - { id: 0, class: gpr }
358 - { id: 1, class: gpr }
364 ; CHECK-LABEL: name: sext_s32_from_s16
365 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
366 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 0, 15
367 ; CHECK: $w0 = COPY [[SBFMWri]]
368 %2:gpr(s32) = COPY $w0
375 name: sext_s32_from_s8
377 regBankSelected: true
380 - { id: 0, class: gpr }
381 - { id: 1, class: gpr }
387 ; CHECK-LABEL: name: sext_s32_from_s8
388 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
389 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 0, 7
390 ; CHECK: $w0 = COPY [[SBFMWri]]
391 %2:gpr(s32) = COPY $w0
398 name: sext_s16_from_s8
400 regBankSelected: true
403 - { id: 0, class: gpr }
404 - { id: 1, class: gpr }
410 ; CHECK-LABEL: name: sext_s16_from_s8
411 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
412 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 0, 7
413 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[SBFMWri]]
414 ; CHECK: $w0 = COPY [[COPY1]]
415 %2:gpr(s32) = COPY $w0
418 %3:gpr(s32) = G_ANYEXT %1
423 name: sext_v8s16_from_v8s8
426 regBankSelected: true
427 tracksRegLiveness: true
429 - { id: 0, class: fpr }
430 - { id: 1, class: fpr }
431 machineFunctionInfo: {}
436 ; CHECK-LABEL: name: sext_v8s16_from_v8s8
437 ; CHECK: liveins: $d0
438 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
439 ; CHECK: [[SSHLLv8i8_shift:%[0-9]+]]:fpr128 = SSHLLv8i8_shift [[COPY]], 0
440 ; CHECK: $q0 = COPY [[SSHLLv8i8_shift]]
441 ; CHECK: RET_ReallyLR implicit $q0
442 %0:fpr(<8 x s8>) = COPY $d0
443 %1:fpr(<8 x s16>) = G_SEXT %0(<8 x s8>)
444 $q0 = COPY %1(<8 x s16>)
445 RET_ReallyLR implicit $q0
450 name: sext_v4s32_from_v4s16
453 regBankSelected: true
454 tracksRegLiveness: true
456 - { id: 0, class: fpr }
457 - { id: 1, class: fpr }
458 machineFunctionInfo: {}
463 ; CHECK-LABEL: name: sext_v4s32_from_v4s16
464 ; CHECK: liveins: $d0
465 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
466 ; CHECK: [[SSHLLv4i16_shift:%[0-9]+]]:fpr128 = SSHLLv4i16_shift [[COPY]], 0
467 ; CHECK: $q0 = COPY [[SSHLLv4i16_shift]]
468 ; CHECK: RET_ReallyLR implicit $q0
469 %0:fpr(<4 x s16>) = COPY $d0
470 %1:fpr(<4 x s32>) = G_SEXT %0(<4 x s16>)
471 $q0 = COPY %1(<4 x s32>)
472 RET_ReallyLR implicit $q0
476 name: sext_v2s64_from_v2s32
479 regBankSelected: true
480 tracksRegLiveness: true
482 - { id: 0, class: fpr }
483 - { id: 1, class: fpr }
484 machineFunctionInfo: {}
489 ; CHECK-LABEL: name: sext_v2s64_from_v2s32
490 ; CHECK: liveins: $d0
491 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
492 ; CHECK: [[SSHLLv2i32_shift:%[0-9]+]]:fpr128 = SSHLLv2i32_shift [[COPY]], 0
493 ; CHECK: $q0 = COPY [[SSHLLv2i32_shift]]
494 ; CHECK: RET_ReallyLR implicit $q0
495 %0:fpr(<2 x s32>) = COPY $d0
496 %1:fpr(<2 x s64>) = G_SEXT %0(<2 x s32>)
497 $q0 = COPY %1(<2 x s64>)
498 RET_ReallyLR implicit $q0