1 ; RUN: llc -mtriple=thumbv7m-linux-gnu < %s | FileCheck %s --check-prefix=CHECK --check-prefix=T2
2 ; RUN: llc -mtriple=thumbv6m-linux-gnu < %s | FileCheck %s --check-prefix=CHECK --check-prefix=T1
4 ; CHECK-LABEL: single_bit:
5 ; CHECK: lsls r0, r0, #23
9 define i32 @single_bit(i32 %p) {
11 %b = icmp eq i32 %a, 0
12 br i1 %b, label %true, label %false
21 ; CHECK-LABEL: single_bit_multi_use:
22 ; CHECK: lsls r0, r0, #23
26 define i32 @single_bit_multi_use(i32 %p, ptr %z) {
29 %b = icmp eq i32 %a, 0
30 br i1 %b, label %true, label %false
39 ; CHECK-LABEL: multi_bit_lsb_ubfx:
40 ; CHECK: lsls r0, r0, #24
44 define i32 @multi_bit_lsb_ubfx(i32 %p) {
46 %b = icmp eq i32 %a, 0
47 br i1 %b, label %true, label %false
56 ; CHECK-LABEL: multi_bit_msb:
57 ; CHECK: lsrs r0, r0, #24
61 define i32 @multi_bit_msb(i32 %p) {
62 %a = and i32 %p, 4278190080 ; 0xff000000
63 %b = icmp eq i32 %a, 0
64 br i1 %b, label %true, label %false
73 ; CHECK-LABEL: multi_bit_nosb:
75 ; T1-NEXT: lsrs r0, r0, #24
79 define i32 @multi_bit_nosb(i32 %p) {
80 %a = and i32 %p, 16711680 ; 0x00ff0000
81 %b = icmp eq i32 %a, 0
82 br i1 %b, label %true, label %false
91 ; CHECK-LABEL: i16_cmpz:
93 ; T1-NEXT: lsrs r0, r0, #9
96 ; T2-NEXT: movs r2, #0
97 ; T2-NEXT: cmp.w r2, r0, lsr #9
98 define void @i16_cmpz(i16 %x, ptr %foo) {
100 %cmp = icmp ult i16 %x, 512
101 br i1 %cmp, label %if.then, label %if.end
103 if.then: ; preds = %entry
104 tail call void %foo(i32 0) #1
107 if.end: ; preds = %if.then, %entry