1 ; RUN: llc < %s -march=mips -mcpu=mips32 | \
2 ; RUN: FileCheck %s -check-prefixes=ALL,32-C
3 ; RUN: llc < %s -march=mips -mcpu=mips32r2 | \
4 ; RUN: FileCheck %s -check-prefixes=ALL,32-C
5 ; RUN: llc < %s -march=mips -mcpu=mips32r6 | \
6 ; RUN: FileCheck %s -check-prefixes=ALL,32-CMP
7 ; RUN: llc < %s -march=mips64 -mcpu=mips4 | \
8 ; RUN: FileCheck %s -check-prefixes=ALL,64-C
9 ; RUN: llc < %s -march=mips64 -mcpu=mips64 | \
10 ; RUN: FileCheck %s -check-prefixes=ALL,64-C
11 ; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | \
12 ; RUN: FileCheck %s -check-prefixes=ALL,64-C
13 ; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | \
14 ; RUN: FileCheck %s -check-prefixes=ALL,64-CMP
15 ; RUN: llc < %s -march=mips -mcpu=mips32r3 -mattr=+micromips | FileCheck %s \
16 ; RUN: -check-prefixes=ALL,MM,MM32R3
17 ; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips | FileCheck %s \
18 ; RUN: -check-prefixes=ALL,MM,MMR6,MM32R6
20 define i32 @false_f32(float %a, float %b) nounwind {
21 ; ALL-LABEL: false_f32:
22 ; 32-C: addiu $2, $zero, 0
24 ; 32-CMP: addiu $2, $zero, 0
26 ; 64-C: addiu $2, $zero, 0
28 ; 64-CMP: addiu $2, $zero, 0
32 %1 = fcmp false float %a, %b
33 %2 = zext i1 %1 to i32
37 define i32 @oeq_f32(float %a, float %b) nounwind {
40 ; 32-C-DAG: addiu $2, $zero, 1
41 ; 32-C-DAG: c.eq.s $f12, $f14
42 ; 32-C: movf $2, $zero, $fcc0
44 ; 64-C-DAG: addiu $2, $zero, 1
45 ; 64-C-DAG: c.eq.s $f12, $f13
46 ; 64-C: movf $2, $zero, $fcc0
48 ; 32-CMP-DAG: cmp.eq.s $[[T0:f[0-9]+]], $f12, $f14
49 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
50 ; 32-CMP-DAG: andi $2, $[[T1]], 1
52 ; 64-CMP-DAG: cmp.eq.s $[[T0:f[0-9]+]], $f12, $f13
53 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
54 ; 64-CMP-DAG: andi $2, $[[T1]], 1
56 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
57 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
58 ; MM32R3-DAG: c.eq.s $f12, $f14
59 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
61 ; MM32R6-DAG: cmp.eq.s $[[T0:f[0-9]+]], $f12, $f14
62 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
63 ; MMR6-DAG: andi16 $2, $[[T1]], 1
65 %1 = fcmp oeq float %a, %b
66 %2 = zext i1 %1 to i32
70 define i32 @ogt_f32(float %a, float %b) nounwind {
73 ; 32-C-DAG: addiu $2, $zero, 1
74 ; 32-C-DAG: c.ule.s $f12, $f14
75 ; 32-C: movt $2, $zero, $fcc0
77 ; 64-C-DAG: addiu $2, $zero, 1
78 ; 64-C-DAG: c.ule.s $f12, $f13
79 ; 64-C: movt $2, $zero, $fcc0
81 ; 32-CMP-DAG: cmp.lt.s $[[T0:f[0-9]+]], $f14, $f12
82 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
83 ; 32-CMP-DAG: andi $2, $[[T1]], 1
85 ; 64-CMP-DAG: cmp.lt.s $[[T0:f[0-9]+]], $f13, $f12
86 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
87 ; 64-CMP-DAG: andi $2, $[[T1]], 1
89 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
90 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
91 ; MM32R3-DAG: c.ule.s $f12, $f14
92 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
94 ; MM32R6-DAG: cmp.lt.s $[[T0:f[0-9]+]], $f14, $f12
95 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
96 ; MMR6-DAG: andi16 $2, $[[T1]], 1
98 %1 = fcmp ogt float %a, %b
99 %2 = zext i1 %1 to i32
103 define i32 @oge_f32(float %a, float %b) nounwind {
104 ; ALL-LABEL: oge_f32:
106 ; 32-C-DAG: addiu $2, $zero, 1
107 ; 32-C-DAG: c.ult.s $f12, $f14
108 ; 32-C: movt $2, $zero, $fcc0
110 ; 64-C-DAG: addiu $2, $zero, 1
111 ; 64-C-DAG: c.ult.s $f12, $f13
112 ; 64-C: movt $2, $zero, $fcc0
114 ; 32-CMP-DAG: cmp.le.s $[[T0:f[0-9]+]], $f14, $f12
115 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
116 ; 32-CMP-DAG: andi $2, $[[T1]], 1
118 ; 64-CMP-DAG: cmp.le.s $[[T0:f[0-9]+]], $f13, $f12
119 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
120 ; 64-CMP-DAG: andi $2, $[[T1]], 1
122 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
123 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
124 ; MM32R3-DAG: c.ult.s $f12, $f14
125 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
127 ; MM32R6-DAG: cmp.le.s $[[T0:f[0-9]+]], $f14, $f12
128 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
129 ; MMR6-DAG: andi16 $2, $[[T1]], 1
131 %1 = fcmp oge float %a, %b
132 %2 = zext i1 %1 to i32
136 define i32 @olt_f32(float %a, float %b) nounwind {
137 ; ALL-LABEL: olt_f32:
139 ; 32-C-DAG: addiu $2, $zero, 1
140 ; 32-C-DAG: c.olt.s $f12, $f14
141 ; 32-C: movf $2, $zero, $fcc0
143 ; 64-C-DAG: addiu $2, $zero, 1
144 ; 64-C-DAG: c.olt.s $f12, $f13
145 ; 64-C: movf $2, $zero, $fcc0
147 ; 32-CMP-DAG: cmp.lt.s $[[T0:f[0-9]+]], $f12, $f14
148 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
149 ; 32-CMP-DAG: andi $2, $[[T1]], 1
151 ; 64-CMP-DAG: cmp.lt.s $[[T0:f[0-9]+]], $f12, $f13
152 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
153 ; 64-CMP-DAG: andi $2, $[[T1]], 1
155 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
156 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
157 ; MM32R3-DAG: c.olt.s $f12, $f14
158 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
160 ; MM32R6-DAG: cmp.lt.s $[[T0:f[0-9]+]], $f12, $f14
161 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
162 ; MMR6-DAG: andi16 $2, $[[T1]], 1
164 %1 = fcmp olt float %a, %b
165 %2 = zext i1 %1 to i32
169 define i32 @ole_f32(float %a, float %b) nounwind {
170 ; ALL-LABEL: ole_f32:
172 ; 32-C-DAG: addiu $2, $zero, 1
173 ; 32-C-DAG: c.ole.s $f12, $f14
174 ; 32-C: movf $2, $zero, $fcc0
176 ; 64-C-DAG: addiu $2, $zero, 1
177 ; 64-C-DAG: c.ole.s $f12, $f13
178 ; 64-C: movf $2, $zero, $fcc0
180 ; 32-CMP-DAG: cmp.le.s $[[T0:f[0-9]+]], $f12, $f14
181 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
182 ; 32-CMP-DAG: andi $2, $[[T1]], 1
184 ; 64-CMP-DAG: cmp.le.s $[[T0:f[0-9]+]], $f12, $f13
185 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
186 ; 64-CMP-DAG: andi $2, $[[T1]], 1
188 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
189 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
190 ; MM32R3-DAG: c.ole.s $f12, $f14
191 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
193 ; MM32R6-DAG: cmp.le.s $[[T0:f[0-9]+]], $f12, $f14
194 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
195 ; MMR6-DAG: andi16 $2, $[[T1]], 1
197 %1 = fcmp ole float %a, %b
198 %2 = zext i1 %1 to i32
202 define i32 @one_f32(float %a, float %b) nounwind {
203 ; ALL-LABEL: one_f32:
205 ; 32-C-DAG: addiu $2, $zero, 1
206 ; 32-C-DAG: c.ueq.s $f12, $f14
207 ; 32-C: movt $2, $zero, $fcc0
209 ; 64-C-DAG: addiu $2, $zero, 1
210 ; 64-C-DAG: c.ueq.s $f12, $f13
211 ; 64-C: movt $2, $zero, $fcc0
213 ; 32-CMP-DAG: cmp.ueq.s $[[T0:f[0-9]+]], $f12, $f14
214 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
215 ; 32-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
216 ; 32-CMP-DAG: andi $2, $[[T2]], 1
218 ; 64-CMP-DAG: cmp.ueq.s $[[T0:f[0-9]+]], $f12, $f13
219 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
220 ; 64-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
221 ; 64-CMP-DAG: andi $2, $[[T2]], 1
223 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
224 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
225 ; MM32R3-DAG: c.ueq.s $f12, $f14
226 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
228 ; MM32R6-DAG: cmp.ueq.s $[[T0:f[0-9]+]], $f12, $f14
229 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
230 ; MMR6-DAG: not $[[T2:[0-9]+]], $[[T1]]
231 ; MMR6-DAG: andi16 $2, $[[T2]], 1
233 %1 = fcmp one float %a, %b
234 %2 = zext i1 %1 to i32
238 define i32 @ord_f32(float %a, float %b) nounwind {
239 ; ALL-LABEL: ord_f32:
241 ; 32-C-DAG: addiu $2, $zero, 1
242 ; 32-C-DAG: c.un.s $f12, $f14
243 ; 32-C: movt $2, $zero, $fcc0
245 ; 64-C-DAG: addiu $2, $zero, 1
246 ; 64-C-DAG: c.un.s $f12, $f13
247 ; 64-C: movt $2, $zero, $fcc0
249 ; 32-CMP-DAG: cmp.un.s $[[T0:f[0-9]+]], $f12, $f14
250 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
251 ; 32-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
252 ; 32-CMP-DAG: andi $2, $[[T2]], 1
254 ; 64-CMP-DAG: cmp.un.s $[[T0:f[0-9]+]], $f12, $f13
255 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
256 ; 64-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
257 ; 64-CMP-DAG: andi $2, $[[T2]], 1
259 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
260 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
261 ; MM32R3-DAG: c.un.s $f12, $f14
262 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
264 ; MM32R6-DAG: cmp.un.s $[[T0:f[0-9]+]], $f12, $f14
265 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
266 ; MMR6-DAG: not $[[T2:[0-9]+]], $[[T1]]
267 ; MMR6-DAG: andi16 $2, $[[T2]], 1
269 %1 = fcmp ord float %a, %b
270 %2 = zext i1 %1 to i32
274 define i32 @ueq_f32(float %a, float %b) nounwind {
275 ; ALL-LABEL: ueq_f32:
277 ; 32-C-DAG: addiu $2, $zero, 1
278 ; 32-C-DAG: c.ueq.s $f12, $f14
279 ; 32-C: movf $2, $zero, $fcc0
281 ; 64-C-DAG: addiu $2, $zero, 1
282 ; 64-C-DAG: c.ueq.s $f12, $f13
283 ; 64-C: movf $2, $zero, $fcc0
285 ; 32-CMP-DAG: cmp.ueq.s $[[T0:f[0-9]+]], $f12, $f14
286 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
287 ; 32-CMP-DAG: andi $2, $[[T1]], 1
289 ; 64-CMP-DAG: cmp.ueq.s $[[T0:f[0-9]+]], $f12, $f13
290 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
291 ; 64-CMP-DAG: andi $2, $[[T1]], 1
293 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
294 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
295 ; MM32R3-DAG: c.ueq.s $f12, $f14
296 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
298 ; MM32R6-DAG: cmp.ueq.s $[[T0:f[0-9]+]], $f12, $f14
299 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
300 ; MMR6-DAG: andi16 $2, $[[T1]], 1
302 %1 = fcmp ueq float %a, %b
303 %2 = zext i1 %1 to i32
307 define i32 @ugt_f32(float %a, float %b) nounwind {
308 ; ALL-LABEL: ugt_f32:
310 ; 32-C-DAG: addiu $2, $zero, 1
311 ; 32-C-DAG: c.ole.s $f12, $f14
312 ; 32-C: movt $2, $zero, $fcc0
314 ; 64-C-DAG: addiu $2, $zero, 1
315 ; 64-C-DAG: c.ole.s $f12, $f13
316 ; 64-C: movt $2, $zero, $fcc0
318 ; 32-CMP-DAG: cmp.ult.s $[[T0:f[0-9]+]], $f14, $f12
319 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
320 ; 32-CMP-DAG: andi $2, $[[T1]], 1
322 ; 64-CMP-DAG: cmp.ult.s $[[T0:f[0-9]+]], $f13, $f12
323 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
324 ; 64-CMP-DAG: andi $2, $[[T1]], 1
326 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
327 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
328 ; MM32R3-DAG: c.ole.s $f12, $f14
329 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
331 ; MM32R6-DAG: cmp.ult.s $[[T0:f[0-9]+]], $f14, $f12
332 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
333 ; MMR6-DAG: andi16 $2, $[[T1]], 1
335 %1 = fcmp ugt float %a, %b
336 %2 = zext i1 %1 to i32
340 define i32 @uge_f32(float %a, float %b) nounwind {
341 ; ALL-LABEL: uge_f32:
343 ; 32-C-DAG: addiu $2, $zero, 1
344 ; 32-C-DAG: c.olt.s $f12, $f14
345 ; 32-C: movt $2, $zero, $fcc0
347 ; 64-C-DAG: addiu $2, $zero, 1
348 ; 64-C-DAG: c.olt.s $f12, $f13
349 ; 64-C: movt $2, $zero, $fcc0
351 ; 32-CMP-DAG: cmp.ule.s $[[T0:f[0-9]+]], $f14, $f12
352 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
353 ; 32-CMP-DAG: andi $2, $[[T1]], 1
355 ; 64-CMP-DAG: cmp.ule.s $[[T0:f[0-9]+]], $f13, $f12
356 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
357 ; 64-CMP-DAG: andi $2, $[[T1]], 1
359 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
360 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
361 ; MM32R3-DAG: c.olt.s $f12, $f14
362 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
364 ; MM32R6-DAG: cmp.ule.s $[[T0:f[0-9]+]], $f14, $f12
365 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
366 ; MMR6-DAG: andi16 $2, $[[T1]], 1
368 %1 = fcmp uge float %a, %b
369 %2 = zext i1 %1 to i32
373 define i32 @ult_f32(float %a, float %b) nounwind {
374 ; ALL-LABEL: ult_f32:
376 ; 32-C-DAG: addiu $2, $zero, 1
377 ; 32-C-DAG: c.ult.s $f12, $f14
378 ; 32-C: movf $2, $zero, $fcc0
380 ; 64-C-DAG: addiu $2, $zero, 1
381 ; 64-C-DAG: c.ult.s $f12, $f13
382 ; 64-C: movf $2, $zero, $fcc0
384 ; 32-CMP-DAG: cmp.ult.s $[[T0:f[0-9]+]], $f12, $f14
385 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
386 ; 32-CMP-DAG: andi $2, $[[T1]], 1
388 ; 64-CMP-DAG: cmp.ult.s $[[T0:f[0-9]+]], $f12, $f13
389 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
390 ; 64-CMP-DAG: andi $2, $[[T1]], 1
392 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
393 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
394 ; MM32R3-DAG: c.ult.s $f12, $f14
395 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
397 ; MM32R6-DAG: cmp.ult.s $[[T0:f[0-9]+]], $f12, $f14
398 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
399 ; MMR6-DAG: andi16 $2, $[[T1]], 1
401 %1 = fcmp ult float %a, %b
402 %2 = zext i1 %1 to i32
406 define i32 @ule_f32(float %a, float %b) nounwind {
407 ; ALL-LABEL: ule_f32:
409 ; 32-C-DAG: addiu $2, $zero, 1
410 ; 32-C-DAG: c.ule.s $f12, $f14
411 ; 32-C: movf $2, $zero, $fcc0
413 ; 64-C-DAG: addiu $2, $zero, 1
414 ; 64-C-DAG: c.ule.s $f12, $f13
415 ; 64-C: movf $2, $zero, $fcc0
417 ; 32-CMP-DAG: cmp.ule.s $[[T0:f[0-9]+]], $f12, $f14
418 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
419 ; 32-CMP-DAG: andi $2, $[[T1]], 1
421 ; 64-CMP-DAG: cmp.ule.s $[[T0:f[0-9]+]], $f12, $f13
422 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
423 ; 64-CMP-DAG: andi $2, $[[T1]], 1
425 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
426 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
427 ; MM32R3-DAG: c.ule.s $f12, $f14
428 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
430 ; MM32R6-DAG: cmp.ule.s $[[T0:f[0-9]+]], $f12, $f14
431 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
432 ; MMR6-DAG: andi16 $2, $[[T1]], 1
434 %1 = fcmp ule float %a, %b
435 %2 = zext i1 %1 to i32
439 define i32 @une_f32(float %a, float %b) nounwind {
440 ; ALL-LABEL: une_f32:
442 ; 32-C-DAG: addiu $2, $zero, 1
443 ; 32-C-DAG: c.eq.s $f12, $f14
444 ; 32-C: movt $2, $zero, $fcc0
446 ; 64-C-DAG: addiu $2, $zero, 1
447 ; 64-C-DAG: c.eq.s $f12, $f13
448 ; 64-C: movt $2, $zero, $fcc0
450 ; 32-CMP-DAG: cmp.eq.s $[[T0:f[0-9]+]], $f12, $f14
451 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
452 ; 32-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
453 ; 32-CMP-DAG: andi $2, $[[T2]], 1
455 ; 64-CMP-DAG: cmp.eq.s $[[T0:f[0-9]+]], $f12, $f13
456 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
457 ; 64-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
458 ; 64-CMP-DAG: andi $2, $[[T2]], 1
460 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
461 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
462 ; MM32R3-DAG: c.eq.s $f12, $f14
463 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
465 ; MM32R6-DAG: cmp.eq.s $[[T0:f[0-9]+]], $f12, $f14
466 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
467 ; MMR6-DAG: not $[[T2:[0-9]+]], $[[T1]]
468 ; MMR6-DAG: andi16 $2, $[[T2]], 1
470 %1 = fcmp une float %a, %b
471 %2 = zext i1 %1 to i32
475 define i32 @uno_f32(float %a, float %b) nounwind {
476 ; ALL-LABEL: uno_f32:
478 ; 32-C-DAG: addiu $2, $zero, 1
479 ; 32-C-DAG: c.un.s $f12, $f14
480 ; 32-C: movf $2, $zero, $fcc0
482 ; 64-C-DAG: addiu $2, $zero, 1
483 ; 64-C-DAG: c.un.s $f12, $f13
484 ; 64-C: movf $2, $zero, $fcc0
486 ; 32-CMP-DAG: cmp.un.s $[[T0:f[0-9]+]], $f12, $f14
487 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
488 ; 32-CMP-DAG: andi $2, $[[T1]], 1
490 ; 64-CMP-DAG: cmp.un.s $[[T0:f[0-9]+]], $f12, $f13
491 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
492 ; 64-CMP-DAG: andi $2, $[[T1]], 1
494 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
495 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
496 ; MM32R3-DAG: c.un.s $f12, $f14
497 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
499 ; MM32R6-DAG: cmp.un.s $[[T0:f[0-9]+]], $f12, $f14
500 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
501 ; MMR6-DAG: andi16 $2, $[[T1]], 1
503 %1 = fcmp uno float %a, %b
504 %2 = zext i1 %1 to i32
508 define i32 @true_f32(float %a, float %b) nounwind {
509 ; ALL-LABEL: true_f32:
510 ; 32-C: addiu $2, $zero, 1
512 ; 32-CMP: addiu $2, $zero, 1
514 ; 64-C: addiu $2, $zero, 1
516 ; 64-CMP: addiu $2, $zero, 1
520 %1 = fcmp true float %a, %b
521 %2 = zext i1 %1 to i32
525 define i32 @false_f64(double %a, double %b) nounwind {
526 ; ALL-LABEL: false_f64:
527 ; 32-C: addiu $2, $zero, 0
529 ; 32-CMP: addiu $2, $zero, 0
531 ; 64-C: addiu $2, $zero, 0
533 ; 64-CMP: addiu $2, $zero, 0
537 %1 = fcmp false double %a, %b
538 %2 = zext i1 %1 to i32
542 define i32 @oeq_f64(double %a, double %b) nounwind {
543 ; ALL-LABEL: oeq_f64:
545 ; 32-C-DAG: addiu $2, $zero, 1
546 ; 32-C-DAG: c.eq.d $f12, $f14
547 ; 32-C: movf $2, $zero, $fcc0
549 ; 64-C-DAG: addiu $2, $zero, 1
550 ; 64-C-DAG: c.eq.d $f12, $f13
551 ; 64-C: movf $2, $zero, $fcc0
553 ; 32-CMP-DAG: cmp.eq.d $[[T0:f[0-9]+]], $f12, $f14
554 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
555 ; 32-CMP-DAG: andi $2, $[[T1]], 1
557 ; 64-CMP-DAG: cmp.eq.d $[[T0:f[0-9]+]], $f12, $f13
558 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
559 ; 64-CMP-DAG: andi $2, $[[T1]], 1
561 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
562 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
563 ; MM32R3-DAG: c.eq.d $f12, $f14
564 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
566 ; MM32R6-DAG: cmp.eq.d $[[T0:f[0-9]+]], $f12, $f14
567 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
568 ; MMR6-DAG: andi16 $2, $[[T1]], 1
570 %1 = fcmp oeq double %a, %b
571 %2 = zext i1 %1 to i32
575 define i32 @ogt_f64(double %a, double %b) nounwind {
576 ; ALL-LABEL: ogt_f64:
578 ; 32-C-DAG: addiu $2, $zero, 1
579 ; 32-C-DAG: c.ule.d $f12, $f14
580 ; 32-C: movt $2, $zero, $fcc0
582 ; 64-C-DAG: addiu $2, $zero, 1
583 ; 64-C-DAG: c.ule.d $f12, $f13
584 ; 64-C: movt $2, $zero, $fcc0
586 ; 32-CMP-DAG: cmp.lt.d $[[T0:f[0-9]+]], $f14, $f12
587 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
588 ; 32-CMP-DAG: andi $2, $[[T1]], 1
590 ; 64-CMP-DAG: cmp.lt.d $[[T0:f[0-9]+]], $f13, $f12
591 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
592 ; 64-CMP-DAG: andi $2, $[[T1]], 1
594 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
595 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
596 ; MM32R3-DAG: c.ule.d $f12, $f14
597 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
599 ; MM32R6-DAG: cmp.lt.d $[[T0:f[0-9]+]], $f14, $f12
600 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
601 ; MMR6-DAG: andi16 $2, $[[T1]], 1
603 %1 = fcmp ogt double %a, %b
604 %2 = zext i1 %1 to i32
608 define i32 @oge_f64(double %a, double %b) nounwind {
609 ; ALL-LABEL: oge_f64:
611 ; 32-C-DAG: addiu $2, $zero, 1
612 ; 32-C-DAG: c.ult.d $f12, $f14
613 ; 32-C: movt $2, $zero, $fcc0
615 ; 64-C-DAG: addiu $2, $zero, 1
616 ; 64-C-DAG: c.ult.d $f12, $f13
617 ; 64-C: movt $2, $zero, $fcc0
619 ; 32-CMP-DAG: cmp.le.d $[[T0:f[0-9]+]], $f14, $f12
620 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
621 ; 32-CMP-DAG: andi $2, $[[T1]], 1
623 ; 64-CMP-DAG: cmp.le.d $[[T0:f[0-9]+]], $f13, $f12
624 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
625 ; 64-CMP-DAG: andi $2, $[[T1]], 1
627 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
628 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
629 ; MM32R3-DAG: c.ult.d $f12, $f14
630 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
632 ; MM32R6-DAG: cmp.le.d $[[T0:f[0-9]+]], $f14, $f12
633 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
634 ; MMR6-DAG: andi16 $2, $[[T1]], 1
636 %1 = fcmp oge double %a, %b
637 %2 = zext i1 %1 to i32
641 define i32 @olt_f64(double %a, double %b) nounwind {
642 ; ALL-LABEL: olt_f64:
644 ; 32-C-DAG: addiu $2, $zero, 1
645 ; 32-C-DAG: c.olt.d $f12, $f14
646 ; 32-C: movf $2, $zero, $fcc0
648 ; 64-C-DAG: addiu $2, $zero, 1
649 ; 64-C-DAG: c.olt.d $f12, $f13
650 ; 64-C: movf $2, $zero, $fcc0
652 ; 32-CMP-DAG: cmp.lt.d $[[T0:f[0-9]+]], $f12, $f14
653 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
654 ; 32-CMP-DAG: andi $2, $[[T1]], 1
656 ; 64-CMP-DAG: cmp.lt.d $[[T0:f[0-9]+]], $f12, $f13
657 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
658 ; 64-CMP-DAG: andi $2, $[[T1]], 1
660 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
661 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
662 ; MM32R3-DAG: c.olt.d $f12, $f14
663 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
665 ; MM32R6-DAG: cmp.lt.d $[[T0:f[0-9]+]], $f12, $f14
666 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
667 ; MMR6-DAG: andi16 $2, $[[T1]], 1
669 %1 = fcmp olt double %a, %b
670 %2 = zext i1 %1 to i32
674 define i32 @ole_f64(double %a, double %b) nounwind {
675 ; ALL-LABEL: ole_f64:
677 ; 32-C-DAG: addiu $2, $zero, 1
678 ; 32-C-DAG: c.ole.d $f12, $f14
679 ; 32-C: movf $2, $zero, $fcc0
681 ; 64-C-DAG: addiu $2, $zero, 1
682 ; 64-C-DAG: c.ole.d $f12, $f13
683 ; 64-C: movf $2, $zero, $fcc0
685 ; 32-CMP-DAG: cmp.le.d $[[T0:f[0-9]+]], $f12, $f14
686 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
687 ; 32-CMP-DAG: andi $2, $[[T1]], 1
689 ; 64-CMP-DAG: cmp.le.d $[[T0:f[0-9]+]], $f12, $f13
690 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
691 ; 64-CMP-DAG: andi $2, $[[T1]], 1
693 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
694 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
695 ; MM32R3-DAG: c.ole.d $f12, $f14
696 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
698 ; MM32R6-DAG: cmp.le.d $[[T0:f[0-9]+]], $f12, $f14
699 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
700 ; MMR6-DAG: andi16 $2, $[[T1]], 1
702 %1 = fcmp ole double %a, %b
703 %2 = zext i1 %1 to i32
707 define i32 @one_f64(double %a, double %b) nounwind {
708 ; ALL-LABEL: one_f64:
710 ; 32-C-DAG: addiu $2, $zero, 1
711 ; 32-C-DAG: c.ueq.d $f12, $f14
712 ; 32-C: movt $2, $zero, $fcc0
714 ; 64-C-DAG: addiu $2, $zero, 1
715 ; 64-C-DAG: c.ueq.d $f12, $f13
716 ; 64-C: movt $2, $zero, $fcc0
718 ; 32-CMP-DAG: cmp.ueq.d $[[T0:f[0-9]+]], $f12, $f14
719 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
720 ; 32-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
721 ; 32-CMP-DAG: andi $2, $[[T2]], 1
723 ; 64-CMP-DAG: cmp.ueq.d $[[T0:f[0-9]+]], $f12, $f13
724 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
725 ; 64-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
726 ; 64-CMP-DAG: andi $2, $[[T2]], 1
728 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
729 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
730 ; MM32R3-DAG: c.ueq.d $f12, $f14
731 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
733 ; MM32R6-DAG: cmp.ueq.d $[[T0:f[0-9]+]], $f12, $f14
734 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
735 ; MMR6-DAG: not $[[T2:[0-9]+]], $[[T1]]
736 ; MMR6-DAG: andi16 $2, $[[T2]], 1
738 %1 = fcmp one double %a, %b
739 %2 = zext i1 %1 to i32
743 define i32 @ord_f64(double %a, double %b) nounwind {
744 ; ALL-LABEL: ord_f64:
746 ; 32-C-DAG: addiu $2, $zero, 1
747 ; 32-C-DAG: c.un.d $f12, $f14
748 ; 32-C: movt $2, $zero, $fcc0
750 ; 64-C-DAG: addiu $2, $zero, 1
751 ; 64-C-DAG: c.un.d $f12, $f13
752 ; 64-C: movt $2, $zero, $fcc0
754 ; 32-CMP-DAG: cmp.un.d $[[T0:f[0-9]+]], $f12, $f14
755 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
756 ; 32-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
757 ; 32-CMP-DAG: andi $2, $[[T2]], 1
759 ; 64-CMP-DAG: cmp.un.d $[[T0:f[0-9]+]], $f12, $f13
760 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
761 ; 64-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
762 ; 64-CMP-DAG: andi $2, $[[T2]], 1
764 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
765 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
766 ; MM32R3-DAG: c.un.d $f12, $f14
767 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
769 ; MM32R6-DAG: cmp.un.d $[[T0:f[0-9]+]], $f12, $f14
770 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
771 ; MMR6-DAG: not $[[T2:[0-9]+]], $[[T1]]
772 ; MMR6-DAG: andi16 $2, $[[T2]], 1
774 %1 = fcmp ord double %a, %b
775 %2 = zext i1 %1 to i32
779 define i32 @ueq_f64(double %a, double %b) nounwind {
780 ; ALL-LABEL: ueq_f64:
782 ; 32-C-DAG: addiu $2, $zero, 1
783 ; 32-C-DAG: c.ueq.d $f12, $f14
784 ; 32-C: movf $2, $zero, $fcc0
786 ; 64-C-DAG: addiu $2, $zero, 1
787 ; 64-C-DAG: c.ueq.d $f12, $f13
788 ; 64-C: movf $2, $zero, $fcc0
790 ; 32-CMP-DAG: cmp.ueq.d $[[T0:f[0-9]+]], $f12, $f14
791 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
792 ; 32-CMP-DAG: andi $2, $[[T1]], 1
794 ; 64-CMP-DAG: cmp.ueq.d $[[T0:f[0-9]+]], $f12, $f13
795 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
796 ; 64-CMP-DAG: andi $2, $[[T1]], 1
798 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
799 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
800 ; MM32R3-DAG: c.ueq.d $f12, $f14
801 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
803 ; MM32R6-DAG: cmp.ueq.d $[[T0:f[0-9]+]], $f12, $f14
804 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
805 ; MMR6-DAG: andi16 $2, $[[T1]], 1
807 %1 = fcmp ueq double %a, %b
808 %2 = zext i1 %1 to i32
812 define i32 @ugt_f64(double %a, double %b) nounwind {
813 ; ALL-LABEL: ugt_f64:
815 ; 32-C-DAG: addiu $2, $zero, 1
816 ; 32-C-DAG: c.ole.d $f12, $f14
817 ; 32-C: movt $2, $zero, $fcc0
819 ; 64-C-DAG: addiu $2, $zero, 1
820 ; 64-C-DAG: c.ole.d $f12, $f13
821 ; 64-C: movt $2, $zero, $fcc0
823 ; 32-CMP-DAG: cmp.ult.d $[[T0:f[0-9]+]], $f14, $f12
824 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
825 ; 32-CMP-DAG: andi $2, $[[T1]], 1
827 ; 64-CMP-DAG: cmp.ult.d $[[T0:f[0-9]+]], $f13, $f12
828 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
829 ; 64-CMP-DAG: andi $2, $[[T1]], 1
831 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
832 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
833 ; MM32R3-DAG: c.ole.d $f12, $f14
834 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
836 ; MM32R6-DAG: cmp.ult.d $[[T0:f[0-9]+]], $f14, $f12
837 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
838 ; MMR6-DAG: andi16 $2, $[[T1]], 1
840 %1 = fcmp ugt double %a, %b
841 %2 = zext i1 %1 to i32
845 define i32 @uge_f64(double %a, double %b) nounwind {
846 ; ALL-LABEL: uge_f64:
848 ; 32-C-DAG: addiu $2, $zero, 1
849 ; 32-C-DAG: c.olt.d $f12, $f14
850 ; 32-C: movt $2, $zero, $fcc0
852 ; 64-C-DAG: addiu $2, $zero, 1
853 ; 64-C-DAG: c.olt.d $f12, $f13
854 ; 64-C: movt $2, $zero, $fcc0
856 ; 32-CMP-DAG: cmp.ule.d $[[T0:f[0-9]+]], $f14, $f12
857 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
858 ; 32-CMP-DAG: andi $2, $[[T1]], 1
860 ; 64-CMP-DAG: cmp.ule.d $[[T0:f[0-9]+]], $f13, $f12
861 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
862 ; 64-CMP-DAG: andi $2, $[[T1]], 1
864 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
865 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
866 ; MM32R3-DAG: c.olt.d $f12, $f14
867 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
869 ; MM32R6-DAG: cmp.ule.d $[[T0:f[0-9]+]], $f14, $f12
870 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
871 ; MMR6-DAG: andi16 $2, $[[T1]], 1
873 %1 = fcmp uge double %a, %b
874 %2 = zext i1 %1 to i32
878 define i32 @ult_f64(double %a, double %b) nounwind {
879 ; ALL-LABEL: ult_f64:
881 ; 32-C-DAG: addiu $2, $zero, 1
882 ; 32-C-DAG: c.ult.d $f12, $f14
883 ; 32-C: movf $2, $zero, $fcc0
885 ; 64-C-DAG: addiu $2, $zero, 1
886 ; 64-C-DAG: c.ult.d $f12, $f13
887 ; 64-C: movf $2, $zero, $fcc0
889 ; 32-CMP-DAG: cmp.ult.d $[[T0:f[0-9]+]], $f12, $f14
890 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
891 ; 32-CMP-DAG: andi $2, $[[T1]], 1
893 ; 64-CMP-DAG: cmp.ult.d $[[T0:f[0-9]+]], $f12, $f13
894 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
895 ; 64-CMP-DAG: andi $2, $[[T1]], 1
897 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
898 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
899 ; MM32R3-DAG: c.ult.d $f12, $f14
900 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
902 ; MM32R6-DAG: cmp.ult.d $[[T0:f[0-9]+]], $f12, $f14
903 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
904 ; MMR6-DAG: andi16 $2, $[[T1]], 1
906 %1 = fcmp ult double %a, %b
907 %2 = zext i1 %1 to i32
911 define i32 @ule_f64(double %a, double %b) nounwind {
912 ; ALL-LABEL: ule_f64:
914 ; 32-C-DAG: addiu $2, $zero, 1
915 ; 32-C-DAG: c.ule.d $f12, $f14
916 ; 32-C: movf $2, $zero, $fcc0
918 ; 64-C-DAG: addiu $2, $zero, 1
919 ; 64-C-DAG: c.ule.d $f12, $f13
920 ; 64-C: movf $2, $zero, $fcc0
922 ; 32-CMP-DAG: cmp.ule.d $[[T0:f[0-9]+]], $f12, $f14
923 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
924 ; 32-CMP-DAG: andi $2, $[[T1]], 1
926 ; 64-CMP-DAG: cmp.ule.d $[[T0:f[0-9]+]], $f12, $f13
927 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
928 ; 64-CMP-DAG: andi $2, $[[T1]], 1
930 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
931 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
932 ; MM32R3-DAG: c.ule.d $f12, $f14
933 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
935 ; MM32R6-DAG: cmp.ule.d $[[T0:f[0-9]+]], $f12, $f14
936 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
937 ; MMR6-DAG: andi16 $2, $[[T1]], 1
939 %1 = fcmp ule double %a, %b
940 %2 = zext i1 %1 to i32
944 define i32 @une_f64(double %a, double %b) nounwind {
945 ; ALL-LABEL: une_f64:
947 ; 32-C-DAG: addiu $2, $zero, 1
948 ; 32-C-DAG: c.eq.d $f12, $f14
949 ; 32-C: movt $2, $zero, $fcc0
951 ; 64-C-DAG: addiu $2, $zero, 1
952 ; 64-C-DAG: c.eq.d $f12, $f13
953 ; 64-C: movt $2, $zero, $fcc0
955 ; 32-CMP-DAG: cmp.eq.d $[[T0:f[0-9]+]], $f12, $f14
956 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
957 ; 32-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
958 ; 32-CMP-DAG: andi $2, $[[T2]], 1
960 ; 64-CMP-DAG: cmp.eq.d $[[T0:f[0-9]+]], $f12, $f13
961 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
962 ; 64-CMP-DAG: not $[[T2:[0-9]+]], $[[T1]]
963 ; 64-CMP-DAG: andi $2, $[[T2]], 1
965 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
966 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
967 ; MM32R3-DAG: c.eq.d $f12, $f14
968 ; MM32R3-DAG: movt $[[T1]], $[[T0]], $fcc0
970 ; MM32R6-DAG: cmp.eq.d $[[T0:f[0-9]+]], $f12, $f14
971 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
972 ; MMR6-DAG: not $[[T2:[0-9]+]], $[[T1]]
973 ; MMR6-DAG: andi16 $2, $[[T2]], 1
975 %1 = fcmp une double %a, %b
976 %2 = zext i1 %1 to i32
980 define i32 @uno_f64(double %a, double %b) nounwind {
981 ; ALL-LABEL: uno_f64:
983 ; 32-C-DAG: addiu $2, $zero, 1
984 ; 32-C-DAG: c.un.d $f12, $f14
985 ; 32-C: movf $2, $zero, $fcc0
987 ; 64-C-DAG: addiu $2, $zero, 1
988 ; 64-C-DAG: c.un.d $f12, $f13
989 ; 64-C: movf $2, $zero, $fcc0
991 ; 32-CMP-DAG: cmp.un.d $[[T0:f[0-9]+]], $f12, $f14
992 ; 32-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
993 ; 32-CMP-DAG: andi $2, $[[T1]], 1
995 ; 64-CMP-DAG: cmp.un.d $[[T0:f[0-9]+]], $f12, $f13
996 ; 64-CMP-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
997 ; 64-CMP-DAG: andi $2, $[[T1]], 1
999 ; MM32R3-DAG: li16 $[[T0:[0-9]+]], 0
1000 ; MM32R3-DAG: li16 $[[T1:[0-9]+]], 1
1001 ; MM32R3-DAG: c.un.d $f12, $f14
1002 ; MM32R3-DAG: movf $[[T1]], $[[T0]], $fcc0
1004 ; MM32R6-DAG: cmp.un.d $[[T0:f[0-9]+]], $f12, $f14
1005 ; MMR6-DAG: mfc1 $[[T1:[0-9]+]], $[[T0]]
1006 ; MMR6-DAG: andi16 $2, $[[T1]], 1
1008 %1 = fcmp uno double %a, %b
1009 %2 = zext i1 %1 to i32
1013 define i32 @true_f64(double %a, double %b) nounwind {
1014 ; ALL-LABEL: true_f64:
1015 ; 32-C: addiu $2, $zero, 1
1017 ; 32-CMP: addiu $2, $zero, 1
1019 ; 64-C: addiu $2, $zero, 1
1021 ; 64-CMP: addiu $2, $zero, 1
1023 ; MM-DAG: li16 $2, 1
1025 %1 = fcmp true double %a, %b
1026 %2 = zext i1 %1 to i32
1030 ; The optimizers sometimes produce setlt instead of setolt/setult.
1031 define float @bug1_f32(float %angle, float %at) #0 {
1033 ; ALL-LABEL: bug1_f32:
1035 ; 32-C-DAG: add.s $[[T0:f[0-9]+]], $f14, $f12
1036 ; 32-C-DAG: lwc1 $[[T1:f[0-9]+]], %lo($CPI32_0)(
1037 ; 32-C-DAG: c.ole.s $[[T0]], $[[T1]]
1040 ; 32-CMP-DAG: add.s $[[T0:f[0-9]+]], $f14, $f12
1041 ; 32-CMP-DAG: lwc1 $[[T1:f[0-9]+]], %lo($CPI32_0)(
1042 ; 32-CMP-DAG: cmp.le.s $[[T2:f[0-9]+]], $[[T0]], $[[T1]]
1043 ; 32-CMP-DAG: mfc1 $[[T3:[0-9]+]], $[[T2]]
1044 ; FIXME: This instruction is redundant.
1045 ; 32-CMP-DAG: andi $[[T4:[0-9]+]], $[[T3]], 1
1046 ; 32-CMP-DAG: bnezc $[[T4]],
1048 ; 64-C-DAG: add.s $[[T0:f[0-9]+]], $f13, $f12
1049 ; 64-C-DAG: lwc1 $[[T1:f[0-9]+]], %lo(.LCPI32_0)(
1050 ; 64-C-DAG: c.ole.s $[[T0]], $[[T1]]
1053 ; 64-CMP-DAG: add.s $[[T0:f[0-9]+]], $f13, $f12
1054 ; 64-CMP-DAG: lwc1 $[[T1:f[0-9]+]], %lo(.LCPI32_0)(
1055 ; 64-CMP-DAG: cmp.le.s $[[T2:f[0-9]+]], $[[T0]], $[[T1]]
1056 ; 64-CMP-DAG: mfc1 $[[T3:[0-9]+]], $[[T2]]
1057 ; FIXME: This instruction is redundant.
1058 ; 64-CMP-DAG: andi $[[T4:[0-9]+]], $[[T3]], 1
1059 ; 64-CMP-DAG: bnezc $[[T4]],
1061 ; MM32R3-DAG: add.s $[[T0:f[0-9]+]], $f14, $f12
1062 ; MM32R3-DAG: lui $[[T1:[0-9]+]], %hi($CPI32_0)
1063 ; MM32R3-DAG: lwc1 $[[T2:f[0-9]+]], %lo($CPI32_0)($[[T1]])
1064 ; MM32R3-DAG: c.ole.s $[[T0]], $[[T2]]
1067 ; MM32R6-DAG: add.s $[[T0:f[0-9]+]], $f14, $f12
1068 ; MM32R6-DAG: lui $[[T1:[0-9]+]], %hi($CPI32_0)
1069 ; MM32R6-DAG: lwc1 $[[T2:f[0-9]+]], %lo($CPI32_0)($[[T1]])
1070 ; MM32R6-DAG: cmp.le.s $[[T3:f[0-9]+]], $[[T0]], $[[T2]]
1071 ; MM32R6-DAG: mfc1 $[[T4:[0-9]+]], $[[T3:f[0-9]+]]
1072 ; MM32R6-DAG: andi16 $[[T5:[0-9]+]], $[[T4]], 1
1073 ; MM32R6-DAG: bnezc $[[T5]],
1075 %add = fadd fast float %at, %angle
1076 %cmp = fcmp ogt float %add, 1.000000e+00
1077 br i1 %cmp, label %if.then, label %if.end
1080 %sub = fadd fast float %add, -1.000000e+00
1084 %theta.0 = phi float [ %sub, %if.then ], [ %add, %entry ]
1088 ; The optimizers sometimes produce setlt instead of setolt/setult.
1089 define double @bug1_f64(double %angle, double %at) #0 {
1091 ; ALL-LABEL: bug1_f64:
1093 ; 32-C-DAG: add.d $[[T0:f[0-9]+]], $f14, $f12
1094 ; 32-C-DAG: ldc1 $[[T1:f[0-9]+]], %lo($CPI33_0)(
1095 ; 32-C-DAG: c.ole.d $[[T0]], $[[T1]]
1098 ; 32-CMP-DAG: add.d $[[T0:f[0-9]+]], $f14, $f12
1099 ; 32-CMP-DAG: ldc1 $[[T1:f[0-9]+]], %lo($CPI33_0)(
1100 ; 32-CMP-DAG: cmp.le.d $[[T2:f[0-9]+]], $[[T0]], $[[T1]]
1101 ; 32-CMP-DAG: mfc1 $[[T3:[0-9]+]], $[[T2]]
1102 ; FIXME: This instruction is redundant.
1103 ; 32-CMP-DAG: andi $[[T4:[0-9]+]], $[[T3]], 1
1104 ; 32-CMP-DAG: bnezc $[[T4]],
1106 ; 64-C-DAG: add.d $[[T0:f[0-9]+]], $f13, $f12
1107 ; 64-C-DAG: ldc1 $[[T1:f[0-9]+]], %lo(.LCPI33_0)(
1108 ; 64-C-DAG: c.ole.d $[[T0]], $[[T1]]
1111 ; 64-CMP-DAG: add.d $[[T0:f[0-9]+]], $f13, $f12
1112 ; 64-CMP-DAG: ldc1 $[[T1:f[0-9]+]], %lo(.LCPI33_0)(
1113 ; 64-CMP-DAG: cmp.le.d $[[T2:f[0-9]+]], $[[T0]], $[[T1]]
1114 ; 64-CMP-DAG: mfc1 $[[T3:[0-9]+]], $[[T2]]
1115 ; FIXME: This instruction is redundant.
1116 ; 64-CMP-DAG: andi $[[T4:[0-9]+]], $[[T3]], 1
1117 ; 64-CMP-DAG: bnezc $[[T4]],
1119 ; MM32R3-DAG: add.d $[[T0:f[0-9]+]], $f14, $f12
1120 ; MM32R3-DAG: lui $[[T1:[0-9]+]], %hi($CPI33_0)
1121 ; MM32R3-DAG: ldc1 $[[T2:f[0-9]+]], %lo($CPI33_0)($[[T1]])
1122 ; MM32R3-DAG: c.ole.d $[[T0]], $[[T2]]
1125 ; MM32R6-DAG: add.d $[[T0:f[0-9]+]], $f14, $f12
1126 ; MM32R6-DAG: lui $[[T1:[0-9]+]], %hi($CPI33_0)
1127 ; MM32R6-DAG: ldc1 $[[T2:f[0-9]+]], %lo($CPI33_0)($[[T1]])
1128 ; MM32R6-DAG: cmp.le.d $[[T3:f[0-9]+]], $[[T0]], $[[T2]]
1129 ; MM32R6-DAG: mfc1 $[[T4:[0-9]+]], $[[T3]]
1130 ; MM32R6-DAG: andi16 $[[T5:[0-9]+]], $[[T4]], 1
1131 ; MM32R6-DAG: bnezc $[[T5]],
1133 %add = fadd fast double %at, %angle
1134 %cmp = fcmp ogt double %add, 1.000000e+00
1135 br i1 %cmp, label %if.then, label %if.end
1138 %sub = fadd fast double %add, -1.000000e+00
1142 %theta.0 = phi double [ %sub, %if.then ], [ %add, %entry ]
1146 attributes #0 = { nounwind readnone "no-nans-fp-math"="true" }