1 ; RUN: llc < %s -mtriple=thumbv7-none-eabi -mcpu=cortex-m3 | FileCheck %s -check-prefix=CHECK -check-prefix=NONE
2 ; RUN: llc < %s -mtriple=thumbv7-none-eabihf -mcpu=cortex-m4 | FileCheck %s -check-prefix=CHECK -check-prefix=HARD -check-prefix=SP
3 ; RUN: llc < %s -mtriple=thumbv7-none-eabihf -mcpu=cortex-m7 | FileCheck %s -check-prefix=CHECK -check-prefix=HARD -check-prefix=DP
4 ; RUN: llc < %s -mtriple=thumbv7-none-eabihf -mcpu=cortex-a8 | FileCheck %s -check-prefix=CHECK -check-prefix=HARD -check-prefix=DP
8 define i1 @cmp_f_false(float %a, float %b) {
9 ; CHECK-LABEL: cmp_f_false:
12 %1 = fcmp false float %a, %b
15 define i1 @cmp_f_oeq(float %a, float %b) {
16 ; CHECK-LABEL: cmp_f_oeq:
17 ; NONE: bl __aeabi_fcmpeq
20 %1 = fcmp oeq float %a, %b
23 define i1 @cmp_f_ogt(float %a, float %b) {
24 ; CHECK-LABEL: cmp_f_ogt:
25 ; NONE: bl __aeabi_fcmpgt
28 %1 = fcmp ogt float %a, %b
31 define i1 @cmp_f_oge(float %a, float %b) {
32 ; CHECK-LABEL: cmp_f_oge:
33 ; NONE: bl __aeabi_fcmpge
36 %1 = fcmp oge float %a, %b
39 define i1 @cmp_f_olt(float %a, float %b) {
40 ; CHECK-LABEL: cmp_f_olt:
41 ; NONE: bl __aeabi_fcmplt
44 %1 = fcmp olt float %a, %b
47 define i1 @cmp_f_ole(float %a, float %b) {
48 ; CHECK-LABEL: cmp_f_ole:
49 ; NONE: bl __aeabi_fcmple
52 %1 = fcmp ole float %a, %b
55 define i1 @cmp_f_one(float %a, float %b) {
56 ; CHECK-LABEL: cmp_f_one:
57 ; NONE: bl __aeabi_fcmpgt
58 ; NONE: bl __aeabi_fcmplt
62 %1 = fcmp one float %a, %b
65 define i1 @cmp_f_ord(float %a, float %b) {
66 ; CHECK-LABEL: cmp_f_ord:
67 ; NONE: bl __aeabi_fcmpun
70 %1 = fcmp ord float %a, %b
73 define i1 @cmp_f_ueq(float %a, float %b) {
74 ; CHECK-LABEL: cmp_f_ueq:
75 ; NONE: bl __aeabi_fcmpeq
76 ; NONE: bl __aeabi_fcmpun
80 %1 = fcmp ueq float %a, %b
83 define i1 @cmp_f_ugt(float %a, float %b) {
84 ; CHECK-LABEL: cmp_f_ugt:
85 ; NONE: bl __aeabi_fcmple
86 ; NONE-NEXT: clz r0, r0
87 ; NONE-NEXT: lsrs r0, r0, #5
90 %1 = fcmp ugt float %a, %b
93 define i1 @cmp_f_uge(float %a, float %b) {
94 ; CHECK-LABEL: cmp_f_uge:
95 ; NONE: bl __aeabi_fcmplt
96 ; NONE-NEXT: clz r0, r0
97 ; NONE-NEXT: lsrs r0, r0, #5
100 %1 = fcmp uge float %a, %b
103 define i1 @cmp_f_ult(float %a, float %b) {
104 ; CHECK-LABEL: cmp_f_ult:
105 ; NONE: bl __aeabi_fcmpge
106 ; NONE-NEXT: clz r0, r0
107 ; NONE-NEXT: lsrs r0, r0, #5
110 %1 = fcmp ult float %a, %b
113 define i1 @cmp_f_ule(float %a, float %b) {
114 ; CHECK-LABEL: cmp_f_ule:
115 ; NONE: bl __aeabi_fcmpgt
116 ; NONE-NEXT: clz r0, r0
117 ; NONE-NEXT: lsrs r0, r0, #5
120 %1 = fcmp ule float %a, %b
123 define i1 @cmp_f_une(float %a, float %b) {
124 ; CHECK-LABEL: cmp_f_une:
125 ; NONE: bl __aeabi_fcmpeq
128 %1 = fcmp une float %a, %b
131 define i1 @cmp_f_uno(float %a, float %b) {
132 ; CHECK-LABEL: cmp_f_uno:
133 ; NONE: bl __aeabi_fcmpun
136 %1 = fcmp uno float %a, %b
139 define i1 @cmp_f_true(float %a, float %b) {
140 ; CHECK-LABEL: cmp_f_true:
143 %1 = fcmp true float %a, %b
147 define i1 @cmp_d_false(double %a, double %b) {
148 ; CHECK-LABEL: cmp_d_false:
151 %1 = fcmp false double %a, %b
154 define i1 @cmp_d_oeq(double %a, double %b) {
155 ; CHECK-LABEL: cmp_d_oeq:
156 ; NONE: bl __aeabi_dcmpeq
157 ; SP: bl __aeabi_dcmpeq
160 %1 = fcmp oeq double %a, %b
163 define i1 @cmp_d_ogt(double %a, double %b) {
164 ; CHECK-LABEL: cmp_d_ogt:
165 ; NONE: bl __aeabi_dcmpgt
166 ; SP: bl __aeabi_dcmpgt
169 %1 = fcmp ogt double %a, %b
172 define i1 @cmp_d_oge(double %a, double %b) {
173 ; CHECK-LABEL: cmp_d_oge:
174 ; NONE: bl __aeabi_dcmpge
175 ; SP: bl __aeabi_dcmpge
178 %1 = fcmp oge double %a, %b
181 define i1 @cmp_d_olt(double %a, double %b) {
182 ; CHECK-LABEL: cmp_d_olt:
183 ; NONE: bl __aeabi_dcmplt
184 ; SP: bl __aeabi_dcmplt
187 %1 = fcmp olt double %a, %b
190 define i1 @cmp_d_ole(double %a, double %b) {
191 ; CHECK-LABEL: cmp_d_ole:
192 ; NONE: bl __aeabi_dcmple
193 ; SP: bl __aeabi_dcmple
196 %1 = fcmp ole double %a, %b
199 define i1 @cmp_d_one(double %a, double %b) {
200 ; CHECK-LABEL: cmp_d_one:
201 ; NONE: bl __aeabi_dcmpgt
202 ; NONE: bl __aeabi_dcmplt
203 ; SP: bl __aeabi_dcmpgt
204 ; SP: bl __aeabi_dcmplt
208 %1 = fcmp one double %a, %b
211 define i1 @cmp_d_ord(double %a, double %b) {
212 ; CHECK-LABEL: cmp_d_ord:
213 ; NONE: bl __aeabi_dcmpun
214 ; SP: bl __aeabi_dcmpun
217 %1 = fcmp ord double %a, %b
220 define i1 @cmp_d_ugt(double %a, double %b) {
221 ; CHECK-LABEL: cmp_d_ugt:
222 ; NONE: bl __aeabi_dcmple
223 ; SP: bl __aeabi_dcmple
226 %1 = fcmp ugt double %a, %b
230 define i1 @cmp_d_ult(double %a, double %b) {
231 ; CHECK-LABEL: cmp_d_ult:
232 ; NONE: bl __aeabi_dcmpge
233 ; SP: bl __aeabi_dcmpge
236 %1 = fcmp ult double %a, %b
241 define i1 @cmp_d_uno(double %a, double %b) {
242 ; CHECK-LABEL: cmp_d_uno:
243 ; NONE: bl __aeabi_dcmpun
244 ; SP: bl __aeabi_dcmpun
247 %1 = fcmp uno double %a, %b
250 define i1 @cmp_d_true(double %a, double %b) {
251 ; CHECK-LABEL: cmp_d_true:
254 %1 = fcmp true double %a, %b
257 define i1 @cmp_d_ueq(double %a, double %b) {
258 ; CHECK-LABEL: cmp_d_ueq:
259 ; NONE: bl __aeabi_dcmpeq
260 ; NONE: bl __aeabi_dcmpun
261 ; SP: bl __aeabi_dcmpeq
262 ; SP: bl __aeabi_dcmpun
266 %1 = fcmp ueq double %a, %b
270 define i1 @cmp_d_uge(double %a, double %b) {
271 ; CHECK-LABEL: cmp_d_uge:
272 ; NONE: bl __aeabi_dcmplt
273 ; SP: bl __aeabi_dcmplt
276 %1 = fcmp uge double %a, %b
280 define i1 @cmp_d_ule(double %a, double %b) {
281 ; CHECK-LABEL: cmp_d_ule:
282 ; NONE: bl __aeabi_dcmpgt
283 ; SP: bl __aeabi_dcmpgt
286 %1 = fcmp ule double %a, %b
290 define i1 @cmp_d_une(double %a, double %b) {
291 ; CHECK-LABEL: cmp_d_une:
292 ; NONE: bl __aeabi_dcmpeq
293 ; SP: bl __aeabi_dcmpeq
296 %1 = fcmp une double %a, %b