1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 define void @test_trunc_and_zext_s1_to_s32() { ret void }
5 define void @test_trunc_and_sext_s1_to_s32() { ret void }
6 define void @test_trunc_and_anyext_s1_to_s32() { ret void }
8 define void @test_trunc_and_zext_s8_to_s32() { ret void }
9 define void @test_trunc_and_sext_s8_to_s32() { ret void }
10 define void @test_trunc_and_anyext_s8_to_s32() { ret void }
12 define void @test_trunc_and_zext_s16_to_s32() { ret void }
13 define void @test_trunc_and_sext_s16_to_s32() { ret void }
14 define void @test_trunc_and_anyext_s16_to_s32() { ret void }
16 define void @test_trunc_and_zext_s1_to_s16() { ret void }
17 define void @test_trunc_and_sext_s1_to_s16() { ret void }
18 define void @test_trunc_and_anyext_s1_to_s16() { ret void }
20 define void @test_trunc_and_zext_s8_to_s16() { ret void }
21 define void @test_trunc_and_sext_s8_to_s16() { ret void }
22 define void @test_trunc_and_anyext_s8_to_s16() { ret void }
24 define void @test_trunc_and_zext_s1_to_s8() { ret void }
25 define void @test_trunc_and_sext_s1_to_s8() { ret void }
26 define void @test_trunc_and_anyext_s1_to_s8() { ret void }
29 name: test_trunc_and_zext_s1_to_s32
33 tracksRegLiveness: true
35 - { id: 0, class: gprb }
36 - { id: 1, class: gprb }
37 - { id: 2, class: gprb }
42 ; CHECK-LABEL: name: test_trunc_and_zext_s1_to_s32
44 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
45 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY [[COPY]]
46 ; CHECK: [[t2ANDri:%[0-9]+]]:rgpr = t2ANDri [[COPY1]], 1, 14 /* CC::al */, $noreg, $noreg
47 ; CHECK: $r0 = COPY [[t2ANDri]]
48 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
51 %1(s1) = G_TRUNC %0(s32)
53 %2(s32) = G_ZEXT %1(s1)
57 BX_RET 14, $noreg, implicit $r0
60 name: test_trunc_and_sext_s1_to_s32
64 tracksRegLiveness: true
66 - { id: 0, class: gprb }
67 - { id: 1, class: gprb }
68 - { id: 2, class: gprb }
73 ; CHECK-LABEL: name: test_trunc_and_sext_s1_to_s32
75 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
76 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY [[COPY]]
77 ; CHECK: [[t2ANDri:%[0-9]+]]:rgpr = t2ANDri [[COPY1]], 1, 14 /* CC::al */, $noreg, $noreg
78 ; CHECK: [[t2RSBri:%[0-9]+]]:rgpr = t2RSBri [[t2ANDri]], 0, 14 /* CC::al */, $noreg, $noreg
79 ; CHECK: $r0 = COPY [[t2RSBri]]
80 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
83 %1(s1) = G_TRUNC %0(s32)
85 %2(s32) = G_SEXT %1(s1)
89 BX_RET 14, $noreg, implicit $r0
92 name: test_trunc_and_anyext_s1_to_s32
96 tracksRegLiveness: true
98 - { id: 0, class: gprb }
99 - { id: 1, class: gprb }
100 - { id: 2, class: gprb }
105 ; CHECK-LABEL: name: test_trunc_and_anyext_s1_to_s32
106 ; CHECK: liveins: $r0
107 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
108 ; CHECK: $r0 = COPY [[COPY]]
109 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
112 %1(s1) = G_TRUNC %0(s32)
114 %2(s32) = G_ANYEXT %1(s1)
118 BX_RET 14, $noreg, implicit $r0
121 name: test_trunc_and_zext_s8_to_s32
123 regBankSelected: true
125 tracksRegLiveness: true
127 - { id: 0, class: gprb }
128 - { id: 1, class: gprb }
129 - { id: 2, class: gprb }
134 ; CHECK-LABEL: name: test_trunc_and_zext_s8_to_s32
135 ; CHECK: liveins: $r0
136 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
137 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY [[COPY]]
138 ; CHECK: [[t2UXTB:%[0-9]+]]:rgpr = t2UXTB [[COPY1]], 0, 14 /* CC::al */, $noreg
139 ; CHECK: $r0 = COPY [[t2UXTB]]
140 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
143 %1(s8) = G_TRUNC %0(s32)
145 %2(s32) = G_ZEXT %1(s8)
149 BX_RET 14, $noreg, implicit $r0
152 name: test_trunc_and_sext_s8_to_s32
154 regBankSelected: true
156 tracksRegLiveness: true
158 - { id: 0, class: gprb }
159 - { id: 1, class: gprb }
160 - { id: 2, class: gprb }
165 ; CHECK-LABEL: name: test_trunc_and_sext_s8_to_s32
166 ; CHECK: liveins: $r0
167 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
168 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY [[COPY]]
169 ; CHECK: [[t2SXTB:%[0-9]+]]:rgpr = t2SXTB [[COPY1]], 0, 14 /* CC::al */, $noreg
170 ; CHECK: $r0 = COPY [[t2SXTB]]
171 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
174 %1(s8) = G_TRUNC %0(s32)
176 %2(s32) = G_SEXT %1(s8)
180 BX_RET 14, $noreg, implicit $r0
183 name: test_trunc_and_anyext_s8_to_s32
185 regBankSelected: true
187 tracksRegLiveness: true
189 - { id: 0, class: gprb }
190 - { id: 1, class: gprb }
191 - { id: 2, class: gprb }
196 ; CHECK-LABEL: name: test_trunc_and_anyext_s8_to_s32
197 ; CHECK: liveins: $r0
198 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
199 ; CHECK: $r0 = COPY [[COPY]]
200 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
203 %1(s8) = G_TRUNC %0(s32)
205 %2(s32) = G_ANYEXT %1(s8)
209 BX_RET 14, $noreg, implicit $r0
212 name: test_trunc_and_zext_s16_to_s32
214 regBankSelected: true
216 tracksRegLiveness: true
218 - { id: 0, class: gprb }
219 - { id: 1, class: gprb }
220 - { id: 2, class: gprb }
225 ; CHECK-LABEL: name: test_trunc_and_zext_s16_to_s32
226 ; CHECK: liveins: $r0
227 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
228 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY [[COPY]]
229 ; CHECK: [[t2UXTH:%[0-9]+]]:rgpr = t2UXTH [[COPY1]], 0, 14 /* CC::al */, $noreg
230 ; CHECK: $r0 = COPY [[t2UXTH]]
231 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
234 %1(s16) = G_TRUNC %0(s32)
236 %2(s32) = G_ZEXT %1(s16)
240 BX_RET 14, $noreg, implicit $r0
243 name: test_trunc_and_sext_s16_to_s32
245 regBankSelected: true
247 tracksRegLiveness: true
249 - { id: 0, class: gprb }
250 - { id: 1, class: gprb }
251 - { id: 2, class: gprb }
256 ; CHECK-LABEL: name: test_trunc_and_sext_s16_to_s32
257 ; CHECK: liveins: $r0
258 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
259 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY [[COPY]]
260 ; CHECK: [[t2SXTH:%[0-9]+]]:rgpr = t2SXTH [[COPY1]], 0, 14 /* CC::al */, $noreg
261 ; CHECK: $r0 = COPY [[t2SXTH]]
262 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
265 %1(s16) = G_TRUNC %0(s32)
267 %2(s32) = G_SEXT %1(s16)
271 BX_RET 14, $noreg, implicit $r0
274 name: test_trunc_and_anyext_s16_to_s32
276 regBankSelected: true
278 tracksRegLiveness: true
280 - { id: 0, class: gprb }
281 - { id: 1, class: gprb }
282 - { id: 2, class: gprb }
287 ; CHECK-LABEL: name: test_trunc_and_anyext_s16_to_s32
288 ; CHECK: liveins: $r0
289 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
290 ; CHECK: $r0 = COPY [[COPY]]
291 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
294 %1(s16) = G_TRUNC %0(s32)
296 %2(s32) = G_ANYEXT %1(s16)
300 BX_RET 14, $noreg, implicit $r0
303 name: test_trunc_and_zext_s1_to_s16
305 regBankSelected: true
307 tracksRegLiveness: true
309 - { id: 0, class: gprb }
310 - { id: 1, class: gprb }
311 - { id: 2, class: gprb }
312 - { id: 3, class: gprb }
317 ; CHECK-LABEL: name: test_trunc_and_zext_s1_to_s16
318 ; CHECK: liveins: $r0, $r1
319 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
320 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
321 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY [[COPY1]]
322 ; CHECK: [[t2ANDri:%[0-9]+]]:rgpr = t2ANDri [[COPY2]], 1, 14 /* CC::al */, $noreg, $noreg
323 ; CHECK: t2STRHi12 [[t2ANDri]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s16))
324 ; CHECK: BX_RET 14 /* CC::al */, $noreg
329 %2(s1) = G_TRUNC %1(s32)
331 %3(s16) = G_ZEXT %2(s1)
333 G_STORE %3(s16), %0(p0) :: (store (s16))
338 name: test_trunc_and_sext_s1_to_s16
340 regBankSelected: true
342 tracksRegLiveness: true
344 - { id: 0, class: gprb }
345 - { id: 1, class: gprb }
346 - { id: 2, class: gprb }
347 - { id: 3, class: gprb }
352 ; CHECK-LABEL: name: test_trunc_and_sext_s1_to_s16
353 ; CHECK: liveins: $r0, $r1
354 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
355 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
356 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY [[COPY1]]
357 ; CHECK: [[t2ANDri:%[0-9]+]]:rgpr = t2ANDri [[COPY2]], 1, 14 /* CC::al */, $noreg, $noreg
358 ; CHECK: [[t2RSBri:%[0-9]+]]:rgpr = t2RSBri [[t2ANDri]], 0, 14 /* CC::al */, $noreg, $noreg
359 ; CHECK: t2STRHi12 [[t2RSBri]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s16))
360 ; CHECK: BX_RET 14 /* CC::al */, $noreg
365 %2(s1) = G_TRUNC %1(s32)
367 %3(s16) = G_SEXT %2(s1)
369 G_STORE %3(s16), %0(p0) :: (store (s16))
374 name: test_trunc_and_anyext_s1_to_s16
376 regBankSelected: true
378 tracksRegLiveness: true
380 - { id: 0, class: gprb }
381 - { id: 1, class: gprb }
382 - { id: 2, class: gprb }
383 - { id: 3, class: gprb }
388 ; CHECK-LABEL: name: test_trunc_and_anyext_s1_to_s16
389 ; CHECK: liveins: $r0, $r1
390 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
391 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
392 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY [[COPY1]]
393 ; CHECK: t2STRHi12 [[COPY2]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s16))
394 ; CHECK: BX_RET 14 /* CC::al */, $noreg
399 %2(s1) = G_TRUNC %1(s32)
401 %3(s16) = G_ANYEXT %2(s1)
403 G_STORE %3(s16), %0(p0) :: (store (s16))
408 name: test_trunc_and_zext_s8_to_s16
410 regBankSelected: true
412 tracksRegLiveness: true
414 - { id: 0, class: gprb }
415 - { id: 1, class: gprb }
416 - { id: 2, class: gprb }
417 - { id: 3, class: gprb }
422 ; CHECK-LABEL: name: test_trunc_and_zext_s8_to_s16
423 ; CHECK: liveins: $r0, $r1
424 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
425 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
426 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY [[COPY1]]
427 ; CHECK: [[t2UXTB:%[0-9]+]]:rgpr = t2UXTB [[COPY2]], 0, 14 /* CC::al */, $noreg
428 ; CHECK: t2STRHi12 [[t2UXTB]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s16))
429 ; CHECK: BX_RET 14 /* CC::al */, $noreg
434 %2(s8) = G_TRUNC %1(s32)
436 %3(s16) = G_ZEXT %2(s8)
438 G_STORE %3(s16), %0(p0) :: (store (s16))
443 name: test_trunc_and_sext_s8_to_s16
445 regBankSelected: true
447 tracksRegLiveness: true
449 - { id: 0, class: gprb }
450 - { id: 1, class: gprb }
451 - { id: 2, class: gprb }
452 - { id: 3, class: gprb }
457 ; CHECK-LABEL: name: test_trunc_and_sext_s8_to_s16
458 ; CHECK: liveins: $r0, $r1
459 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
460 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
461 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY [[COPY1]]
462 ; CHECK: [[t2SXTB:%[0-9]+]]:rgpr = t2SXTB [[COPY2]], 0, 14 /* CC::al */, $noreg
463 ; CHECK: t2STRHi12 [[t2SXTB]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s16))
464 ; CHECK: BX_RET 14 /* CC::al */, $noreg
469 %2(s8) = G_TRUNC %1(s32)
471 %3(s16) = G_SEXT %2(s8)
473 G_STORE %3(s16), %0(p0) :: (store (s16))
478 name: test_trunc_and_anyext_s8_to_s16
480 regBankSelected: true
482 tracksRegLiveness: true
484 - { id: 0, class: gprb }
485 - { id: 1, class: gprb }
486 - { id: 2, class: gprb }
487 - { id: 3, class: gprb }
492 ; CHECK-LABEL: name: test_trunc_and_anyext_s8_to_s16
493 ; CHECK: liveins: $r0, $r1
494 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
495 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
496 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY [[COPY1]]
497 ; CHECK: t2STRHi12 [[COPY2]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s16))
498 ; CHECK: BX_RET 14 /* CC::al */, $noreg
503 %2(s8) = G_TRUNC %1(s32)
505 %3(s16) = G_ANYEXT %2(s8)
507 G_STORE %3(s16), %0(p0) :: (store (s16))
512 name: test_trunc_and_zext_s1_to_s8
514 regBankSelected: true
516 tracksRegLiveness: true
518 - { id: 0, class: gprb }
519 - { id: 1, class: gprb }
520 - { id: 2, class: gprb }
521 - { id: 3, class: gprb }
526 ; CHECK-LABEL: name: test_trunc_and_zext_s1_to_s8
527 ; CHECK: liveins: $r0, $r1
528 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
529 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
530 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY [[COPY1]]
531 ; CHECK: [[t2ANDri:%[0-9]+]]:rgpr = t2ANDri [[COPY2]], 1, 14 /* CC::al */, $noreg, $noreg
532 ; CHECK: t2STRBi12 [[t2ANDri]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s8))
533 ; CHECK: BX_RET 14 /* CC::al */, $noreg
538 %2(s1) = G_TRUNC %1(s32)
540 %3(s8) = G_ZEXT %2(s1)
542 G_STORE %3(s8), %0(p0) :: (store (s8))
547 name: test_trunc_and_sext_s1_to_s8
549 regBankSelected: true
551 tracksRegLiveness: true
553 - { id: 0, class: gprb }
554 - { id: 1, class: gprb }
555 - { id: 2, class: gprb }
556 - { id: 3, class: gprb }
561 ; CHECK-LABEL: name: test_trunc_and_sext_s1_to_s8
562 ; CHECK: liveins: $r0, $r1
563 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
564 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
565 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY [[COPY1]]
566 ; CHECK: [[t2ANDri:%[0-9]+]]:rgpr = t2ANDri [[COPY2]], 1, 14 /* CC::al */, $noreg, $noreg
567 ; CHECK: [[t2RSBri:%[0-9]+]]:rgpr = t2RSBri [[t2ANDri]], 0, 14 /* CC::al */, $noreg, $noreg
568 ; CHECK: t2STRBi12 [[t2RSBri]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s8))
569 ; CHECK: BX_RET 14 /* CC::al */, $noreg
574 %2(s1) = G_TRUNC %1(s32)
576 %3(s8) = G_SEXT %2(s1)
578 G_STORE %3(s8), %0(p0) :: (store (s8))
583 name: test_trunc_and_anyext_s1_to_s8
585 regBankSelected: true
587 tracksRegLiveness: true
589 - { id: 0, class: gprb }
590 - { id: 1, class: gprb }
591 - { id: 2, class: gprb }
592 - { id: 3, class: gprb }
597 ; CHECK-LABEL: name: test_trunc_and_anyext_s1_to_s8
598 ; CHECK: liveins: $r0, $r1
599 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
600 ; CHECK: [[COPY1:%[0-9]+]]:gpr = COPY $r1
601 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY [[COPY1]]
602 ; CHECK: t2STRBi12 [[COPY2]], [[COPY]], 0, 14 /* CC::al */, $noreg :: (store (s8))
603 ; CHECK: BX_RET 14 /* CC::al */, $noreg
608 %2(s1) = G_TRUNC %1(s32)
610 %3(s8) = G_ANYEXT %2(s1)
612 G_STORE %3(s8), %0(p0) :: (store (s8))