1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=i686-- -mcpu pentium4 < %s | FileCheck %s -check-prefix=SSE
3 ; RUN: llc -mtriple=i686-- -mcpu pentium3 < %s | FileCheck %s -check-prefixes=NOSSE,NOSSE2
4 ; RUN: llc -mtriple=i686-- -mcpu pentium2 < %s | FileCheck %s -check-prefixes=NOSSE,NOSSE1
5 ; RUN: llc -mtriple=i686-- -mcpu pentium < %s | FileCheck %s -check-prefix=NOCMOV
8 define double @test1(i32 %a, i32 %b, double %x) nounwind {
11 ; SSE-NEXT: pushl %ebp
12 ; SSE-NEXT: movl %esp, %ebp
13 ; SSE-NEXT: andl $-8, %esp
14 ; SSE-NEXT: subl $8, %esp
15 ; SSE-NEXT: movl 8(%ebp), %eax
16 ; SSE-NEXT: cmpl 12(%ebp), %eax
17 ; SSE-NEXT: ja .LBB0_1
19 ; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
20 ; SSE-NEXT: jmp .LBB0_3
22 ; SSE-NEXT: movsd {{.*#+}} xmm0 = [9.9E+1,0.0E+0]
24 ; SSE-NEXT: movsd %xmm0, (%esp)
25 ; SSE-NEXT: fldl (%esp)
26 ; SSE-NEXT: movl %ebp, %esp
32 ; NOSSE-NEXT: fldl {{[0-9]+}}(%esp)
33 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
34 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
35 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
36 ; NOSSE-NEXT: fxch %st(1)
37 ; NOSSE-NEXT: fcmovnbe %st(1), %st
38 ; NOSSE-NEXT: fstp %st(1)
41 ; NOCMOV-LABEL: test1:
43 ; NOCMOV-NEXT: fldl {{[0-9]+}}(%esp)
44 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
45 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
46 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
47 ; NOCMOV-NEXT: ja .LBB0_2
48 ; NOCMOV-NEXT: # %bb.1:
49 ; NOCMOV-NEXT: fstp %st(0)
51 ; NOCMOV-NEXT: fxch %st(1)
52 ; NOCMOV-NEXT: .LBB0_2:
53 ; NOCMOV-NEXT: fstp %st(1)
55 %cmp = icmp ugt i32 %a, %b
56 %sel = select i1 %cmp, double 99.0, double %x
60 define double @test2(i32 %a, i32 %b, double %x) nounwind {
63 ; SSE-NEXT: pushl %ebp
64 ; SSE-NEXT: movl %esp, %ebp
65 ; SSE-NEXT: andl $-8, %esp
66 ; SSE-NEXT: subl $8, %esp
67 ; SSE-NEXT: movl 8(%ebp), %eax
68 ; SSE-NEXT: cmpl 12(%ebp), %eax
69 ; SSE-NEXT: jae .LBB1_1
71 ; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
72 ; SSE-NEXT: jmp .LBB1_3
74 ; SSE-NEXT: movsd {{.*#+}} xmm0 = [9.9E+1,0.0E+0]
76 ; SSE-NEXT: movsd %xmm0, (%esp)
77 ; SSE-NEXT: fldl (%esp)
78 ; SSE-NEXT: movl %ebp, %esp
84 ; NOSSE-NEXT: fldl {{[0-9]+}}(%esp)
85 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
86 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
87 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
88 ; NOSSE-NEXT: fxch %st(1)
89 ; NOSSE-NEXT: fcmovnb %st(1), %st
90 ; NOSSE-NEXT: fstp %st(1)
93 ; NOCMOV-LABEL: test2:
95 ; NOCMOV-NEXT: fldl {{[0-9]+}}(%esp)
96 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
97 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
98 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
99 ; NOCMOV-NEXT: jae .LBB1_2
100 ; NOCMOV-NEXT: # %bb.1:
101 ; NOCMOV-NEXT: fstp %st(0)
103 ; NOCMOV-NEXT: fxch %st(1)
104 ; NOCMOV-NEXT: .LBB1_2:
105 ; NOCMOV-NEXT: fstp %st(1)
107 %cmp = icmp uge i32 %a, %b
108 %sel = select i1 %cmp, double 99.0, double %x
112 define double @test3(i32 %a, i32 %b, double %x) nounwind {
115 ; SSE-NEXT: pushl %ebp
116 ; SSE-NEXT: movl %esp, %ebp
117 ; SSE-NEXT: andl $-8, %esp
118 ; SSE-NEXT: subl $8, %esp
119 ; SSE-NEXT: movl 8(%ebp), %eax
120 ; SSE-NEXT: cmpl 12(%ebp), %eax
121 ; SSE-NEXT: jb .LBB2_1
123 ; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
124 ; SSE-NEXT: jmp .LBB2_3
126 ; SSE-NEXT: movsd {{.*#+}} xmm0 = [9.9E+1,0.0E+0]
128 ; SSE-NEXT: movsd %xmm0, (%esp)
129 ; SSE-NEXT: fldl (%esp)
130 ; SSE-NEXT: movl %ebp, %esp
131 ; SSE-NEXT: popl %ebp
134 ; NOSSE-LABEL: test3:
136 ; NOSSE-NEXT: fldl {{[0-9]+}}(%esp)
137 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
138 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
139 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
140 ; NOSSE-NEXT: fxch %st(1)
141 ; NOSSE-NEXT: fcmovb %st(1), %st
142 ; NOSSE-NEXT: fstp %st(1)
145 ; NOCMOV-LABEL: test3:
147 ; NOCMOV-NEXT: fldl {{[0-9]+}}(%esp)
148 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
149 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
150 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
151 ; NOCMOV-NEXT: jb .LBB2_2
152 ; NOCMOV-NEXT: # %bb.1:
153 ; NOCMOV-NEXT: fstp %st(0)
155 ; NOCMOV-NEXT: fxch %st(1)
156 ; NOCMOV-NEXT: .LBB2_2:
157 ; NOCMOV-NEXT: fstp %st(1)
159 %cmp = icmp ult i32 %a, %b
160 %sel = select i1 %cmp, double 99.0, double %x
164 define double @test4(i32 %a, i32 %b, double %x) nounwind {
167 ; SSE-NEXT: pushl %ebp
168 ; SSE-NEXT: movl %esp, %ebp
169 ; SSE-NEXT: andl $-8, %esp
170 ; SSE-NEXT: subl $8, %esp
171 ; SSE-NEXT: movl 8(%ebp), %eax
172 ; SSE-NEXT: cmpl 12(%ebp), %eax
173 ; SSE-NEXT: jbe .LBB3_1
175 ; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
176 ; SSE-NEXT: jmp .LBB3_3
178 ; SSE-NEXT: movsd {{.*#+}} xmm0 = [9.9E+1,0.0E+0]
180 ; SSE-NEXT: movsd %xmm0, (%esp)
181 ; SSE-NEXT: fldl (%esp)
182 ; SSE-NEXT: movl %ebp, %esp
183 ; SSE-NEXT: popl %ebp
186 ; NOSSE-LABEL: test4:
188 ; NOSSE-NEXT: fldl {{[0-9]+}}(%esp)
189 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
190 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
191 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
192 ; NOSSE-NEXT: fxch %st(1)
193 ; NOSSE-NEXT: fcmovbe %st(1), %st
194 ; NOSSE-NEXT: fstp %st(1)
197 ; NOCMOV-LABEL: test4:
199 ; NOCMOV-NEXT: fldl {{[0-9]+}}(%esp)
200 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
201 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
202 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
203 ; NOCMOV-NEXT: jbe .LBB3_2
204 ; NOCMOV-NEXT: # %bb.1:
205 ; NOCMOV-NEXT: fstp %st(0)
207 ; NOCMOV-NEXT: fxch %st(1)
208 ; NOCMOV-NEXT: .LBB3_2:
209 ; NOCMOV-NEXT: fstp %st(1)
211 %cmp = icmp ule i32 %a, %b
212 %sel = select i1 %cmp, double 99.0, double %x
216 define double @test5(i32 %a, i32 %b, double %x) nounwind {
219 ; SSE-NEXT: pushl %ebp
220 ; SSE-NEXT: movl %esp, %ebp
221 ; SSE-NEXT: andl $-8, %esp
222 ; SSE-NEXT: subl $8, %esp
223 ; SSE-NEXT: movl 8(%ebp), %eax
224 ; SSE-NEXT: cmpl 12(%ebp), %eax
225 ; SSE-NEXT: jg .LBB4_1
227 ; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
228 ; SSE-NEXT: jmp .LBB4_3
230 ; SSE-NEXT: movsd {{.*#+}} xmm0 = [9.9E+1,0.0E+0]
232 ; SSE-NEXT: movsd %xmm0, (%esp)
233 ; SSE-NEXT: fldl (%esp)
234 ; SSE-NEXT: movl %ebp, %esp
235 ; SSE-NEXT: popl %ebp
238 ; NOSSE-LABEL: test5:
240 ; NOSSE-NEXT: fldl {{[0-9]+}}(%esp)
241 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
242 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
243 ; NOSSE-NEXT: setg %al
244 ; NOSSE-NEXT: testb %al, %al
245 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
246 ; NOSSE-NEXT: fxch %st(1)
247 ; NOSSE-NEXT: fcmovne %st(1), %st
248 ; NOSSE-NEXT: fstp %st(1)
251 ; NOCMOV-LABEL: test5:
253 ; NOCMOV-NEXT: fldl {{[0-9]+}}(%esp)
254 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
255 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
256 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
257 ; NOCMOV-NEXT: jg .LBB4_2
258 ; NOCMOV-NEXT: # %bb.1:
259 ; NOCMOV-NEXT: fstp %st(0)
261 ; NOCMOV-NEXT: fxch %st(1)
262 ; NOCMOV-NEXT: .LBB4_2:
263 ; NOCMOV-NEXT: fstp %st(1)
265 %cmp = icmp sgt i32 %a, %b
266 %sel = select i1 %cmp, double 99.0, double %x
270 define double @test6(i32 %a, i32 %b, double %x) nounwind {
273 ; SSE-NEXT: pushl %ebp
274 ; SSE-NEXT: movl %esp, %ebp
275 ; SSE-NEXT: andl $-8, %esp
276 ; SSE-NEXT: subl $8, %esp
277 ; SSE-NEXT: movl 8(%ebp), %eax
278 ; SSE-NEXT: cmpl 12(%ebp), %eax
279 ; SSE-NEXT: jge .LBB5_1
281 ; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
282 ; SSE-NEXT: jmp .LBB5_3
284 ; SSE-NEXT: movsd {{.*#+}} xmm0 = [9.9E+1,0.0E+0]
286 ; SSE-NEXT: movsd %xmm0, (%esp)
287 ; SSE-NEXT: fldl (%esp)
288 ; SSE-NEXT: movl %ebp, %esp
289 ; SSE-NEXT: popl %ebp
292 ; NOSSE-LABEL: test6:
294 ; NOSSE-NEXT: fldl {{[0-9]+}}(%esp)
295 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
296 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
297 ; NOSSE-NEXT: setge %al
298 ; NOSSE-NEXT: testb %al, %al
299 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
300 ; NOSSE-NEXT: fxch %st(1)
301 ; NOSSE-NEXT: fcmovne %st(1), %st
302 ; NOSSE-NEXT: fstp %st(1)
305 ; NOCMOV-LABEL: test6:
307 ; NOCMOV-NEXT: fldl {{[0-9]+}}(%esp)
308 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
309 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
310 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
311 ; NOCMOV-NEXT: jge .LBB5_2
312 ; NOCMOV-NEXT: # %bb.1:
313 ; NOCMOV-NEXT: fstp %st(0)
315 ; NOCMOV-NEXT: fxch %st(1)
316 ; NOCMOV-NEXT: .LBB5_2:
317 ; NOCMOV-NEXT: fstp %st(1)
319 %cmp = icmp sge i32 %a, %b
320 %sel = select i1 %cmp, double 99.0, double %x
324 define double @test7(i32 %a, i32 %b, double %x) nounwind {
327 ; SSE-NEXT: pushl %ebp
328 ; SSE-NEXT: movl %esp, %ebp
329 ; SSE-NEXT: andl $-8, %esp
330 ; SSE-NEXT: subl $8, %esp
331 ; SSE-NEXT: movl 8(%ebp), %eax
332 ; SSE-NEXT: cmpl 12(%ebp), %eax
333 ; SSE-NEXT: jl .LBB6_1
335 ; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
336 ; SSE-NEXT: jmp .LBB6_3
338 ; SSE-NEXT: movsd {{.*#+}} xmm0 = [9.9E+1,0.0E+0]
340 ; SSE-NEXT: movsd %xmm0, (%esp)
341 ; SSE-NEXT: fldl (%esp)
342 ; SSE-NEXT: movl %ebp, %esp
343 ; SSE-NEXT: popl %ebp
346 ; NOSSE-LABEL: test7:
348 ; NOSSE-NEXT: fldl {{[0-9]+}}(%esp)
349 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
350 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
351 ; NOSSE-NEXT: setl %al
352 ; NOSSE-NEXT: testb %al, %al
353 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
354 ; NOSSE-NEXT: fxch %st(1)
355 ; NOSSE-NEXT: fcmovne %st(1), %st
356 ; NOSSE-NEXT: fstp %st(1)
359 ; NOCMOV-LABEL: test7:
361 ; NOCMOV-NEXT: fldl {{[0-9]+}}(%esp)
362 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
363 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
364 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
365 ; NOCMOV-NEXT: jl .LBB6_2
366 ; NOCMOV-NEXT: # %bb.1:
367 ; NOCMOV-NEXT: fstp %st(0)
369 ; NOCMOV-NEXT: fxch %st(1)
370 ; NOCMOV-NEXT: .LBB6_2:
371 ; NOCMOV-NEXT: fstp %st(1)
373 %cmp = icmp slt i32 %a, %b
374 %sel = select i1 %cmp, double 99.0, double %x
378 define double @test8(i32 %a, i32 %b, double %x) nounwind {
381 ; SSE-NEXT: pushl %ebp
382 ; SSE-NEXT: movl %esp, %ebp
383 ; SSE-NEXT: andl $-8, %esp
384 ; SSE-NEXT: subl $8, %esp
385 ; SSE-NEXT: movl 8(%ebp), %eax
386 ; SSE-NEXT: cmpl 12(%ebp), %eax
387 ; SSE-NEXT: jle .LBB7_1
389 ; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
390 ; SSE-NEXT: jmp .LBB7_3
392 ; SSE-NEXT: movsd {{.*#+}} xmm0 = [9.9E+1,0.0E+0]
394 ; SSE-NEXT: movsd %xmm0, (%esp)
395 ; SSE-NEXT: fldl (%esp)
396 ; SSE-NEXT: movl %ebp, %esp
397 ; SSE-NEXT: popl %ebp
400 ; NOSSE-LABEL: test8:
402 ; NOSSE-NEXT: fldl {{[0-9]+}}(%esp)
403 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
404 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
405 ; NOSSE-NEXT: setle %al
406 ; NOSSE-NEXT: testb %al, %al
407 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
408 ; NOSSE-NEXT: fxch %st(1)
409 ; NOSSE-NEXT: fcmovne %st(1), %st
410 ; NOSSE-NEXT: fstp %st(1)
413 ; NOCMOV-LABEL: test8:
415 ; NOCMOV-NEXT: fldl {{[0-9]+}}(%esp)
416 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
417 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
418 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
419 ; NOCMOV-NEXT: jle .LBB7_2
420 ; NOCMOV-NEXT: # %bb.1:
421 ; NOCMOV-NEXT: fstp %st(0)
423 ; NOCMOV-NEXT: fxch %st(1)
424 ; NOCMOV-NEXT: .LBB7_2:
425 ; NOCMOV-NEXT: fstp %st(1)
427 %cmp = icmp sle i32 %a, %b
428 %sel = select i1 %cmp, double 99.0, double %x
432 define float @test9(i32 %a, i32 %b, float %x) nounwind {
435 ; SSE-NEXT: pushl %eax
436 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
437 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
438 ; SSE-NEXT: ja .LBB8_1
440 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
441 ; SSE-NEXT: jmp .LBB8_3
443 ; SSE-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
445 ; SSE-NEXT: movss %xmm0, (%esp)
446 ; SSE-NEXT: flds (%esp)
447 ; SSE-NEXT: popl %eax
450 ; NOSSE2-LABEL: test9:
452 ; NOSSE2-NEXT: pushl %eax
453 ; NOSSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
454 ; NOSSE2-NEXT: cmpl {{[0-9]+}}(%esp), %eax
455 ; NOSSE2-NEXT: ja .LBB8_1
456 ; NOSSE2-NEXT: # %bb.2:
457 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
458 ; NOSSE2-NEXT: jmp .LBB8_3
459 ; NOSSE2-NEXT: .LBB8_1:
460 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
461 ; NOSSE2-NEXT: .LBB8_3:
462 ; NOSSE2-NEXT: movss %xmm0, (%esp)
463 ; NOSSE2-NEXT: flds (%esp)
464 ; NOSSE2-NEXT: popl %eax
467 ; NOSSE1-LABEL: test9:
469 ; NOSSE1-NEXT: flds {{[0-9]+}}(%esp)
470 ; NOSSE1-NEXT: movl {{[0-9]+}}(%esp), %eax
471 ; NOSSE1-NEXT: cmpl {{[0-9]+}}(%esp), %eax
472 ; NOSSE1-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
473 ; NOSSE1-NEXT: fxch %st(1)
474 ; NOSSE1-NEXT: fcmovnbe %st(1), %st
475 ; NOSSE1-NEXT: fstp %st(1)
478 ; NOCMOV-LABEL: test9:
480 ; NOCMOV-NEXT: flds {{[0-9]+}}(%esp)
481 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
482 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
483 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
484 ; NOCMOV-NEXT: ja .LBB8_2
485 ; NOCMOV-NEXT: # %bb.1:
486 ; NOCMOV-NEXT: fstp %st(0)
488 ; NOCMOV-NEXT: fxch %st(1)
489 ; NOCMOV-NEXT: .LBB8_2:
490 ; NOCMOV-NEXT: fstp %st(1)
492 %cmp = icmp ugt i32 %a, %b
493 %sel = select i1 %cmp, float 99.0, float %x
497 define float @test10(i32 %a, i32 %b, float %x) nounwind {
500 ; SSE-NEXT: pushl %eax
501 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
502 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
503 ; SSE-NEXT: jae .LBB9_1
505 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
506 ; SSE-NEXT: jmp .LBB9_3
508 ; SSE-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
510 ; SSE-NEXT: movss %xmm0, (%esp)
511 ; SSE-NEXT: flds (%esp)
512 ; SSE-NEXT: popl %eax
515 ; NOSSE2-LABEL: test10:
517 ; NOSSE2-NEXT: pushl %eax
518 ; NOSSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
519 ; NOSSE2-NEXT: cmpl {{[0-9]+}}(%esp), %eax
520 ; NOSSE2-NEXT: jae .LBB9_1
521 ; NOSSE2-NEXT: # %bb.2:
522 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
523 ; NOSSE2-NEXT: jmp .LBB9_3
524 ; NOSSE2-NEXT: .LBB9_1:
525 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
526 ; NOSSE2-NEXT: .LBB9_3:
527 ; NOSSE2-NEXT: movss %xmm0, (%esp)
528 ; NOSSE2-NEXT: flds (%esp)
529 ; NOSSE2-NEXT: popl %eax
532 ; NOSSE1-LABEL: test10:
534 ; NOSSE1-NEXT: flds {{[0-9]+}}(%esp)
535 ; NOSSE1-NEXT: movl {{[0-9]+}}(%esp), %eax
536 ; NOSSE1-NEXT: cmpl {{[0-9]+}}(%esp), %eax
537 ; NOSSE1-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
538 ; NOSSE1-NEXT: fxch %st(1)
539 ; NOSSE1-NEXT: fcmovnb %st(1), %st
540 ; NOSSE1-NEXT: fstp %st(1)
543 ; NOCMOV-LABEL: test10:
545 ; NOCMOV-NEXT: flds {{[0-9]+}}(%esp)
546 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
547 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
548 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
549 ; NOCMOV-NEXT: jae .LBB9_2
550 ; NOCMOV-NEXT: # %bb.1:
551 ; NOCMOV-NEXT: fstp %st(0)
553 ; NOCMOV-NEXT: fxch %st(1)
554 ; NOCMOV-NEXT: .LBB9_2:
555 ; NOCMOV-NEXT: fstp %st(1)
557 %cmp = icmp uge i32 %a, %b
558 %sel = select i1 %cmp, float 99.0, float %x
562 define float @test11(i32 %a, i32 %b, float %x) nounwind {
565 ; SSE-NEXT: pushl %eax
566 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
567 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
568 ; SSE-NEXT: jb .LBB10_1
570 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
571 ; SSE-NEXT: jmp .LBB10_3
572 ; SSE-NEXT: .LBB10_1:
573 ; SSE-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
574 ; SSE-NEXT: .LBB10_3:
575 ; SSE-NEXT: movss %xmm0, (%esp)
576 ; SSE-NEXT: flds (%esp)
577 ; SSE-NEXT: popl %eax
580 ; NOSSE2-LABEL: test11:
582 ; NOSSE2-NEXT: pushl %eax
583 ; NOSSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
584 ; NOSSE2-NEXT: cmpl {{[0-9]+}}(%esp), %eax
585 ; NOSSE2-NEXT: jb .LBB10_1
586 ; NOSSE2-NEXT: # %bb.2:
587 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
588 ; NOSSE2-NEXT: jmp .LBB10_3
589 ; NOSSE2-NEXT: .LBB10_1:
590 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
591 ; NOSSE2-NEXT: .LBB10_3:
592 ; NOSSE2-NEXT: movss %xmm0, (%esp)
593 ; NOSSE2-NEXT: flds (%esp)
594 ; NOSSE2-NEXT: popl %eax
597 ; NOSSE1-LABEL: test11:
599 ; NOSSE1-NEXT: flds {{[0-9]+}}(%esp)
600 ; NOSSE1-NEXT: movl {{[0-9]+}}(%esp), %eax
601 ; NOSSE1-NEXT: cmpl {{[0-9]+}}(%esp), %eax
602 ; NOSSE1-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
603 ; NOSSE1-NEXT: fxch %st(1)
604 ; NOSSE1-NEXT: fcmovb %st(1), %st
605 ; NOSSE1-NEXT: fstp %st(1)
608 ; NOCMOV-LABEL: test11:
610 ; NOCMOV-NEXT: flds {{[0-9]+}}(%esp)
611 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
612 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
613 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
614 ; NOCMOV-NEXT: jb .LBB10_2
615 ; NOCMOV-NEXT: # %bb.1:
616 ; NOCMOV-NEXT: fstp %st(0)
618 ; NOCMOV-NEXT: fxch %st(1)
619 ; NOCMOV-NEXT: .LBB10_2:
620 ; NOCMOV-NEXT: fstp %st(1)
622 %cmp = icmp ult i32 %a, %b
623 %sel = select i1 %cmp, float 99.0, float %x
627 define float @test12(i32 %a, i32 %b, float %x) nounwind {
630 ; SSE-NEXT: pushl %eax
631 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
632 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
633 ; SSE-NEXT: jbe .LBB11_1
635 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
636 ; SSE-NEXT: jmp .LBB11_3
637 ; SSE-NEXT: .LBB11_1:
638 ; SSE-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
639 ; SSE-NEXT: .LBB11_3:
640 ; SSE-NEXT: movss %xmm0, (%esp)
641 ; SSE-NEXT: flds (%esp)
642 ; SSE-NEXT: popl %eax
645 ; NOSSE2-LABEL: test12:
647 ; NOSSE2-NEXT: pushl %eax
648 ; NOSSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
649 ; NOSSE2-NEXT: cmpl {{[0-9]+}}(%esp), %eax
650 ; NOSSE2-NEXT: jbe .LBB11_1
651 ; NOSSE2-NEXT: # %bb.2:
652 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
653 ; NOSSE2-NEXT: jmp .LBB11_3
654 ; NOSSE2-NEXT: .LBB11_1:
655 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
656 ; NOSSE2-NEXT: .LBB11_3:
657 ; NOSSE2-NEXT: movss %xmm0, (%esp)
658 ; NOSSE2-NEXT: flds (%esp)
659 ; NOSSE2-NEXT: popl %eax
662 ; NOSSE1-LABEL: test12:
664 ; NOSSE1-NEXT: flds {{[0-9]+}}(%esp)
665 ; NOSSE1-NEXT: movl {{[0-9]+}}(%esp), %eax
666 ; NOSSE1-NEXT: cmpl {{[0-9]+}}(%esp), %eax
667 ; NOSSE1-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
668 ; NOSSE1-NEXT: fxch %st(1)
669 ; NOSSE1-NEXT: fcmovbe %st(1), %st
670 ; NOSSE1-NEXT: fstp %st(1)
673 ; NOCMOV-LABEL: test12:
675 ; NOCMOV-NEXT: flds {{[0-9]+}}(%esp)
676 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
677 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
678 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
679 ; NOCMOV-NEXT: jbe .LBB11_2
680 ; NOCMOV-NEXT: # %bb.1:
681 ; NOCMOV-NEXT: fstp %st(0)
683 ; NOCMOV-NEXT: fxch %st(1)
684 ; NOCMOV-NEXT: .LBB11_2:
685 ; NOCMOV-NEXT: fstp %st(1)
687 %cmp = icmp ule i32 %a, %b
688 %sel = select i1 %cmp, float 99.0, float %x
692 define float @test13(i32 %a, i32 %b, float %x) nounwind {
695 ; SSE-NEXT: pushl %eax
696 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
697 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
698 ; SSE-NEXT: jg .LBB12_1
700 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
701 ; SSE-NEXT: jmp .LBB12_3
702 ; SSE-NEXT: .LBB12_1:
703 ; SSE-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
704 ; SSE-NEXT: .LBB12_3:
705 ; SSE-NEXT: movss %xmm0, (%esp)
706 ; SSE-NEXT: flds (%esp)
707 ; SSE-NEXT: popl %eax
710 ; NOSSE2-LABEL: test13:
712 ; NOSSE2-NEXT: pushl %eax
713 ; NOSSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
714 ; NOSSE2-NEXT: cmpl {{[0-9]+}}(%esp), %eax
715 ; NOSSE2-NEXT: jg .LBB12_1
716 ; NOSSE2-NEXT: # %bb.2:
717 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
718 ; NOSSE2-NEXT: jmp .LBB12_3
719 ; NOSSE2-NEXT: .LBB12_1:
720 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
721 ; NOSSE2-NEXT: .LBB12_3:
722 ; NOSSE2-NEXT: movss %xmm0, (%esp)
723 ; NOSSE2-NEXT: flds (%esp)
724 ; NOSSE2-NEXT: popl %eax
727 ; NOSSE1-LABEL: test13:
729 ; NOSSE1-NEXT: flds {{[0-9]+}}(%esp)
730 ; NOSSE1-NEXT: movl {{[0-9]+}}(%esp), %eax
731 ; NOSSE1-NEXT: cmpl {{[0-9]+}}(%esp), %eax
732 ; NOSSE1-NEXT: setg %al
733 ; NOSSE1-NEXT: testb %al, %al
734 ; NOSSE1-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
735 ; NOSSE1-NEXT: fxch %st(1)
736 ; NOSSE1-NEXT: fcmovne %st(1), %st
737 ; NOSSE1-NEXT: fstp %st(1)
740 ; NOCMOV-LABEL: test13:
742 ; NOCMOV-NEXT: flds {{[0-9]+}}(%esp)
743 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
744 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
745 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
746 ; NOCMOV-NEXT: jg .LBB12_2
747 ; NOCMOV-NEXT: # %bb.1:
748 ; NOCMOV-NEXT: fstp %st(0)
750 ; NOCMOV-NEXT: fxch %st(1)
751 ; NOCMOV-NEXT: .LBB12_2:
752 ; NOCMOV-NEXT: fstp %st(1)
754 %cmp = icmp sgt i32 %a, %b
755 %sel = select i1 %cmp, float 99.0, float %x
759 define float @test14(i32 %a, i32 %b, float %x) nounwind {
762 ; SSE-NEXT: pushl %eax
763 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
764 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
765 ; SSE-NEXT: jge .LBB13_1
767 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
768 ; SSE-NEXT: jmp .LBB13_3
769 ; SSE-NEXT: .LBB13_1:
770 ; SSE-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
771 ; SSE-NEXT: .LBB13_3:
772 ; SSE-NEXT: movss %xmm0, (%esp)
773 ; SSE-NEXT: flds (%esp)
774 ; SSE-NEXT: popl %eax
777 ; NOSSE2-LABEL: test14:
779 ; NOSSE2-NEXT: pushl %eax
780 ; NOSSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
781 ; NOSSE2-NEXT: cmpl {{[0-9]+}}(%esp), %eax
782 ; NOSSE2-NEXT: jge .LBB13_1
783 ; NOSSE2-NEXT: # %bb.2:
784 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
785 ; NOSSE2-NEXT: jmp .LBB13_3
786 ; NOSSE2-NEXT: .LBB13_1:
787 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
788 ; NOSSE2-NEXT: .LBB13_3:
789 ; NOSSE2-NEXT: movss %xmm0, (%esp)
790 ; NOSSE2-NEXT: flds (%esp)
791 ; NOSSE2-NEXT: popl %eax
794 ; NOSSE1-LABEL: test14:
796 ; NOSSE1-NEXT: flds {{[0-9]+}}(%esp)
797 ; NOSSE1-NEXT: movl {{[0-9]+}}(%esp), %eax
798 ; NOSSE1-NEXT: cmpl {{[0-9]+}}(%esp), %eax
799 ; NOSSE1-NEXT: setge %al
800 ; NOSSE1-NEXT: testb %al, %al
801 ; NOSSE1-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
802 ; NOSSE1-NEXT: fxch %st(1)
803 ; NOSSE1-NEXT: fcmovne %st(1), %st
804 ; NOSSE1-NEXT: fstp %st(1)
807 ; NOCMOV-LABEL: test14:
809 ; NOCMOV-NEXT: flds {{[0-9]+}}(%esp)
810 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
811 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
812 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
813 ; NOCMOV-NEXT: jge .LBB13_2
814 ; NOCMOV-NEXT: # %bb.1:
815 ; NOCMOV-NEXT: fstp %st(0)
817 ; NOCMOV-NEXT: fxch %st(1)
818 ; NOCMOV-NEXT: .LBB13_2:
819 ; NOCMOV-NEXT: fstp %st(1)
821 %cmp = icmp sge i32 %a, %b
822 %sel = select i1 %cmp, float 99.0, float %x
826 define float @test15(i32 %a, i32 %b, float %x) nounwind {
829 ; SSE-NEXT: pushl %eax
830 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
831 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
832 ; SSE-NEXT: jl .LBB14_1
834 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
835 ; SSE-NEXT: jmp .LBB14_3
836 ; SSE-NEXT: .LBB14_1:
837 ; SSE-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
838 ; SSE-NEXT: .LBB14_3:
839 ; SSE-NEXT: movss %xmm0, (%esp)
840 ; SSE-NEXT: flds (%esp)
841 ; SSE-NEXT: popl %eax
844 ; NOSSE2-LABEL: test15:
846 ; NOSSE2-NEXT: pushl %eax
847 ; NOSSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
848 ; NOSSE2-NEXT: cmpl {{[0-9]+}}(%esp), %eax
849 ; NOSSE2-NEXT: jl .LBB14_1
850 ; NOSSE2-NEXT: # %bb.2:
851 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
852 ; NOSSE2-NEXT: jmp .LBB14_3
853 ; NOSSE2-NEXT: .LBB14_1:
854 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
855 ; NOSSE2-NEXT: .LBB14_3:
856 ; NOSSE2-NEXT: movss %xmm0, (%esp)
857 ; NOSSE2-NEXT: flds (%esp)
858 ; NOSSE2-NEXT: popl %eax
861 ; NOSSE1-LABEL: test15:
863 ; NOSSE1-NEXT: flds {{[0-9]+}}(%esp)
864 ; NOSSE1-NEXT: movl {{[0-9]+}}(%esp), %eax
865 ; NOSSE1-NEXT: cmpl {{[0-9]+}}(%esp), %eax
866 ; NOSSE1-NEXT: setl %al
867 ; NOSSE1-NEXT: testb %al, %al
868 ; NOSSE1-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
869 ; NOSSE1-NEXT: fxch %st(1)
870 ; NOSSE1-NEXT: fcmovne %st(1), %st
871 ; NOSSE1-NEXT: fstp %st(1)
874 ; NOCMOV-LABEL: test15:
876 ; NOCMOV-NEXT: flds {{[0-9]+}}(%esp)
877 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
878 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
879 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
880 ; NOCMOV-NEXT: jl .LBB14_2
881 ; NOCMOV-NEXT: # %bb.1:
882 ; NOCMOV-NEXT: fstp %st(0)
884 ; NOCMOV-NEXT: fxch %st(1)
885 ; NOCMOV-NEXT: .LBB14_2:
886 ; NOCMOV-NEXT: fstp %st(1)
888 %cmp = icmp slt i32 %a, %b
889 %sel = select i1 %cmp, float 99.0, float %x
893 define float @test16(i32 %a, i32 %b, float %x) nounwind {
896 ; SSE-NEXT: pushl %eax
897 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
898 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
899 ; SSE-NEXT: jle .LBB15_1
901 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
902 ; SSE-NEXT: jmp .LBB15_3
903 ; SSE-NEXT: .LBB15_1:
904 ; SSE-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
905 ; SSE-NEXT: .LBB15_3:
906 ; SSE-NEXT: movss %xmm0, (%esp)
907 ; SSE-NEXT: flds (%esp)
908 ; SSE-NEXT: popl %eax
911 ; NOSSE2-LABEL: test16:
913 ; NOSSE2-NEXT: pushl %eax
914 ; NOSSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
915 ; NOSSE2-NEXT: cmpl {{[0-9]+}}(%esp), %eax
916 ; NOSSE2-NEXT: jle .LBB15_1
917 ; NOSSE2-NEXT: # %bb.2:
918 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
919 ; NOSSE2-NEXT: jmp .LBB15_3
920 ; NOSSE2-NEXT: .LBB15_1:
921 ; NOSSE2-NEXT: movss {{.*#+}} xmm0 = [9.9E+1,0.0E+0,0.0E+0,0.0E+0]
922 ; NOSSE2-NEXT: .LBB15_3:
923 ; NOSSE2-NEXT: movss %xmm0, (%esp)
924 ; NOSSE2-NEXT: flds (%esp)
925 ; NOSSE2-NEXT: popl %eax
928 ; NOSSE1-LABEL: test16:
930 ; NOSSE1-NEXT: flds {{[0-9]+}}(%esp)
931 ; NOSSE1-NEXT: movl {{[0-9]+}}(%esp), %eax
932 ; NOSSE1-NEXT: cmpl {{[0-9]+}}(%esp), %eax
933 ; NOSSE1-NEXT: setle %al
934 ; NOSSE1-NEXT: testb %al, %al
935 ; NOSSE1-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
936 ; NOSSE1-NEXT: fxch %st(1)
937 ; NOSSE1-NEXT: fcmovne %st(1), %st
938 ; NOSSE1-NEXT: fstp %st(1)
941 ; NOCMOV-LABEL: test16:
943 ; NOCMOV-NEXT: flds {{[0-9]+}}(%esp)
944 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
945 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
946 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
947 ; NOCMOV-NEXT: jle .LBB15_2
948 ; NOCMOV-NEXT: # %bb.1:
949 ; NOCMOV-NEXT: fstp %st(0)
951 ; NOCMOV-NEXT: fxch %st(1)
952 ; NOCMOV-NEXT: .LBB15_2:
953 ; NOCMOV-NEXT: fstp %st(1)
955 %cmp = icmp sle i32 %a, %b
956 %sel = select i1 %cmp, float 99.0, float %x
960 define x86_fp80 @test17(i32 %a, i32 %b, x86_fp80 %x) nounwind {
963 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
964 ; SSE-NEXT: fldt {{[0-9]+}}(%esp)
965 ; SSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
966 ; SSE-NEXT: fxch %st(1)
967 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
968 ; SSE-NEXT: fcmovnbe %st(1), %st
969 ; SSE-NEXT: fstp %st(1)
972 ; NOSSE-LABEL: test17:
974 ; NOSSE-NEXT: fldt {{[0-9]+}}(%esp)
975 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
976 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
977 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
978 ; NOSSE-NEXT: fxch %st(1)
979 ; NOSSE-NEXT: fcmovnbe %st(1), %st
980 ; NOSSE-NEXT: fstp %st(1)
983 ; NOCMOV-LABEL: test17:
985 ; NOCMOV-NEXT: fldt {{[0-9]+}}(%esp)
986 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
987 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
988 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
989 ; NOCMOV-NEXT: ja .LBB16_2
990 ; NOCMOV-NEXT: # %bb.1:
991 ; NOCMOV-NEXT: fstp %st(0)
993 ; NOCMOV-NEXT: fxch %st(1)
994 ; NOCMOV-NEXT: .LBB16_2:
995 ; NOCMOV-NEXT: fstp %st(1)
997 %cmp = icmp ugt i32 %a, %b
998 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
1002 define x86_fp80 @test18(i32 %a, i32 %b, x86_fp80 %x) nounwind {
1003 ; SSE-LABEL: test18:
1005 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1006 ; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1007 ; SSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1008 ; SSE-NEXT: fxch %st(1)
1009 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1010 ; SSE-NEXT: fcmovnb %st(1), %st
1011 ; SSE-NEXT: fstp %st(1)
1014 ; NOSSE-LABEL: test18:
1016 ; NOSSE-NEXT: fldt {{[0-9]+}}(%esp)
1017 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1018 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1019 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1020 ; NOSSE-NEXT: fxch %st(1)
1021 ; NOSSE-NEXT: fcmovnb %st(1), %st
1022 ; NOSSE-NEXT: fstp %st(1)
1025 ; NOCMOV-LABEL: test18:
1027 ; NOCMOV-NEXT: fldt {{[0-9]+}}(%esp)
1028 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
1029 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1030 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1031 ; NOCMOV-NEXT: jae .LBB17_2
1032 ; NOCMOV-NEXT: # %bb.1:
1033 ; NOCMOV-NEXT: fstp %st(0)
1035 ; NOCMOV-NEXT: fxch %st(1)
1036 ; NOCMOV-NEXT: .LBB17_2:
1037 ; NOCMOV-NEXT: fstp %st(1)
1039 %cmp = icmp uge i32 %a, %b
1040 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
1044 define x86_fp80 @test19(i32 %a, i32 %b, x86_fp80 %x) nounwind {
1045 ; SSE-LABEL: test19:
1047 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1048 ; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1049 ; SSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1050 ; SSE-NEXT: fxch %st(1)
1051 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1052 ; SSE-NEXT: fcmovb %st(1), %st
1053 ; SSE-NEXT: fstp %st(1)
1056 ; NOSSE-LABEL: test19:
1058 ; NOSSE-NEXT: fldt {{[0-9]+}}(%esp)
1059 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1060 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1061 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1062 ; NOSSE-NEXT: fxch %st(1)
1063 ; NOSSE-NEXT: fcmovb %st(1), %st
1064 ; NOSSE-NEXT: fstp %st(1)
1067 ; NOCMOV-LABEL: test19:
1069 ; NOCMOV-NEXT: fldt {{[0-9]+}}(%esp)
1070 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
1071 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1072 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1073 ; NOCMOV-NEXT: jb .LBB18_2
1074 ; NOCMOV-NEXT: # %bb.1:
1075 ; NOCMOV-NEXT: fstp %st(0)
1077 ; NOCMOV-NEXT: fxch %st(1)
1078 ; NOCMOV-NEXT: .LBB18_2:
1079 ; NOCMOV-NEXT: fstp %st(1)
1081 %cmp = icmp ult i32 %a, %b
1082 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
1086 define x86_fp80 @test20(i32 %a, i32 %b, x86_fp80 %x) nounwind {
1087 ; SSE-LABEL: test20:
1089 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1090 ; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1091 ; SSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1092 ; SSE-NEXT: fxch %st(1)
1093 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1094 ; SSE-NEXT: fcmovbe %st(1), %st
1095 ; SSE-NEXT: fstp %st(1)
1098 ; NOSSE-LABEL: test20:
1100 ; NOSSE-NEXT: fldt {{[0-9]+}}(%esp)
1101 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1102 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1103 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1104 ; NOSSE-NEXT: fxch %st(1)
1105 ; NOSSE-NEXT: fcmovbe %st(1), %st
1106 ; NOSSE-NEXT: fstp %st(1)
1109 ; NOCMOV-LABEL: test20:
1111 ; NOCMOV-NEXT: fldt {{[0-9]+}}(%esp)
1112 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
1113 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1114 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1115 ; NOCMOV-NEXT: jbe .LBB19_2
1116 ; NOCMOV-NEXT: # %bb.1:
1117 ; NOCMOV-NEXT: fstp %st(0)
1119 ; NOCMOV-NEXT: fxch %st(1)
1120 ; NOCMOV-NEXT: .LBB19_2:
1121 ; NOCMOV-NEXT: fstp %st(1)
1123 %cmp = icmp ule i32 %a, %b
1124 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
1128 define x86_fp80 @test21(i32 %a, i32 %b, x86_fp80 %x) nounwind {
1129 ; SSE-LABEL: test21:
1131 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1132 ; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1133 ; SSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1134 ; SSE-NEXT: fxch %st(1)
1135 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1136 ; SSE-NEXT: setg %al
1137 ; SSE-NEXT: testb %al, %al
1138 ; SSE-NEXT: fcmovne %st(1), %st
1139 ; SSE-NEXT: fstp %st(1)
1142 ; NOSSE-LABEL: test21:
1144 ; NOSSE-NEXT: fldt {{[0-9]+}}(%esp)
1145 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1146 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1147 ; NOSSE-NEXT: setg %al
1148 ; NOSSE-NEXT: testb %al, %al
1149 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1150 ; NOSSE-NEXT: fxch %st(1)
1151 ; NOSSE-NEXT: fcmovne %st(1), %st
1152 ; NOSSE-NEXT: fstp %st(1)
1155 ; NOCMOV-LABEL: test21:
1157 ; NOCMOV-NEXT: fldt {{[0-9]+}}(%esp)
1158 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
1159 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1160 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1161 ; NOCMOV-NEXT: jg .LBB20_2
1162 ; NOCMOV-NEXT: # %bb.1:
1163 ; NOCMOV-NEXT: fstp %st(0)
1165 ; NOCMOV-NEXT: fxch %st(1)
1166 ; NOCMOV-NEXT: .LBB20_2:
1167 ; NOCMOV-NEXT: fstp %st(1)
1169 ; We don't emit a branch for fp80, why?
1170 %cmp = icmp sgt i32 %a, %b
1171 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
1175 define x86_fp80 @test22(i32 %a, i32 %b, x86_fp80 %x) nounwind {
1176 ; SSE-LABEL: test22:
1178 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1179 ; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1180 ; SSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1181 ; SSE-NEXT: fxch %st(1)
1182 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1183 ; SSE-NEXT: setge %al
1184 ; SSE-NEXT: testb %al, %al
1185 ; SSE-NEXT: fcmovne %st(1), %st
1186 ; SSE-NEXT: fstp %st(1)
1189 ; NOSSE-LABEL: test22:
1191 ; NOSSE-NEXT: fldt {{[0-9]+}}(%esp)
1192 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1193 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1194 ; NOSSE-NEXT: setge %al
1195 ; NOSSE-NEXT: testb %al, %al
1196 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1197 ; NOSSE-NEXT: fxch %st(1)
1198 ; NOSSE-NEXT: fcmovne %st(1), %st
1199 ; NOSSE-NEXT: fstp %st(1)
1202 ; NOCMOV-LABEL: test22:
1204 ; NOCMOV-NEXT: fldt {{[0-9]+}}(%esp)
1205 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
1206 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1207 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1208 ; NOCMOV-NEXT: jge .LBB21_2
1209 ; NOCMOV-NEXT: # %bb.1:
1210 ; NOCMOV-NEXT: fstp %st(0)
1212 ; NOCMOV-NEXT: fxch %st(1)
1213 ; NOCMOV-NEXT: .LBB21_2:
1214 ; NOCMOV-NEXT: fstp %st(1)
1216 %cmp = icmp sge i32 %a, %b
1217 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
1221 define x86_fp80 @test23(i32 %a, i32 %b, x86_fp80 %x) nounwind {
1222 ; SSE-LABEL: test23:
1224 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1225 ; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1226 ; SSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1227 ; SSE-NEXT: fxch %st(1)
1228 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1229 ; SSE-NEXT: setl %al
1230 ; SSE-NEXT: testb %al, %al
1231 ; SSE-NEXT: fcmovne %st(1), %st
1232 ; SSE-NEXT: fstp %st(1)
1235 ; NOSSE-LABEL: test23:
1237 ; NOSSE-NEXT: fldt {{[0-9]+}}(%esp)
1238 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1239 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1240 ; NOSSE-NEXT: setl %al
1241 ; NOSSE-NEXT: testb %al, %al
1242 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1243 ; NOSSE-NEXT: fxch %st(1)
1244 ; NOSSE-NEXT: fcmovne %st(1), %st
1245 ; NOSSE-NEXT: fstp %st(1)
1248 ; NOCMOV-LABEL: test23:
1250 ; NOCMOV-NEXT: fldt {{[0-9]+}}(%esp)
1251 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
1252 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1253 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1254 ; NOCMOV-NEXT: jl .LBB22_2
1255 ; NOCMOV-NEXT: # %bb.1:
1256 ; NOCMOV-NEXT: fstp %st(0)
1258 ; NOCMOV-NEXT: fxch %st(1)
1259 ; NOCMOV-NEXT: .LBB22_2:
1260 ; NOCMOV-NEXT: fstp %st(1)
1262 %cmp = icmp slt i32 %a, %b
1263 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
1267 define x86_fp80 @test24(i32 %a, i32 %b, x86_fp80 %x) nounwind {
1268 ; SSE-LABEL: test24:
1270 ; SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1271 ; SSE-NEXT: fldt {{[0-9]+}}(%esp)
1272 ; SSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1273 ; SSE-NEXT: fxch %st(1)
1274 ; SSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1275 ; SSE-NEXT: setle %al
1276 ; SSE-NEXT: testb %al, %al
1277 ; SSE-NEXT: fcmovne %st(1), %st
1278 ; SSE-NEXT: fstp %st(1)
1281 ; NOSSE-LABEL: test24:
1283 ; NOSSE-NEXT: fldt {{[0-9]+}}(%esp)
1284 ; NOSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
1285 ; NOSSE-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1286 ; NOSSE-NEXT: setle %al
1287 ; NOSSE-NEXT: testb %al, %al
1288 ; NOSSE-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1289 ; NOSSE-NEXT: fxch %st(1)
1290 ; NOSSE-NEXT: fcmovne %st(1), %st
1291 ; NOSSE-NEXT: fstp %st(1)
1294 ; NOCMOV-LABEL: test24:
1296 ; NOCMOV-NEXT: fldt {{[0-9]+}}(%esp)
1297 ; NOCMOV-NEXT: movl {{[0-9]+}}(%esp), %eax
1298 ; NOCMOV-NEXT: cmpl {{[0-9]+}}(%esp), %eax
1299 ; NOCMOV-NEXT: flds {{\.?LCPI[0-9]+_[0-9]+}}
1300 ; NOCMOV-NEXT: jle .LBB23_2
1301 ; NOCMOV-NEXT: # %bb.1:
1302 ; NOCMOV-NEXT: fstp %st(0)
1304 ; NOCMOV-NEXT: fxch %st(1)
1305 ; NOCMOV-NEXT: .LBB23_2:
1306 ; NOCMOV-NEXT: fstp %st(1)
1308 %cmp = icmp sle i32 %a, %b
1309 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x