1 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3 define void @test_s8() { ret void }
4 define void @test_s16() { ret void }
5 define void @test_s32() { ret void }
7 define void @test_gep() { ret void }
11 # CHECK-LABEL: name: test_s8
15 # CHECK: selected: true
17 - { id: 0, class: gprb }
18 - { id: 1, class: gprb }
24 ; CHECK: %[[P:[0-9]+]]:gpr = COPY $r0
26 %1(s8) = G_LOAD %0(p0) :: (load 1)
27 ; CHECK: %[[V:[0-9]+]]:rgpr = t2LDRBi12 %[[P]], 0, 14, $noreg :: (load 1)
29 G_STORE %1(s8), %0(p0) :: (store 1)
30 ; CHECK: t2STRBi12 %[[V]], %[[P]], 0, 14, $noreg :: (store 1)
33 ; CHECK: BX_RET 14, $noreg
37 # CHECK-LABEL: name: test_s16
41 # CHECK: selected: true
43 - { id: 0, class: gprb }
44 - { id: 1, class: gprb }
50 ; CHECK: %[[P:[0-9]+]]:gpr = COPY $r0
52 %1(s16) = G_LOAD %0(p0) :: (load 2)
53 ; CHECK: %[[V:[0-9]+]]:rgpr = t2LDRHi12 %[[P]], 0, 14, $noreg :: (load 2)
55 G_STORE %1(s16), %0(p0) :: (store 2)
56 ; CHECK: t2STRHi12 %[[V]], %[[P]], 0, 14, $noreg :: (store 2)
59 ; CHECK: BX_RET 14, $noreg
63 # CHECK-LABEL: name: test_s32
67 # CHECK: selected: true
69 - { id: 0, class: gprb }
70 - { id: 1, class: gprb }
76 ; CHECK: %[[P:[0-9]+]]:gpr = COPY $r0
78 %1(s32) = G_LOAD %0(p0) :: (load 4)
79 ; CHECK: %[[V:[0-9]+]]:gpr = t2LDRi12 %[[P]], 0, 14, $noreg :: (load 4)
81 G_STORE %1(s32), %0(p0) :: (store 4)
82 ; CHECK: t2STRi12 %[[V]], %[[P]], 0, 14, $noreg :: (store 4)
85 ; CHECK: BX_RET 14, $noreg
89 # CHECK-LABEL: name: test_gep
93 # CHECK: selected: true
95 - { id: 0, class: gprb }
96 - { id: 1, class: gprb }
97 - { id: 2, class: gprb }
103 ; CHECK: [[PTR:%[0-9]+]]:gprnopc = COPY $r0
106 ; CHECK: [[OFF:%[0-9]+]]:rgpr = COPY $r1
108 %2(p0) = G_GEP %0, %1(s32)
109 ; CHECK: [[GEP:%[0-9]+]]:gprnopc = t2ADDrr [[PTR]], [[OFF]], 14, $noreg, $noreg
112 ; CHECK: $r0 = COPY [[GEP]]
114 BX_RET 14, $noreg, implicit $r0
115 ; CHECK: BX_RET 14, $noreg, implicit $r0