1 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s
3 ; These tests would be improved by 'movs r0, #0' being rematerialized below the
4 ; tst as 'mov.w r0, #0'.
6 define i32 @f2(i32 %a, i32 %b) {
8 ; CHECK: tst {{.*}}, r1
10 %tmp1 = icmp eq i32 %tmp, 0
11 %ret = select i1 %tmp1, i32 42, i32 24
15 define i32 @f4(i32 %a, i32 %b) {
17 ; CHECK: tst {{.*}}, r1
19 %tmp1 = icmp eq i32 0, %tmp
20 %ret = select i1 %tmp1, i32 42, i32 24
24 define i32 @f6(i32 %a, i32 %b) {
26 ; CHECK: tst.w {{.*}}, r1, lsl #5
28 %tmp1 = and i32 %a, %tmp
29 %tmp2 = icmp eq i32 %tmp1, 0
30 %ret = select i1 %tmp2, i32 42, i32 24
34 define i32 @f7(i32 %a, i32 %b) {
36 ; CHECK: tst.w {{.*}}, r1, lsr #6
38 %tmp1 = and i32 %a, %tmp
39 %tmp2 = icmp eq i32 %tmp1, 0
40 %ret = select i1 %tmp2, i32 42, i32 24
44 define i32 @f8(i32 %a, i32 %b) {
46 ; CHECK: tst.w {{.*}}, r1, asr #7
48 %tmp1 = and i32 %a, %tmp
49 %tmp2 = icmp eq i32 %tmp1, 0
50 %ret = select i1 %tmp2, i32 42, i32 24
54 define i32 @f9(i32 %a, i32 %b) {
56 ; CHECK: tst.w {{.*}}, {{.*}}, ror #8
59 %tmp = or i32 %l8, %r8
60 %tmp1 = and i32 %a, %tmp
61 %tmp2 = icmp eq i32 %tmp1, 0
62 %ret = select i1 %tmp2, i32 42, i32 24