1 ; RUN: llc -mtriple=i686-- -mcpu pentium4 < %s | FileCheck %s -check-prefix=SSE
2 ; RUN: llc -mtriple=i686-- -mcpu pentium3 < %s | FileCheck %s -check-prefix=NOSSE2
3 ; RUN: llc -mtriple=i686-- -mcpu pentium2 < %s | FileCheck %s -check-prefix=NOSSE1
4 ; RUN: llc -mtriple=i686-- -mcpu pentium < %s | FileCheck %s -check-prefix=NOCMOV
7 define double @test1(i32 %a, i32 %b, double %x) nounwind {
8 %cmp = icmp ugt i32 %a, %b
9 %sel = select i1 %cmp, double 99.0, double %x
15 ; NOSSE2-LABEL: test1:
18 ; NOSSE1-LABEL: test1:
21 ; NOCMOV-LABEL: test1:
26 define double @test2(i32 %a, i32 %b, double %x) nounwind {
27 %cmp = icmp uge i32 %a, %b
28 %sel = select i1 %cmp, double 99.0, double %x
34 ; NOSSE2-LABEL: test2:
37 ; NOSSE1-LABEL: test2:
40 ; NOCMOV-LABEL: test2:
44 define double @test3(i32 %a, i32 %b, double %x) nounwind {
45 %cmp = icmp ult i32 %a, %b
46 %sel = select i1 %cmp, double 99.0, double %x
52 ; NOSSE2-LABEL: test3:
55 ; NOSSE1-LABEL: test3:
58 ; NOCMOV-LABEL: test3:
62 define double @test4(i32 %a, i32 %b, double %x) nounwind {
63 %cmp = icmp ule i32 %a, %b
64 %sel = select i1 %cmp, double 99.0, double %x
70 ; NOSSE2-LABEL: test4:
73 ; NOSSE1-LABEL: test4:
76 ; NOCMOV-LABEL: test4:
80 define double @test5(i32 %a, i32 %b, double %x) nounwind {
81 %cmp = icmp sgt i32 %a, %b
82 %sel = select i1 %cmp, double 99.0, double %x
88 ; NOSSE2-LABEL: test5:
91 ; NOSSE1-LABEL: test5:
94 ; NOCMOV-LABEL: test5:
98 define double @test6(i32 %a, i32 %b, double %x) nounwind {
99 %cmp = icmp sge i32 %a, %b
100 %sel = select i1 %cmp, double 99.0, double %x
106 ; NOSSE2-LABEL: test6:
109 ; NOSSE1-LABEL: test6:
112 ; NOCMOV-LABEL: test6:
116 define double @test7(i32 %a, i32 %b, double %x) nounwind {
117 %cmp = icmp slt i32 %a, %b
118 %sel = select i1 %cmp, double 99.0, double %x
124 ; NOSSE2-LABEL: test7:
127 ; NOSSE1-LABEL: test7:
130 ; NOCMOV-LABEL: test7:
134 define double @test8(i32 %a, i32 %b, double %x) nounwind {
135 %cmp = icmp sle i32 %a, %b
136 %sel = select i1 %cmp, double 99.0, double %x
142 ; NOSSE2-LABEL: test8:
145 ; NOSSE1-LABEL: test8:
148 ; NOCMOV-LABEL: test8:
152 define float @test9(i32 %a, i32 %b, float %x) nounwind {
153 %cmp = icmp ugt i32 %a, %b
154 %sel = select i1 %cmp, float 99.0, float %x
160 ; NOSSE2-LABEL: test9:
163 ; NOSSE1-LABEL: test9:
166 ; NOCMOV-LABEL: test9:
170 define float @test10(i32 %a, i32 %b, float %x) nounwind {
171 %cmp = icmp uge i32 %a, %b
172 %sel = select i1 %cmp, float 99.0, float %x
178 ; NOSSE2-LABEL: test10:
181 ; NOSSE1-LABEL: test10:
184 ; NOCMOV-LABEL: test10:
188 define float @test11(i32 %a, i32 %b, float %x) nounwind {
189 %cmp = icmp ult i32 %a, %b
190 %sel = select i1 %cmp, float 99.0, float %x
196 ; NOSSE2-LABEL: test11:
199 ; NOSSE1-LABEL: test11:
202 ; NOCMOV-LABEL: test11:
206 define float @test12(i32 %a, i32 %b, float %x) nounwind {
207 %cmp = icmp ule i32 %a, %b
208 %sel = select i1 %cmp, float 99.0, float %x
214 ; NOSSE2-LABEL: test12:
217 ; NOSSE1-LABEL: test12:
220 ; NOCMOV-LABEL: test12:
224 define float @test13(i32 %a, i32 %b, float %x) nounwind {
225 %cmp = icmp sgt i32 %a, %b
226 %sel = select i1 %cmp, float 99.0, float %x
232 ; NOSSE2-LABEL: test13:
235 ; NOSSE1-LABEL: test13:
238 ; NOCMOV-LABEL: test13:
242 define float @test14(i32 %a, i32 %b, float %x) nounwind {
243 %cmp = icmp sge i32 %a, %b
244 %sel = select i1 %cmp, float 99.0, float %x
250 ; NOSSE2-LABEL: test14:
253 ; NOSSE1-LABEL: test14:
256 ; NOCMOV-LABEL: test14:
260 define float @test15(i32 %a, i32 %b, float %x) nounwind {
261 %cmp = icmp slt i32 %a, %b
262 %sel = select i1 %cmp, float 99.0, float %x
268 ; NOSSE2-LABEL: test15:
271 ; NOSSE1-LABEL: test15:
274 ; NOCMOV-LABEL: test15:
278 define float @test16(i32 %a, i32 %b, float %x) nounwind {
279 %cmp = icmp sle i32 %a, %b
280 %sel = select i1 %cmp, float 99.0, float %x
286 ; NOSSE2-LABEL: test16:
289 ; NOSSE1-LABEL: test16:
292 ; NOCMOV-LABEL: test16:
296 define x86_fp80 @test17(i32 %a, i32 %b, x86_fp80 %x) nounwind {
297 %cmp = icmp ugt i32 %a, %b
298 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
304 ; NOSSE2-LABEL: test17:
307 ; NOSSE1-LABEL: test17:
310 ; NOCMOV-LABEL: test17:
314 define x86_fp80 @test18(i32 %a, i32 %b, x86_fp80 %x) nounwind {
315 %cmp = icmp uge i32 %a, %b
316 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
322 ; NOSSE2-LABEL: test18:
325 ; NOSSE1-LABEL: test18:
328 ; NOCMOV-LABEL: test18:
332 define x86_fp80 @test19(i32 %a, i32 %b, x86_fp80 %x) nounwind {
333 %cmp = icmp ult i32 %a, %b
334 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
340 ; NOSSE2-LABEL: test19:
343 ; NOSSE1-LABEL: test19:
346 ; NOCMOV-LABEL: test19:
350 define x86_fp80 @test20(i32 %a, i32 %b, x86_fp80 %x) nounwind {
351 %cmp = icmp ule i32 %a, %b
352 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
358 ; NOSSE2-LABEL: test20:
361 ; NOSSE1-LABEL: test20:
364 ; NOCMOV-LABEL: test20:
368 define x86_fp80 @test21(i32 %a, i32 %b, x86_fp80 %x) nounwind {
369 %cmp = icmp sgt i32 %a, %b
370 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
373 ; We don't emit a branch for fp80, why?
378 ; NOSSE2-LABEL: test21:
382 ; NOSSE1-LABEL: test21:
386 ; NOCMOV-LABEL: test21:
390 define x86_fp80 @test22(i32 %a, i32 %b, x86_fp80 %x) nounwind {
391 %cmp = icmp sge i32 %a, %b
392 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
399 ; NOSSE2-LABEL: test22:
403 ; NOSSE1-LABEL: test22:
407 ; NOCMOV-LABEL: test22:
411 define x86_fp80 @test23(i32 %a, i32 %b, x86_fp80 %x) nounwind {
412 %cmp = icmp slt i32 %a, %b
413 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
420 ; NOSSE2-LABEL: test23:
424 ; NOSSE1-LABEL: test23:
428 ; NOCMOV-LABEL: test23:
432 define x86_fp80 @test24(i32 %a, i32 %b, x86_fp80 %x) nounwind {
433 %cmp = icmp sle i32 %a, %b
434 %sel = select i1 %cmp, x86_fp80 0xK4005C600000000000000, x86_fp80 %x
441 ; NOSSE2-LABEL: test24:
445 ; NOSSE1-LABEL: test24:
449 ; NOCMOV-LABEL: test24: