1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2 %s -o - | FileCheck %s
4 ; These tests would be improved by 'movs r0, #0' being rematerialized below the
5 ; test as 'mov.w r0, #0'.
8 define i32 @f2(i32 %a) {
11 ; CHECK-NEXT: movs r1, #24
12 ; CHECK-NEXT: cmp r0, #187
14 ; CHECK-NEXT: moveq r1, #42
15 ; CHECK-NEXT: mov r0, r1
17 %tmp = xor i32 %a, 187
18 %tmp1 = icmp eq i32 0, %tmp
19 %ret = select i1 %tmp1, i32 42, i32 24
23 ; 0x00aa00aa = 11141290
24 define i32 @f3(i32 %a) {
27 ; CHECK-NEXT: movs r1, #24
28 ; CHECK-NEXT: cmp.w r0, #11141290
30 ; CHECK-NEXT: moveq r1, #42
31 ; CHECK-NEXT: mov r0, r1
33 %tmp = xor i32 %a, 11141290
34 %tmp1 = icmp eq i32 %tmp, 0
35 %ret = select i1 %tmp1, i32 42, i32 24
39 ; 0xcc00cc00 = 3422604288
40 define i32 @f6(i32 %a) {
43 ; CHECK-NEXT: movs r1, #24
44 ; CHECK-NEXT: cmp.w r0, #-872363008
46 ; CHECK-NEXT: moveq r1, #42
47 ; CHECK-NEXT: mov r0, r1
49 %tmp = xor i32 %a, 3422604288
50 %tmp1 = icmp eq i32 0, %tmp
51 %ret = select i1 %tmp1, i32 42, i32 24
55 ; 0xdddddddd = 3722304989
56 define i32 @f7(i32 %a) {
59 ; CHECK-NEXT: movs r1, #24
60 ; CHECK-NEXT: cmp.w r0, #-572662307
62 ; CHECK-NEXT: moveq r1, #42
63 ; CHECK-NEXT: mov r0, r1
65 %tmp = xor i32 %a, 3722304989
66 %tmp1 = icmp eq i32 %tmp, 0
67 %ret = select i1 %tmp1, i32 42, i32 24
71 ; 0x00110000 = 1114112
72 define i32 @f10(i32 %a) {
75 ; CHECK-NEXT: movs r1, #24
76 ; CHECK-NEXT: cmp.w r0, #1114112
78 ; CHECK-NEXT: moveq r1, #42
79 ; CHECK-NEXT: mov r0, r1
81 %tmp = xor i32 %a, 1114112
82 %tmp1 = icmp eq i32 0, %tmp
83 %ret = select i1 %tmp1, i32 42, i32 24
88 define i1 @f12(i32 %a) {
91 ; CHECK-NEXT: subs r0, #187
92 ; CHECK-NEXT: clz r0, r0
93 ; CHECK-NEXT: lsrs r0, r0, #5
95 %tmp = xor i32 %a, 187
96 %tmp1 = icmp eq i32 0, %tmp
100 ; 0x00aa00aa = 11141290
101 define i1 @f13(i32 %a) {
104 ; CHECK-NEXT: sub.w r0, r0, #11141290
105 ; CHECK-NEXT: clz r0, r0
106 ; CHECK-NEXT: lsrs r0, r0, #5
108 %tmp = xor i32 %a, 11141290
109 %tmp1 = icmp eq i32 %tmp, 0
113 ; 0xcc00cc00 = 3422604288
114 define i1 @f16(i32 %a) {
117 ; CHECK-NEXT: sub.w r0, r0, #-872363008
118 ; CHECK-NEXT: clz r0, r0
119 ; CHECK-NEXT: lsrs r0, r0, #5
121 %tmp = xor i32 %a, 3422604288
122 %tmp1 = icmp eq i32 0, %tmp
126 ; 0xdddddddd = 3722304989
127 define i1 @f17(i32 %a) {
130 ; CHECK-NEXT: sub.w r0, r0, #-572662307
131 ; CHECK-NEXT: clz r0, r0
132 ; CHECK-NEXT: lsrs r0, r0, #5
134 %tmp = xor i32 %a, 3722304989
135 %tmp1 = icmp eq i32 %tmp, 0
139 ; 0x00110000 = 1114112
140 define i1 @f18(i32 %a) {
143 ; CHECK-NEXT: sub.w r0, r0, #1114112
144 ; CHECK-NEXT: clz r0, r0
145 ; CHECK-NEXT: lsrs r0, r0, #5
147 %tmp = xor i32 %a, 1114112
148 %tmp1 = icmp eq i32 0, %tmp