1 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s
3 ; These tests could be improved by 'movs r0, #0' being rematerialized below the
4 ; test as 'mov.w r0, #0'.
6 define i32 @f1(i32 %a, i32 %b) {
8 %tmp = icmp ne i32 %a, %nb
9 %ret = select i1 %tmp, i32 42, i32 24
13 ; CHECK: cmn {{.*}}, r1
15 define i32 @f2(i32 %a, i32 %b) {
17 %tmp = icmp ne i32 %nb, %a
18 %ret = select i1 %tmp, i32 42, i32 24
22 ; CHECK: cmn {{.*}}, r1
24 define i32 @f3(i32 %a, i32 %b) {
26 %tmp = icmp eq i32 %a, %nb
27 %ret = select i1 %tmp, i32 42, i32 24
31 ; CHECK: cmn {{.*}}, r1
33 define i32 @f4(i32 %a, i32 %b) {
35 %tmp = icmp eq i32 %nb, %a
36 %ret = select i1 %tmp, i32 42, i32 24
40 ; CHECK: cmn {{.*}}, r1
42 define i32 @f5(i32 %a, i32 %b) {
45 %tmp1 = icmp eq i32 %nb, %a
46 %ret = select i1 %tmp1, i32 42, i32 24
50 ; CHECK: cmn.w {{.*}}, r1, lsl #5
52 define i32 @f6(i32 %a, i32 %b) {
55 %tmp1 = icmp ne i32 %nb, %a
56 %ret = select i1 %tmp1, i32 42, i32 24
60 ; CHECK: cmn.w {{.*}}, r1, lsr #6
62 define i32 @f7(i32 %a, i32 %b) {
65 %tmp1 = icmp eq i32 %a, %nb
66 %ret = select i1 %tmp1, i32 42, i32 24
70 ; CHECK: cmn.w {{.*}}, r1, asr #7
72 define i32 @f8(i32 %a, i32 %b) {
75 %tmp = or i32 %l8, %r8
77 %tmp1 = icmp ne i32 %a, %nb
78 %ret = select i1 %tmp1, i32 42, i32 24
82 ; CHECK: cmn.w {{.*}}, {{.*}}, ror #8
85 define void @f9(i32 %a, i32 %b) nounwind optsize {
86 tail call void asm sideeffect "cmn.w r0, r1", ""() nounwind, !srcloc !0