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
131 tracksRegLiveness: true
133 regBankSelected: true
134 tracksRegLiveness: true
136 - { id: 0, class: fpr }
137 - { id: 1, class: fpr }
138 machineFunctionInfo: {}
143 ; CHECK-LABEL: name: anyext_v2s64_from_v2s32
144 ; CHECK: liveins: $d0
145 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
146 ; CHECK: [[USHLLv2i32_shift:%[0-9]+]]:fpr128 = USHLLv2i32_shift [[COPY]], 0
147 ; CHECK: $q0 = COPY [[USHLLv2i32_shift]]
148 ; CHECK: RET_ReallyLR implicit $q0
149 %0:fpr(<2 x s32>) = COPY $d0
150 %1:fpr(<2 x s64>) = G_ANYEXT %0(<2 x s32>)
151 $q0 = COPY %1(<2 x s64>)
152 RET_ReallyLR implicit $q0
156 name: zext_s64_from_s32
158 regBankSelected: true
161 - { id: 0, class: gpr }
162 - { id: 1, class: gpr }
168 ; CHECK-LABEL: name: zext_s64_from_s32
169 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
170 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64 = SUBREG_TO_REG 0, [[COPY]], %subreg.sub_32
171 ; CHECK: [[UBFMXri:%[0-9]+]]:gpr64 = UBFMXri [[SUBREG_TO_REG]], 0, 31
172 ; CHECK: $x0 = COPY [[UBFMXri]]
179 name: zext_s32_from_s16
181 regBankSelected: true
184 - { id: 0, class: gpr }
185 - { id: 1, class: gpr }
191 ; CHECK-LABEL: name: zext_s32_from_s16
192 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
193 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 0, 15
194 ; CHECK: $w0 = COPY [[UBFMWri]]
195 %2:gpr(s32) = COPY $w0
202 name: zext_s32_from_s8
204 regBankSelected: true
207 - { id: 0, class: gpr }
208 - { id: 1, class: gpr }
214 ; CHECK-LABEL: name: zext_s32_from_s8
215 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
216 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 0, 15
217 ; CHECK: $w0 = COPY [[UBFMWri]]
218 %2:gpr(s32) = COPY $w0
225 name: zext_s16_from_s8
227 regBankSelected: true
230 - { id: 0, class: gpr }
231 - { id: 1, class: gpr }
237 ; CHECK-LABEL: name: zext_s16_from_s8
238 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
239 ; CHECK: [[UBFMWri:%[0-9]+]]:gpr32 = UBFMWri [[COPY]], 0, 7
240 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[UBFMWri]]
241 ; CHECK: $w0 = COPY [[COPY1]]
242 %2:gpr(s32) = COPY $w0
245 %3:gpr(s32) = G_ANYEXT %1
250 name: zext_v8s16_from_v8s8
253 regBankSelected: true
254 tracksRegLiveness: true
256 - { id: 0, class: fpr }
257 - { id: 1, class: fpr }
258 machineFunctionInfo: {}
263 ; CHECK-LABEL: name: zext_v8s16_from_v8s8
264 ; CHECK: liveins: $d0
265 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
266 ; CHECK: [[USHLLv8i8_shift:%[0-9]+]]:fpr128 = USHLLv8i8_shift [[COPY]], 0
267 ; CHECK: $q0 = COPY [[USHLLv8i8_shift]]
268 ; CHECK: RET_ReallyLR implicit $q0
269 %0:fpr(<8 x s8>) = COPY $d0
270 %1:fpr(<8 x s16>) = G_ZEXT %0(<8 x s8>)
271 $q0 = COPY %1(<8 x s16>)
272 RET_ReallyLR implicit $q0
277 name: zext_v4s32_from_v4s16
280 regBankSelected: true
281 tracksRegLiveness: true
283 - { id: 0, class: fpr }
284 - { id: 1, class: fpr }
285 machineFunctionInfo: {}
290 ; CHECK-LABEL: name: zext_v4s32_from_v4s16
291 ; CHECK: liveins: $d0
292 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
293 ; CHECK: [[USHLLv4i16_shift:%[0-9]+]]:fpr128 = USHLLv4i16_shift [[COPY]], 0
294 ; CHECK: $q0 = COPY [[USHLLv4i16_shift]]
295 ; CHECK: RET_ReallyLR implicit $q0
296 %0:fpr(<4 x s16>) = COPY $d0
297 %1:fpr(<4 x s32>) = G_ZEXT %0(<4 x s16>)
298 $q0 = COPY %1(<4 x s32>)
299 RET_ReallyLR implicit $q0
303 name: zext_v2s64_from_v2s32
306 regBankSelected: true
307 tracksRegLiveness: true
309 - { id: 0, class: fpr }
310 - { id: 1, class: fpr }
311 machineFunctionInfo: {}
316 ; CHECK-LABEL: name: zext_v2s64_from_v2s32
317 ; CHECK: liveins: $d0
318 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
319 ; CHECK: [[USHLLv2i32_shift:%[0-9]+]]:fpr128 = USHLLv2i32_shift [[COPY]], 0
320 ; CHECK: $q0 = COPY [[USHLLv2i32_shift]]
321 ; CHECK: RET_ReallyLR implicit $q0
322 %0:fpr(<2 x s32>) = COPY $d0
323 %1:fpr(<2 x s64>) = G_ZEXT %0(<2 x s32>)
324 $q0 = COPY %1(<2 x s64>)
325 RET_ReallyLR implicit $q0
329 name: sext_s64_from_s32
331 regBankSelected: true
334 - { id: 0, class: gpr }
335 - { id: 1, class: gpr }
341 ; CHECK-LABEL: name: sext_s64_from_s32
342 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
343 ; CHECK: [[DEF:%[0-9]+]]:gpr64all = IMPLICIT_DEF
344 ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:gpr64 = INSERT_SUBREG [[DEF]], [[COPY]], %subreg.sub_32
345 ; CHECK: [[SBFMXri:%[0-9]+]]:gpr64 = SBFMXri [[INSERT_SUBREG]], 0, 31
346 ; CHECK: $x0 = COPY [[SBFMXri]]
353 name: sext_s32_from_s16
355 regBankSelected: true
358 - { id: 0, class: gpr }
359 - { id: 1, class: gpr }
365 ; CHECK-LABEL: name: sext_s32_from_s16
366 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
367 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 0, 15
368 ; CHECK: $w0 = COPY [[SBFMWri]]
369 %2:gpr(s32) = COPY $w0
376 name: sext_s32_from_s8
378 regBankSelected: true
381 - { id: 0, class: gpr }
382 - { id: 1, class: gpr }
388 ; CHECK-LABEL: name: sext_s32_from_s8
389 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
390 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 0, 7
391 ; CHECK: $w0 = COPY [[SBFMWri]]
392 %2:gpr(s32) = COPY $w0
399 name: sext_s16_from_s8
401 regBankSelected: true
404 - { id: 0, class: gpr }
405 - { id: 1, class: gpr }
411 ; CHECK-LABEL: name: sext_s16_from_s8
412 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
413 ; CHECK: [[SBFMWri:%[0-9]+]]:gpr32 = SBFMWri [[COPY]], 0, 7
414 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[SBFMWri]]
415 ; CHECK: $w0 = COPY [[COPY1]]
416 %2:gpr(s32) = COPY $w0
419 %3:gpr(s32) = G_ANYEXT %1
424 name: sext_v8s16_from_v8s8
427 regBankSelected: true
428 tracksRegLiveness: true
430 - { id: 0, class: fpr }
431 - { id: 1, class: fpr }
432 machineFunctionInfo: {}
437 ; CHECK-LABEL: name: sext_v8s16_from_v8s8
438 ; CHECK: liveins: $d0
439 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
440 ; CHECK: [[SSHLLv8i8_shift:%[0-9]+]]:fpr128 = SSHLLv8i8_shift [[COPY]], 0
441 ; CHECK: $q0 = COPY [[SSHLLv8i8_shift]]
442 ; CHECK: RET_ReallyLR implicit $q0
443 %0:fpr(<8 x s8>) = COPY $d0
444 %1:fpr(<8 x s16>) = G_SEXT %0(<8 x s8>)
445 $q0 = COPY %1(<8 x s16>)
446 RET_ReallyLR implicit $q0
451 name: sext_v4s32_from_v4s16
454 regBankSelected: true
455 tracksRegLiveness: true
457 - { id: 0, class: fpr }
458 - { id: 1, class: fpr }
459 machineFunctionInfo: {}
464 ; CHECK-LABEL: name: sext_v4s32_from_v4s16
465 ; CHECK: liveins: $d0
466 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
467 ; CHECK: [[SSHLLv4i16_shift:%[0-9]+]]:fpr128 = SSHLLv4i16_shift [[COPY]], 0
468 ; CHECK: $q0 = COPY [[SSHLLv4i16_shift]]
469 ; CHECK: RET_ReallyLR implicit $q0
470 %0:fpr(<4 x s16>) = COPY $d0
471 %1:fpr(<4 x s32>) = G_SEXT %0(<4 x s16>)
472 $q0 = COPY %1(<4 x s32>)
473 RET_ReallyLR implicit $q0
477 name: sext_v2s64_from_v2s32
480 regBankSelected: true
481 tracksRegLiveness: true
483 - { id: 0, class: fpr }
484 - { id: 1, class: fpr }
485 machineFunctionInfo: {}
490 ; CHECK-LABEL: name: sext_v2s64_from_v2s32
491 ; CHECK: liveins: $d0
492 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
493 ; CHECK: [[SSHLLv2i32_shift:%[0-9]+]]:fpr128 = SSHLLv2i32_shift [[COPY]], 0
494 ; CHECK: $q0 = COPY [[SSHLLv2i32_shift]]
495 ; CHECK: RET_ReallyLR implicit $q0
496 %0:fpr(<2 x s32>) = COPY $d0
497 %1:fpr(<2 x s64>) = G_SEXT %0(<2 x s32>)
498 $q0 = COPY %1(<2 x s64>)
499 RET_ReallyLR implicit $q0