1 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3 define void @test_ashr_rr() { ret void }
5 define void @test_shl_ri() { ret void }
6 define void @test_shl_ri_bad_imm() { ret void }
10 # CHECK-LABEL: name: test_ashr_rr
14 # CHECK: selected: true
16 - { id: 0, class: gprb }
17 - { id: 1, class: gprb }
18 - { id: 2, class: gprb }
24 ; CHECK: [[VREGX:%[0-9]+]]:rgpr = COPY $r0
27 ; CHECK: [[VREGY:%[0-9]+]]:rgpr = COPY $r1
29 %2(s32) = G_ASHR %0, %1
30 ; CHECK: [[VREGRES:%[0-9]+]]:rgpr = t2ASRrr [[VREGX]], [[VREGY]], 14, $noreg, $noreg
33 ; CHECK: $r0 = COPY [[VREGRES]]
35 BX_RET 14, $noreg, implicit $r0
36 ; CHECK: BX_RET 14, $noreg, implicit $r0
40 # CHECK-LABEL: name: test_shl_ri
44 # CHECK: selected: true
46 - { id: 0, class: gprb }
47 - { id: 1, class: gprb }
48 - { id: 2, class: gprb }
54 ; CHECK: [[VREGX:%[0-9]+]]:rgpr = COPY $r0
56 %1(s32) = G_CONSTANT i32 31
57 %2(s32) = G_SHL %0, %1
58 ; CHECK: [[VREGRES:%[0-9]+]]:rgpr = t2LSLri [[VREGX]], 31, 14, $noreg, $noreg
61 ; CHECK: $r0 = COPY [[VREGRES]]
63 BX_RET 14, $noreg, implicit $r0
64 ; CHECK: BX_RET 14, $noreg, implicit $r0
67 name: test_shl_ri_bad_imm
68 # CHECK-LABEL: name: test_shl_ri_bad_imm
72 # CHECK: selected: true
74 - { id: 0, class: gprb }
75 - { id: 1, class: gprb }
76 - { id: 2, class: gprb }
82 ; CHECK: [[VREGX:%[0-9]+]]:rgpr = COPY $r0
84 %1(s32) = G_CONSTANT i32 32
85 ; CHECK: [[VREGY:%[0-9]+]]:rgpr = t2MOVi 32, 14, $noreg, $noreg
87 %2(s32) = G_SHL %0, %1
88 ; CHECK: [[VREGRES:%[0-9]+]]:rgpr = t2LSLrr [[VREGX]], [[VREGY]], 14, $noreg, $noreg
91 ; CHECK: $r0 = COPY [[VREGRES]]
93 BX_RET 14, $noreg, implicit $r0
94 ; CHECK: BX_RET 14, $noreg, implicit $r0