1 ; RUN: llc < %s -O0 -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios -verify-machineinstrs | FileCheck %s --check-prefix=ARM
2 ; RUN: llc < %s -O0 -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi -verify-machineinstrs | FileCheck %s --check-prefix=ARM
3 ; RUN: llc < %s -O0 -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios -verify-machineinstrs | FileCheck %s --check-prefix=THUMB
5 define void @t1a(float %a) uwtable ssp {
9 %cmp = fcmp oeq float %a, 0.000000e+00
10 ; ARM: vcmp.f32 s{{[0-9]+}}, #0
11 ; THUMB: vcmp.f32 s{{[0-9]+}}, #0
12 br i1 %cmp, label %if.then, label %if.end
14 if.then: ; preds = %entry
18 if.end: ; preds = %if.then, %entry
24 ; Shouldn't be able to encode -0.0 imm.
25 define void @t1b(float %a) uwtable ssp {
29 %cmp = fcmp oeq float %a, -0.000000e+00
31 ; ARM: vcmp.f32 s{{[0-9]+}}, s{{[0-9]+}}
33 ; THUMB: vcmp.f32 s{{[0-9]+}}, s{{[0-9]+}}
34 br i1 %cmp, label %if.then, label %if.end
36 if.then: ; preds = %entry
40 if.end: ; preds = %if.then, %entry
44 define void @t2a(double %a) uwtable ssp {
48 %cmp = fcmp oeq double %a, 0.000000e+00
49 ; ARM: vcmp.f64 d{{[0-9]+}}, #0
50 ; THUMB: vcmp.f64 d{{[0-9]+}}, #0
51 br i1 %cmp, label %if.then, label %if.end
53 if.then: ; preds = %entry
57 if.end: ; preds = %if.then, %entry
61 ; Shouldn't be able to encode -0.0 imm.
62 define void @t2b(double %a) uwtable ssp {
66 %cmp = fcmp oeq double %a, -0.000000e+00
68 ; ARM: vcmp.f64 d{{[0-9]+}}, d{{[0-9]+}}
70 ; THUMB: vcmp.f64 d{{[0-9]+}}, d{{[0-9]+}}
71 br i1 %cmp, label %if.then, label %if.end
73 if.then: ; preds = %entry
77 if.end: ; preds = %if.then, %entry
81 define void @t4(i8 signext %a) uwtable ssp {
85 %cmp = icmp eq i8 %a, -1
86 ; ARM: cmn r{{[0-9]}}, #1
87 ; THUMB: cmn.w r{{[0-9]}}, #1
88 br i1 %cmp, label %if.then, label %if.end
90 if.then: ; preds = %entry
94 if.end: ; preds = %if.then, %entry
98 define void @t5(i8 zeroext %a) uwtable ssp {
102 %cmp = icmp eq i8 %a, 1
103 ; ARM: cmp r{{[0-9]}}, #1
104 ; THUMB: cmp r{{[0-9]}}, #1
105 br i1 %cmp, label %if.then, label %if.end
107 if.then: ; preds = %entry
108 tail call void @foo()
111 if.end: ; preds = %if.then, %entry
115 define void @t6(i16 signext %a) uwtable ssp {
119 %cmp = icmp eq i16 %a, -1
120 ; ARM: cmn r{{[0-9]}}, #1
121 ; THUMB: cmn.w r{{[0-9]}}, #1
122 br i1 %cmp, label %if.then, label %if.end
124 if.then: ; preds = %entry
125 tail call void @foo()
128 if.end: ; preds = %if.then, %entry
132 define void @t7(i16 zeroext %a) uwtable ssp {
136 %cmp = icmp eq i16 %a, 1
137 ; ARM: cmp r{{[0-9]}}, #1
138 ; THUMB: cmp r{{[0-9]}}, #1
139 br i1 %cmp, label %if.then, label %if.end
141 if.then: ; preds = %entry
142 tail call void @foo()
145 if.end: ; preds = %if.then, %entry
149 define void @t8(i32 %a) uwtable ssp {
153 %cmp = icmp eq i32 %a, -1
154 ; ARM: cmn r{{[0-9]}}, #1
155 ; THUMB: cmn.w r{{[0-9]}}, #1
156 br i1 %cmp, label %if.then, label %if.end
158 if.then: ; preds = %entry
159 tail call void @foo()
162 if.end: ; preds = %if.then, %entry
166 define void @t9(i32 %a) uwtable ssp {
170 %cmp = icmp eq i32 %a, 1
171 ; ARM: cmp r{{[0-9]}}, #1
172 ; THUMB: cmp r{{[0-9]}}, #1
173 br i1 %cmp, label %if.then, label %if.end
175 if.then: ; preds = %entry
176 tail call void @foo()
179 if.end: ; preds = %if.then, %entry
183 define void @t10(i32 %a) uwtable ssp {
187 %cmp = icmp eq i32 %a, 384
188 ; ARM: cmp r{{[0-9]}}, #384
189 ; THUMB: cmp.w r{{[0-9]}}, #384
190 br i1 %cmp, label %if.then, label %if.end
192 if.then: ; preds = %entry
193 tail call void @foo()
196 if.end: ; preds = %if.then, %entry
200 define void @t11(i32 %a) uwtable ssp {
204 %cmp = icmp eq i32 %a, 4096
205 ; ARM: cmp r{{[0-9]}}, #4096
206 ; THUMB: cmp.w r{{[0-9]}}, #4096
207 br i1 %cmp, label %if.then, label %if.end
209 if.then: ; preds = %entry
210 tail call void @foo()
213 if.end: ; preds = %if.then, %entry
217 define void @t12(i8 %a) uwtable ssp {
221 %cmp = icmp ugt i8 %a, -113
222 ; ARM: cmp r{{[0-9]}}, #143
223 ; THUMB: cmp r{{[0-9]}}, #143
224 br i1 %cmp, label %if.then, label %if.end
226 if.then: ; preds = %entry
227 tail call void @foo()
230 if.end: ; preds = %if.then, %entry
235 ; When comparing LONG_MIN/INT_MIN use a cmp instruction.
236 define void @t13() nounwind ssp {
240 %cmp = icmp slt i32 -123, -2147483648
241 ; ARM: cmp r{{[0-9]}}, #-2147483648
242 ; THUMB: cmp.w r{{[0-9]}}, #-2147483648
243 br i1 %cmp, label %if.then, label %if.end
245 if.then: ; preds = %entry
248 if.end: ; preds = %entry